Skip to content

Commit 96600c4

Browse files
committed
Remove deprecated interfaces and classes
Namely QueueingConsumer, FlowListener, NullTrustManager, SingleShotLinearTimer. This has impacts on interfaces like Channel, ExceptionHandler, and the corresponding implementations. Fixes #212
1 parent ea75642 commit 96600c4

File tree

10 files changed

+2
-345
lines changed

10 files changed

+2
-345
lines changed

src/main/java/com/rabbitmq/client/Channel.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ public interface Channel extends ShutdownNotifier {
8484
*/
8585
void close(int closeCode, String closeMessage) throws IOException, TimeoutException;
8686

87-
/**
88-
* Deprecated, superseded by TCP back pressure.
89-
* Will be removed in next major release.
90-
* @deprecated
91-
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
92-
*/
93-
boolean flowBlocked();
94-
9587
/**
9688
* Abort this channel with the {@link com.rabbitmq.client.AMQP#REPLY_SUCCESS} close code
9789
* and message 'OK'.
@@ -128,37 +120,6 @@ public interface Channel extends ShutdownNotifier {
128120
*/
129121
void clearReturnListeners();
130122

131-
/**
132-
* Add a {@link FlowListener}.
133-
* Deprecated, superseded by TCP back pressure.
134-
* Will be removed in next major release.
135-
* @deprecated
136-
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
137-
* @param listener the listener to add
138-
*/
139-
void addFlowListener(FlowListener listener);
140-
141-
/**
142-
* Remove a {@link FlowListener}.
143-
* Deprecated, superseded by TCP back pressure.
144-
* Will be removed in next major release.
145-
* @deprecated
146-
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
147-
* @param listener the listener to remove
148-
* @return <code><b>true</b></code> if the listener was found and removed,
149-
* <code><b>false</b></code> otherwise
150-
*/
151-
boolean removeFlowListener(FlowListener listener);
152-
153-
/**
154-
* Remove all {@link FlowListener}s.
155-
* Deprecated, superseded by TCP back pressure.
156-
* Will be removed in next major release.
157-
* @deprecated
158-
* @see <a href="http://www.rabbitmq.com/alarms.html">Resource-driven alarms</a>
159-
*/
160-
void clearFlowListeners();
161-
162123
/**
163124
* Add a {@link ConfirmListener}.
164125
* @param listener the listener to add

src/main/java/com/rabbitmq/client/ExceptionHandler.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ public interface ExceptionHandler {
3838
*/
3939
void handleReturnListenerException(Channel channel, Throwable exception);
4040

41-
/**
42-
* Perform any required exception processing for the situation
43-
* when the driver thread for the connection has called a
44-
* FlowListener's handleFlow method, and that method has
45-
* thrown an exception.
46-
* @param channel the ChannelN that held the FlowListener
47-
* @param exception the exception thrown by FlowListener.handleFlow
48-
*/
49-
void handleFlowListenerException(Channel channel, Throwable exception);
50-
5141
/**
5242
* Perform any required exception processing for the situation
5343
* when the driver thread for the connection has called a

src/main/java/com/rabbitmq/client/FlowListener.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/main/java/com/rabbitmq/client/NullTrustManager.java

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/main/java/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel
6464
/* All listeners collections are in CopyOnWriteArrayList objects */
6565
/** The ReturnListener collection. */
6666
private final Collection<ReturnListener> returnListeners = new CopyOnWriteArrayList<ReturnListener>();
67-
/** The FlowListener collection. */
68-
private final Collection<FlowListener> flowListeners = new CopyOnWriteArrayList<FlowListener>();
6967
/** The ConfirmListener collection. */
7068
private final Collection<ConfirmListener> confirmListeners = new CopyOnWriteArrayList<ConfirmListener>();
7169

@@ -147,24 +145,6 @@ public void clearReturnListeners() {
147145
returnListeners.clear();
148146
}
149147

150-
@Override
151-
@Deprecated
152-
public void addFlowListener(FlowListener listener) {
153-
flowListeners.add(listener);
154-
}
155-
156-
@Override
157-
@Deprecated
158-
public boolean removeFlowListener(FlowListener listener) {
159-
return flowListeners.remove(listener);
160-
}
161-
162-
@Override
163-
@Deprecated
164-
public void clearFlowListeners() {
165-
flowListeners.clear();
166-
}
167-
168148
@Override
169149
public void addConfirmListener(ConfirmListener listener) {
170150
confirmListeners.add(listener);
@@ -353,7 +333,6 @@ private void releaseChannel() {
353333
transmit(new Channel.FlowOk(!_blockContent));
354334
_channelMutex.notifyAll();
355335
}
356-
callFlowListeners(command, channelFlow);
357336
return true;
358337
} else if (method instanceof Basic.Ack) {
359338
Basic.Ack ack = (Basic.Ack) method;
@@ -469,16 +448,6 @@ private void callReturnListeners(Command command, Basic.Return basicReturn) {
469448
}
470449
}
471450

472-
private void callFlowListeners(@SuppressWarnings("unused") Command command, Channel.Flow channelFlow) {
473-
try {
474-
for (FlowListener l : this.flowListeners) {
475-
l.handleFlow(channelFlow.getActive());
476-
}
477-
} catch (Throwable ex) {
478-
getConnection().getExceptionHandler().handleFlowListenerException(this, ex);
479-
}
480-
}
481-
482451
private void callConfirmListeners(@SuppressWarnings("unused") Command command, Basic.Ack ack) {
483452
try {
484453
for (ConfirmListener l : this.confirmListeners) {
@@ -1337,13 +1306,6 @@ public Confirm.SelectOk confirmSelect()
13371306

13381307
}
13391308

1340-
/** Public API - {@inheritDoc} */
1341-
@Override
1342-
@Deprecated
1343-
public boolean flowBlocked() {
1344-
return _blockContent;
1345-
}
1346-
13471309
/** Public API - {@inheritDoc} */
13481310
@Override
13491311
public long getNextPublishSeqNo() {

src/main/java/com/rabbitmq/client/impl/ForgivingExceptionHandler.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ public void handleReturnListenerException(Channel channel, Throwable exception)
4141
handleChannelKiller(channel, exception, "ReturnListener.handleReturn");
4242
}
4343

44-
@Override
45-
public void handleFlowListenerException(Channel channel, Throwable exception) {
46-
handleChannelKiller(channel, exception, "FlowListener.handleFlow");
47-
}
48-
4944
@Override
5045
public void handleConfirmListenerException(Channel channel, Throwable exception) {
5146
handleChannelKiller(channel, exception, "ConfirmListener.handle{N,A}ck");

src/main/java/com/rabbitmq/client/impl/StrictExceptionHandler.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ public void handleReturnListenerException(Channel channel, Throwable exception)
3535
handleChannelKiller(channel, exception, "ReturnListener.handleReturn");
3636
}
3737

38-
@Override
39-
public void handleFlowListenerException(Channel channel, Throwable exception) {
40-
handleChannelKiller(channel, exception, "FlowListener.handleFlow");
41-
}
42-
4338
@Override
4439
public void handleConfirmListenerException(Channel channel, Throwable exception) {
4540
handleChannelKiller(channel, exception, "ConfirmListener.handle{N,A}ck");

src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class AutorecoveringChannel implements RecoverableChannel {
3636
private final List<RecoveryListener> recoveryListeners = new CopyOnWriteArrayList<RecoveryListener>();
3737
private final List<ReturnListener> returnListeners = new CopyOnWriteArrayList<ReturnListener>();
3838
private final List<ConfirmListener> confirmListeners = new CopyOnWriteArrayList<ConfirmListener>();
39-
private final List<FlowListener> flowListeners = new CopyOnWriteArrayList<FlowListener>();
4039
private final Set<String> consumerTags = Collections.synchronizedSet(new HashSet<String>());
4140
private int prefetchCountConsumer;
4241
private int prefetchCountGlobal;
@@ -83,12 +82,6 @@ public void close(int closeCode, String closeMessage) throws IOException, Timeou
8382
}
8483
}
8584

86-
@Override
87-
@Deprecated
88-
public boolean flowBlocked() {
89-
return delegate.flowBlocked();
90-
}
91-
9285
@Override
9386
public void abort() throws IOException {
9487
delegate.abort();
@@ -117,27 +110,6 @@ public void clearReturnListeners() {
117110
delegate.clearReturnListeners();
118111
}
119112

120-
@Override
121-
@Deprecated
122-
public void addFlowListener(FlowListener listener) {
123-
this.flowListeners.add(listener);
124-
delegate.addFlowListener(listener);
125-
}
126-
127-
@Override
128-
@Deprecated
129-
public boolean removeFlowListener(FlowListener listener) {
130-
this.flowListeners.remove(listener);
131-
return delegate.removeFlowListener(listener);
132-
}
133-
134-
@Override
135-
@Deprecated
136-
public void clearFlowListeners() {
137-
this.flowListeners.clear();
138-
delegate.clearFlowListeners();
139-
}
140-
141113
@Override
142114
public void addConfirmListener(ConfirmListener listener) {
143115
this.confirmListeners.add(listener);
@@ -607,7 +579,6 @@ public void automaticallyRecover(AutorecoveringConnection connection, Connection
607579
this.recoverShutdownListeners();
608580
this.recoverReturnListeners();
609581
this.recoverConfirmListeners();
610-
this.recoverFlowListeners();
611582
this.recoverState();
612583
this.notifyRecoveryListenersComplete();
613584
}
@@ -630,13 +601,6 @@ private void recoverConfirmListeners() {
630601
}
631602
}
632603

633-
@Deprecated
634-
private void recoverFlowListeners() {
635-
for(FlowListener fl : this.flowListeners) {
636-
this.delegate.addFlowListener(fl);
637-
}
638-
}
639-
640604
private void recoverState() throws IOException {
641605
if (this.prefetchCountConsumer != 0) {
642606
basicQos(this.prefetchCountConsumer, false);

0 commit comments

Comments
 (0)