ARTEMIS-416 - Netty Acceptor allows transfer of connections when paused
Throw an exception if the acceptor is paused or not started https://issues.apache.org/jira/browse/ARTEMIS-416
This commit is contained in:
parent
8c6f45b919
commit
f6ea511b8a
|
@ -426,6 +426,9 @@ public class NettyAcceptor extends AbstractAcceptor {
|
||||||
* @param channel A Netty channel created outside this NettyAcceptor.
|
* @param channel A Netty channel created outside this NettyAcceptor.
|
||||||
*/
|
*/
|
||||||
public void transfer(Channel channel) {
|
public void transfer(Channel channel) {
|
||||||
|
if (paused || eventLoopGroup == null) {
|
||||||
|
throw ActiveMQMessageBundle.BUNDLE.acceptorUnavailable();
|
||||||
|
}
|
||||||
channel.pipeline().addLast(protocolHandler.getProtocolDecoder());
|
channel.pipeline().addLast(protocolHandler.getProtocolDecoder());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,4 +365,7 @@ public interface ActiveMQMessageBundle {
|
||||||
|
|
||||||
@Message(id = 119115, value = "Colocated Policy hasn't different type live and backup", format = Message.Format.MESSAGE_FORMAT)
|
@Message(id = 119115, value = "Colocated Policy hasn't different type live and backup", format = Message.Format.MESSAGE_FORMAT)
|
||||||
ActiveMQIllegalStateException liveBackupMismatch();
|
ActiveMQIllegalStateException liveBackupMismatch();
|
||||||
|
|
||||||
|
@Message(id = 119116, value = "Netty Acceptor unavailable", format = Message.Format.MESSAGE_FORMAT)
|
||||||
|
IllegalStateException acceptorUnavailable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue