Search in sources :

Example 21 with JMSServerManagerImpl

use of org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl in project activemq-artemis by apache.

the class ActiveMQRAClusteredTestBase method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    primaryConnector = new TransportConfiguration(INVM_CONNECTOR_FACTORY);
    HashMap<String, Object> params = new HashMap<>();
    params.put(TransportConstants.SERVER_ID_PROP_NAME, "1");
    secondaryConnector = new TransportConfiguration(INVM_CONNECTOR_FACTORY, params);
    secondaryServer = addServer(ActiveMQServers.newActiveMQServer(createSecondaryDefaultConfig(true), mbeanServer, usePersistence()));
    addServer(secondaryServer);
    secondaryJmsServer = new JMSServerManagerImpl(secondaryServer);
    secondaryJmsServer.start();
    waitForTopology(secondaryServer, 2);
}
Also used : HashMap(java.util.HashMap) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) Before(org.junit.Before)

Example 22 with JMSServerManagerImpl

use of org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl in project activemq-artemis by apache.

the class FileBrokerTest method startWithoutJMS.

@Test
public void startWithoutJMS() throws Exception {
    ServerDTO serverDTO = new ServerDTO();
    serverDTO.configuration = "broker-nojms.xml";
    FileBroker broker = null;
    try {
        broker = new FileBroker(serverDTO, new ActiveMQJAASSecurityManager());
        broker.start();
        JMSServerManagerImpl jmsServerManager = (JMSServerManagerImpl) broker.getComponents().get("jms");
        Assert.assertNull(jmsServerManager);
        ActiveMQServerImpl activeMQServer = (ActiveMQServerImpl) broker.getComponents().get("core");
        Assert.assertNotNull(activeMQServer);
        Assert.assertTrue(activeMQServer.isStarted());
        Assert.assertTrue(broker.isStarted());
    } finally {
        assert broker != null;
        broker.stop();
    }
}
Also used : FileBroker(org.apache.activemq.artemis.integration.FileBroker) ServerDTO(org.apache.activemq.artemis.dto.ServerDTO) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) ActiveMQJAASSecurityManager(org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager) ActiveMQServerImpl(org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl) Test(org.junit.Test)

Example 23 with JMSServerManagerImpl

use of org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl in project activemq-artemis by apache.

the class JMSTestBase method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    mbeanServer = MBeanServerFactory.createMBeanServer();
    Configuration config = createDefaultConfig(true).setSecurityEnabled(useSecurity()).addConnectorConfiguration("invm", new TransportConfiguration(INVM_CONNECTOR_FACTORY)).setTransactionTimeoutScanPeriod(100);
    config.getConnectorConfigurations().put("netty", new TransportConfiguration(NETTY_CONNECTOR_FACTORY));
    server = addServer(ActiveMQServers.newActiveMQServer(config, mbeanServer, usePersistence()));
    jmsServer = new JMSServerManagerImpl(server);
    namingContext = new InVMNamingContext();
    jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
    jmsServer.start();
    registerConnectionFactory();
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) ConnectionFactoryConfiguration(org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) JndiBindingRegistry(org.apache.activemq.artemis.core.registry.JndiBindingRegistry) InVMNamingContext(org.apache.activemq.artemis.tests.unit.util.InVMNamingContext) Before(org.junit.Before)

Example 24 with JMSServerManagerImpl

use of org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl in project activemq-artemis by apache.

the class JMSClusteredTestBase method setupServer1.

/**
 * @throws Exception
 */
private void setupServer1() throws Exception {
    Configuration configuration = createConfigServer(1, 2);
    JMSConfigurationImpl jmsconfig = new JMSConfigurationImpl();
    mBeanServer1 = MBeanServerFactory.createMBeanServer();
    server1 = addServer(ActiveMQServers.newActiveMQServer(configuration, mBeanServer1, enablePersistence()));
    jmsServer1 = new JMSServerManagerImpl(server1, jmsconfig);
    context1 = new InVMNamingContext();
    jmsServer1.setRegistry(new JndiBindingRegistry(context1));
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) ClusterConnectionConfiguration(org.apache.activemq.artemis.core.config.ClusterConnectionConfiguration) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) JMSConfigurationImpl(org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl) JndiBindingRegistry(org.apache.activemq.artemis.core.registry.JndiBindingRegistry) InVMNamingContext(org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)

Example 25 with JMSServerManagerImpl

use of org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl in project activemq-artemis by apache.

the class JMSBridgeImplTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    Configuration config = createBasicConfig().addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
    InVMNamingContext context = new InVMNamingContext();
    jmsServer = new JMSServerManagerImpl(addServer(ActiveMQServers.newActiveMQServer(config, false)));
    jmsServer.setRegistry(new JndiBindingRegistry(context));
    jmsServer.start();
    jmsServer.createQueue(false, JMSBridgeImplTest.SOURCE, null, true, "/queue/" + JMSBridgeImplTest.SOURCE);
    jmsServer.createQueue(false, JMSBridgeImplTest.TARGET, null, true, "/queue/" + JMSBridgeImplTest.TARGET);
}
Also used : TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) Configuration(org.apache.activemq.artemis.core.config.Configuration) JMSServerManagerImpl(org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl) TransportConfiguration(org.apache.activemq.artemis.api.core.TransportConfiguration) JndiBindingRegistry(org.apache.activemq.artemis.core.registry.JndiBindingRegistry) InVMNamingContext(org.apache.activemq.artemis.tests.unit.util.InVMNamingContext) Before(org.junit.Before)

Aggregations

JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)34 JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)25 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)22 InVMNamingContext (org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)17 Configuration (org.apache.activemq.artemis.core.config.Configuration)15 Before (org.junit.Before)13 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)11 JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)7 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)7 HashMap (java.util.HashMap)5 ActiveMQServerImpl (org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl)5 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)5 JMSConfiguration (org.apache.activemq.artemis.jms.server.config.JMSConfiguration)5 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)4 ConnectionFactoryConfiguration (org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration)4 Test (org.junit.Test)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 FileDeploymentManager (org.apache.activemq.artemis.core.config.FileDeploymentManager)3 SharedStoreMasterPolicyConfiguration (org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration)3 SecurityConfiguration (org.apache.activemq.artemis.core.config.impl.SecurityConfiguration)3