diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java index 38da780bc7..5106ed3904 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java @@ -338,7 +338,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C return createSessionInternal(null, null, xa, autoCommitSends, autoCommitAcks, preAcknowledge, serverLocator.getAckBatchSize()); } - // ConnectionLifeCycleListener implementation -------------------------------------------------- + // ClientConnectionLifeCycleListener implementation -------------------------------------------------- @Override public void connectionCreated(final ActiveMQComponent component, diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java index 30342acc6a..5288f38700 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/TransportConstants.java @@ -256,6 +256,7 @@ public class TransportConstants { allowableAcceptorKeys.add(TransportConstants.USE_NIO_PROP_NAME); allowableAcceptorKeys.add(TransportConstants.USE_EPOLL_PROP_NAME); allowableAcceptorKeys.add(TransportConstants.USE_INVM_PROP_NAME); + //noinspection deprecation allowableAcceptorKeys.add(TransportConstants.PROTOCOL_PROP_NAME); allowableAcceptorKeys.add(TransportConstants.PROTOCOLS_PROP_NAME); allowableAcceptorKeys.add(TransportConstants.HOST_PROP_NAME); diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java index 0c381f1e17..7cbee5206d 100644 --- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java +++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java @@ -50,6 +50,7 @@ import org.apache.activemq.artemis.api.core.management.ResourceNames; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; import org.apache.activemq.artemis.api.jms.JMSFactoryType; import org.apache.activemq.artemis.core.config.Configuration; +import org.apache.activemq.artemis.core.filter.Filter; import org.apache.activemq.artemis.core.postoffice.Binding; import org.apache.activemq.artemis.core.postoffice.BindingType; import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory; @@ -58,7 +59,6 @@ import org.apache.activemq.artemis.core.security.Role; import org.apache.activemq.artemis.core.server.ActivateCallback; import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; -import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; import org.apache.activemq.artemis.core.server.impl.AddressInfo; import org.apache.activemq.artemis.core.server.management.Notification; import org.apache.activemq.artemis.core.server.reload.ReloadCallback; @@ -113,7 +113,7 @@ import org.w3c.dom.NodeList; @Deprecated public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback { - private static final String REJECT_FILTER = ActiveMQServerImpl.GENERIC_IGNORED_FILTER; + private static final String REJECT_FILTER = Filter.GENERIC_IGNORED_FILTER; private BindingRegistry registry; diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java index 51e917d3a3..d600a7bc77 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java @@ -241,6 +241,7 @@ public class InVMConnector extends AbstractConnector { throw ActiveMQMessageBundle.BUNDLE.connectionExists(connection.getID()); } + //noinspection deprecation if (listener instanceof ConnectionLifeCycleListener) { listener.connectionCreated(component, connection, protocol.getName()); } else { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java index 22b162cf86..6594515bca 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/HttpAcceptorHandler.java @@ -31,7 +31,7 @@ import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; @@ -73,7 +73,7 @@ public class HttpAcceptorHandler extends ChannelDuplexHandler { @Override public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception { FullHttpRequest request = (FullHttpRequest) msg; - HttpMethod method = request.getMethod(); + HttpMethod method = request.method(); // if we are a post then we send upstream, otherwise we are just being prompted for a response. if (method.equals(HttpMethod.POST)) { ctx.fireChannelRead(ReferenceCountUtil.retain(((FullHttpRequest) msg).content())); @@ -148,11 +148,11 @@ public class HttpAcceptorHandler extends ChannelDuplexHandler { while (responseHolder == null); if (!bogusResponse) { piggyBackResponses(responseHolder.response.content()); - responseHolder.response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(responseHolder.response.content().readableBytes())); + responseHolder.response.headers().set(HttpHeaderNames.CONTENT_LENGTH, String.valueOf(responseHolder.response.content().readableBytes())); channel.writeAndFlush(responseHolder.response, promise); } else { responseHolder.response.content().writeBytes(buffer); - responseHolder.response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, String.valueOf(responseHolder.response.content().readableBytes())); + responseHolder.response.headers().set(HttpHeaderNames.CONTENT_LENGTH, String.valueOf(responseHolder.response.content().readableBytes())); channel.writeAndFlush(responseHolder.response, promise); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java index bc267765c2..d626fadfbe 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java @@ -46,6 +46,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; +import io.netty.channel.DefaultEventLoopGroup; import io.netty.channel.EventLoopGroup; import io.netty.channel.ServerChannel; import io.netty.channel.WriteBufferWaterMark; @@ -55,7 +56,6 @@ import io.netty.channel.group.ChannelGroup; import io.netty.channel.group.ChannelGroupFuture; import io.netty.channel.group.DefaultChannelGroup; import io.netty.channel.local.LocalAddress; -import io.netty.channel.local.LocalEventLoopGroup; import io.netty.channel.local.LocalServerChannel; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; @@ -300,7 +300,7 @@ public class NettyAcceptor extends AbstractAcceptor { if (useInvm) { acceptorType = INVM_ACCEPTOR_TYPE; channelClazz = LocalServerChannel.class; - eventLoopGroup = new LocalEventLoopGroup(); + eventLoopGroup = new DefaultEventLoopGroup(); } else { if (remotingThreads == -1) { diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java index 7c9c675721..a213e6d024 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java @@ -499,7 +499,7 @@ public class RemotingServiceImpl implements RemotingService, ServerConnectionLif return connectionCountLatch; } - // ConnectionLifeCycleListener implementation ----------------------------------- + // ServerConnectionLifeCycleListener implementation ----------------------------------- private ProtocolManagerFactory getProtocolManager(String protocol) { return protocolMap.get(protocol); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandler.java index 56ece3ea99..8141852520 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandler.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/protocol/websocket/WebSocketServerHandler.java @@ -29,7 +29,7 @@ import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame; @@ -41,8 +41,8 @@ import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker; import io.netty.handler.codec.http.websocketx.WebSocketServerHandshakerFactory; import org.apache.activemq.artemis.utils.StringUtil; -import static io.netty.handler.codec.http.HttpHeaders.isKeepAlive; -import static io.netty.handler.codec.http.HttpHeaders.setContentLength; +import static io.netty.handler.codec.http.HttpUtil.isKeepAlive; +import static io.netty.handler.codec.http.HttpUtil.setContentLength; import static io.netty.handler.codec.http.HttpMethod.GET; import static io.netty.handler.codec.http.HttpResponseStatus.FORBIDDEN; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; @@ -75,7 +75,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception { // Allow only GET methods. - if (req.getMethod() != GET) { + if (req.method() != GET) { sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN)); return; } @@ -123,14 +123,14 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler private void sendHttpResponse(ChannelHandlerContext ctx, HttpRequest req, FullHttpResponse res) { // Generate an error page if response status code is not OK (200). - if (res.getStatus().code() != 200) { - res.content().writeBytes(res.getStatus().toString().getBytes(StandardCharsets.UTF_8)); + if (res.status().code() != 200) { + res.content().writeBytes(res.status().toString().getBytes(StandardCharsets.UTF_8)); setContentLength(res, res.content().readableBytes()); } // Send the response and close the connection if necessary. ChannelFuture f = ctx.writeAndFlush(res); - if (!isKeepAlive(req) || res.getStatus().code() != 200) { + if (!isKeepAlive(req) || res.status().code() != 200) { f.addListener(ChannelFutureListener.CLOSE); } } @@ -142,7 +142,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler } private String getWebSocketLocation(HttpRequest req) { - return "ws://" + req.headers().get(HttpHeaders.Names.HOST) + WEBSOCKET_PATH; + return "ws://" + req.headers().get(HttpHeaderNames.HOST) + WEBSOCKET_PATH; } public HttpRequest getHttpRequest() { diff --git a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java index 43d9b28bce..9eff9f83ae 100644 --- a/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java +++ b/artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java @@ -36,7 +36,7 @@ import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.http.DefaultFullHttpRequest; import io.netty.handler.codec.http.HttpClientCodec; import io.netty.handler.codec.http.HttpContent; -import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpObject; import io.netty.handler.codec.http.HttpRequest; @@ -100,7 +100,7 @@ public class WebServerComponentTest extends Assert { URI uri = new URI(URL); // Prepare the HTTP request. HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); - request.headers().set(HttpHeaders.Names.HOST, "localhost"); + request.headers().set(HttpHeaderNames.HOST, "localhost"); // Send the HTTP request. ch.writeAndFlush(request); @@ -137,7 +137,7 @@ public class WebServerComponentTest extends Assert { URI uri = new URI(URL); // Prepare the HTTP request. HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); - request.headers().set(HttpHeaders.Names.HOST, "localhost"); + request.headers().set(HttpHeaderNames.HOST, "localhost"); // Send the HTTP request. ch.writeAndFlush(request); @@ -193,7 +193,7 @@ public class WebServerComponentTest extends Assert { URI uri = new URI(SECURE_URL); // Prepare the HTTP request. HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); - request.headers().set(HttpHeaders.Names.HOST, "localhost"); + request.headers().set(HttpHeaderNames.HOST, "localhost"); // Send the HTTP request. ch.writeAndFlush(request); @@ -247,7 +247,7 @@ public class WebServerComponentTest extends Assert { URI uri = new URI(SECURE_URL); // Prepare the HTTP request. HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); - request.headers().set(HttpHeaders.Names.HOST, "localhost"); + request.headers().set(HttpHeaderNames.HOST, "localhost"); // Send the HTTP request. ch.writeAndFlush(request); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java index da695ca0a3..2fa89fb1c8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/HangConsumerTest.java @@ -445,7 +445,7 @@ public class HangConsumerTest extends ActiveMQTestBase { try { for (int i = 0; i < 5; i++) { if (server.locateQueue(SimpleString.toSimpleString("tt")) == null) { - server.createQueue(SimpleString.toSimpleString("tt"), RoutingType.ANYCAST, SimpleString.toSimpleString("tt"), SimpleString.toSimpleString(ActiveMQServerImpl.GENERIC_IGNORED_FILTER), true, false); + server.createQueue(SimpleString.toSimpleString("tt"), RoutingType.ANYCAST, SimpleString.toSimpleString("tt"), SimpleString.toSimpleString(Filter.GENERIC_IGNORED_FILTER), true, false); } server.stop(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java index 63743edf39..532207e77b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java @@ -28,6 +28,7 @@ import javax.jms.Topic; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient; +import org.apache.activemq.artemis.core.filter.Filter; import org.apache.activemq.artemis.core.filter.impl.FilterImpl; import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.postoffice.Binding; @@ -35,7 +36,6 @@ import org.apache.activemq.artemis.core.postoffice.Bindings; import org.apache.activemq.artemis.core.postoffice.impl.BindingsImpl; import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding; import org.apache.activemq.artemis.core.server.Queue; -import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; import org.apache.activemq.artemis.core.server.impl.QueueImpl; import org.apache.activemq.artemis.jms.client.ActiveMQTopic; import org.apache.activemq.artemis.tests.util.JMSTestBase; @@ -84,7 +84,7 @@ public class TopicCleanupTest extends JMSTestBase { final Queue queue = new QueueImpl(storage.generateID(), SimpleString.toSimpleString("topic"), SimpleString.toSimpleString("topic"), - FilterImpl.createFilter(ActiveMQServerImpl.GENERIC_IGNORED_FILTER), null, + FilterImpl.createFilter(Filter.GENERIC_IGNORED_FILTER), null, true, false, false, server.getScheduledPool(), server.getPostOffice(), storage, server.getAddressSettingsRepository(), server.getExecutorFactory().getExecutor(), server); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java index ddabf1b63e..3cb605b9c6 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java @@ -1748,7 +1748,7 @@ public class PagingTest extends ActiveMQTestBase { ClientSession session = sf.createSession(false, false, false); session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS, null, true); - session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS.concat("-invalid"), new SimpleString(ActiveMQServerImpl.GENERIC_IGNORED_FILTER), true); + session.createQueue(PagingTest.ADDRESS, PagingTest.ADDRESS.concat("-invalid"), new SimpleString(Filter.GENERIC_IGNORED_FILTER), true); ClientProducer producer = session.createProducer(PagingTest.ADDRESS); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java index 0f08ecd8a8..d0f98db6d0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/transports/netty/NettyConnectorWithHTTPUpgradeTest.java @@ -63,7 +63,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import static io.netty.handler.codec.http.HttpHeaders.Names.UPGRADE; +import static io.netty.handler.codec.http.HttpHeaderNames.UPGRADE; import static io.netty.handler.codec.http.HttpResponseStatus.SWITCHING_PROTOCOLS; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; import static org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector.MAGIC_NUMBER; diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java index 5b60ef0777..d302be786b 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/remoting/impl/netty/NettyConnectorTest.java @@ -36,6 +36,26 @@ import org.junit.Test; public class NettyConnectorTest extends ActiveMQTestBase { + private ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { + @Override + public void connectionException(final Object connectionID, final ActiveMQException me) { + } + + @Override + public void connectionDestroyed(final Object connectionID) { + } + + @Override + public void connectionCreated(final ActiveMQComponent component, + final Connection connection, + final ClientProtocolManager protocol) { + } + + @Override + public void connectionReadyForWrites(Object connectionID, boolean ready) { + } + }; + @Test public void testStartStop() throws Exception { BufferHandler handler = new BufferHandler() { @@ -44,25 +64,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { } }; Map params = new HashMap<>(); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; NettyConnector connector = new NettyConnector(params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); @@ -80,25 +81,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { } }; Map params = new HashMap<>(); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; try { new NettyConnector(params, null, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); @@ -130,25 +112,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "bad password"); params.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, "bad path"); params.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, "bad password"); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; NettyConnector connector = new NettyConnector(params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); @@ -176,25 +139,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "bad password"); params.put(TransportConstants.TRUSTSTORE_PATH_PROP_NAME, "bad path"); params.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, "bad password"); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; NettyConnector connector = new NettyConnector(params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); @@ -224,25 +168,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { Map params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.ENABLED_CIPHER_SUITES_PROP_NAME, "myBadCipherSuite"); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; NettyConnector connector = new NettyConnector(params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory())); @@ -263,25 +188,6 @@ public class NettyConnectorTest extends ActiveMQTestBase { Map params = new HashMap<>(); params.put(TransportConstants.SSL_ENABLED_PROP_NAME, true); params.put(TransportConstants.ENABLED_PROTOCOLS_PROP_NAME, "myBadProtocol"); - ClientConnectionLifeCycleListener listener = new ClientConnectionLifeCycleListener() { - @Override - public void connectionException(final Object connectionID, final ActiveMQException me) { - } - - @Override - public void connectionDestroyed(final Object connectionID) { - } - - @Override - public void connectionCreated(final ActiveMQComponent component, - final Connection connection, - final ClientProtocolManager protocol) { - } - - @Override - public void connectionReadyForWrites(Object connectionID, boolean ready) { - } - }; NettyConnector connector = new NettyConnector(params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(5, ActiveMQThreadFactory.defaultThreadFactory()));