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
}
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));
}
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));
}
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();
}
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();
}
Aggregations