use of org.apache.activemq.artemis.core.server.ActiveMQComponent 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);
}
use of org.apache.activemq.artemis.core.server.ActiveMQComponent in project activemq-artemis by apache.
the class OsgiBroker method getComponentsByStartOrder.
/*
* this makes sure the components are started in the correct order. Its
* simple at the mo as e only have core and jms but will need impproving if
* we get more.
*/
public ArrayList<ActiveMQComponent> getComponentsByStartOrder(Map<String, ActiveMQComponent> components) {
ArrayList<ActiveMQComponent> activeMQComponents = new ArrayList<>();
ActiveMQComponent jmsComponent = components.get("jms");
if (jmsComponent != null) {
activeMQComponents.add(jmsComponent);
}
activeMQComponents.add(components.get("core"));
return activeMQComponents;
}
Aggregations