use of org.apache.activemq.artemis.spi.core.remoting.Connection in project activemq-artemis by apache.
the class NettyAcceptorFactoryTest method testCreateAcceptor.
@Test
public void testCreateAcceptor() throws Exception {
NettyAcceptorFactory factory = new NettyAcceptorFactory();
Map<String, Object> params = new HashMap<>();
BufferHandler handler = new BufferHandler() {
@Override
public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer) {
}
};
ServerConnectionLifeCycleListener listener = new ServerConnectionLifeCycleListener() {
@Override
public void connectionException(final Object connectionID, final ActiveMQException me) {
}
@Override
public void connectionDestroyed(final Object connectionID) {
}
@Override
public void connectionCreated(ActiveMQComponent component, final Connection connection, final ProtocolManager protocol) {
}
@Override
public void connectionReadyForWrites(Object connectionID, boolean ready) {
}
};
Acceptor acceptor = factory.createAcceptor("netty", null, params, handler, listener, Executors.newCachedThreadPool(ActiveMQThreadFactory.defaultThreadFactory()), Executors.newScheduledThreadPool(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize(), ActiveMQThreadFactory.defaultThreadFactory()), new HashMap<String, ProtocolManager>());
Assert.assertTrue(acceptor instanceof NettyAcceptor);
}
Aggregations