Search in sources :

Example 11 with JndiBindingRegistry

use of org.apache.activemq.artemis.core.registry.JndiBindingRegistry in project activemq-artemis by apache.

the class BridgeTestBase method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    // Start the servers
    Configuration conf0 = createBasicConfig().setJournalDirectory(getJournalDir(0, false)).setBindingsDirectory(getBindingsDir(0, false)).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY));
    server0 = addServer(ActiveMQServers.newActiveMQServer(conf0, false));
    context0 = new InVMNamingContext();
    jmsServer0 = new JMSServerManagerImpl(server0);
    jmsServer0.setRegistry(new JndiBindingRegistry(context0));
    jmsServer0.start();
    params1 = new HashMap<>();
    params1.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
    Configuration conf1 = createBasicConfig().setJournalDirectory(getJournalDir(1, false)).setBindingsDirectory(getBindingsDir(1, false)).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, params1));
    server1 = addServer(ActiveMQServers.newActiveMQServer(conf1, false));
    context1 = new InVMNamingContext();
    jmsServer1 = new JMSServerManagerImpl(server1);
    jmsServer1.setRegistry(new JndiBindingRegistry(context1));
    jmsServer1.start();
    createQueue("sourceQueue", 0);
    jmsServer0.createTopic(false, "sourceTopic", "/topic/sourceTopic");
    createQueue("localTargetQueue", 0);
    createQueue("targetQueue", 1);
    setUpAdministeredObjects();
    TxControl.enable();
// We need a local transaction and recovery manager
// We must start this after the remote servers have been created or it won't
// have deleted the database and the recovery manager may attempt to recover transactions
}
Also used : Configuration(org.apache.activemq.artemis.core.config.Configuration) 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 12 with JndiBindingRegistry

use of org.apache.activemq.artemis.core.registry.JndiBindingRegistry in project activemq-artemis by apache.

the class JMSClusteredTestBase method setupServer2.

/**
 * @throws Exception
 */
private void setupServer2() throws Exception {
    Configuration configuration = createConfigServer(2, 1);
    JMSConfigurationImpl jmsconfig = new JMSConfigurationImpl();
    mBeanServer2 = MBeanServerFactory.createMBeanServer();
    server2 = addServer(ActiveMQServers.newActiveMQServer(configuration, mBeanServer2, enablePersistence()));
    jmsServer2 = new JMSServerManagerImpl(server2, jmsconfig);
    context2 = new InVMNamingContext();
    jmsServer2.setRegistry(new JndiBindingRegistry(context2));
}
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 13 with JndiBindingRegistry

use of org.apache.activemq.artemis.core.registry.JndiBindingRegistry in project activemq-artemis by apache.

the class XmlImportExportTest method basicSetUp.

/**
 * @return ClientSession
 * @throws Exception
 */
private ClientSession basicSetUp() throws Exception {
    server = createServer(true);
    server.getConfiguration().getConnectorConfigurations().put("in-vm1", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    server.getConfiguration().getConnectorConfigurations().put("in-vm2", new TransportConfiguration(INVM_CONNECTOR_FACTORY));
    jmsServer = new JMSServerManagerImpl(server);
    addActiveMQComponent(jmsServer);
    namingContext = new InVMContext();
    jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
    jmsServer.start();
    locator = createInVMNonHALocator();
    factory = createSessionFactory(locator);
    checkForLongs();
    return addClientSession(factory.createSession(false, true, true));
}
Also used : 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) InVMContext(org.apache.activemq.artemis.tests.unit.util.InVMContext)

Example 14 with JndiBindingRegistry

use of org.apache.activemq.artemis.core.registry.JndiBindingRegistry in project activemq-artemis by apache.

the class JMSTestBase method restartServer.

protected void restartServer() throws Exception {
    namingContext = new InVMNamingContext();
    jmsServer.setRegistry(new JndiBindingRegistry(namingContext));
    jmsServer.start();
    jmsServer.activated();
    registerConnectionFactory();
}
Also used : JndiBindingRegistry(org.apache.activemq.artemis.core.registry.JndiBindingRegistry) InVMNamingContext(org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)

Example 15 with JndiBindingRegistry

use of org.apache.activemq.artemis.core.registry.JndiBindingRegistry 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)

Aggregations

JndiBindingRegistry (org.apache.activemq.artemis.core.registry.JndiBindingRegistry)26 JMSServerManagerImpl (org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl)25 TransportConfiguration (org.apache.activemq.artemis.api.core.TransportConfiguration)20 InVMNamingContext (org.apache.activemq.artemis.tests.unit.util.InVMNamingContext)18 Configuration (org.apache.activemq.artemis.core.config.Configuration)13 Before (org.junit.Before)11 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)7 JMSConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl)6 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)4 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)4 ConnectionFactoryConfiguration (org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration)4 JMSConfiguration (org.apache.activemq.artemis.jms.server.config.JMSConfiguration)4 ActiveMQJAASSecurityManager (org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 SharedStoreMasterPolicyConfiguration (org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration)3 SharedStoreSlavePolicyConfiguration (org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration)3 Role (org.apache.activemq.artemis.core.security.Role)3 JMSQueueConfigurationImpl (org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl)3 ArrayList (java.util.ArrayList)2