当前位置: 首页>>代码示例>>Java>>正文


Java InVMAcceptorFactory类代码示例

本文整理汇总了Java中org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory的典型用法代码示例。如果您正苦于以下问题:Java InVMAcceptorFactory类的具体用法?Java InVMAcceptorFactory怎么用?Java InVMAcceptorFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InVMAcceptorFactory类属于org.apache.activemq.artemis.core.remoting.impl.invm包,在下文中一共展示了InVMAcceptorFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: before

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void before() throws Exception {
  mockTracer.reset();

  org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();

  HashSet<TransportConfiguration> transports = new HashSet<>();
  transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
  configuration.setAcceptorConfigurations(transports);
  configuration.setSecurityEnabled(false);

  File targetDir = new File(System.getProperty("user.dir") + "/target");
  configuration.setBrokerInstance(targetDir);

  server = new ActiveMQServerImpl(configuration);
  server.start();
  ActiveMQJMSConnectionFactory connectionFactory = new ActiveMQJMSConnectionFactory("vm://0");
  connection = connectionFactory.createConnection();

  connection.start();

  session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
}
 
开发者ID:opentracing-contrib,项目名称:java-jms,代码行数:24,代码来源:TracingArtemisTest.java

示例2: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
  org.apache.activemq.artemis.core.config.Configuration configuration = new ConfigurationImpl();

  HashSet<TransportConfiguration> transports = new HashSet<>();
  transports.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
  configuration.setAcceptorConfigurations(transports);
  configuration.setSecurityEnabled(false);

  File targetDir = new File(System.getProperty("user.dir") + "/target");
  configuration.setBrokerInstance(targetDir);

  ActiveMQServer temp = new ActiveMQServerImpl(configuration);
  temp.start();

  server = temp;
}
 
开发者ID:opentracing-contrib,项目名称:java-spring-cloud,代码行数:17,代码来源:JmsArtemisManualServerTest.java

示例3: createConfiguration

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java

示例4: createConfiguration

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public Configuration createConfiguration() {
	ConfigurationImpl configuration = new ConfigurationImpl();
	configuration.setSecurityEnabled(false);
	configuration.setPersistenceEnabled(this.properties.isPersistent());
	String dataDir = getDataDir();
	configuration.setJournalDirectory(dataDir + "/journal");
	if (this.properties.isPersistent()) {
		configuration.setJournalType(JournalType.NIO);
		configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
		configuration.setBindingsDirectory(dataDir + "/bindings");
		configuration.setPagingDirectory(dataDir + "/paging");
	}
	TransportConfiguration transportConfiguration = new TransportConfiguration(
			InVMAcceptorFactory.class.getName(),
			this.properties.generateTransportParameters());
	configuration.getAcceptorConfigurations().add(transportConfiguration);
	if (this.properties.isDefaultClusterPassword()) {
		this.logger.debug("Using default Artemis cluster password: "
				+ this.properties.getClusterPassword());
	}
	configuration.setClusterPassword(this.properties.getClusterPassword());
	return configuration;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:24,代码来源:ArtemisEmbeddedConfigurationFactory.java

示例5: setup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
   activeMQServer.start();

   HashMap<String, Object> transportConfig = new HashMap<>();

   serverLocator = new ServerLocatorImpl(false, new TransportConfiguration(InVMConnectorFactory.class.getName(), transportConfig));
   sessionFactory = serverLocator.createSessionFactory();
   consumerSessionFactory = serverLocator.createSessionFactory();

   SimpleString addr = SimpleString.toSimpleString("testQueue");
   activeMQServer.addAddressInfo(new AddressInfo(addr, RoutingType.MULTICAST));
   activeMQServer.createQueue(addr, RoutingType.MULTICAST, addr, null, false, false);
   session = sessionFactory.createSession(true, true);
   producer = session.createProducer(addr);
   session.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:RawAckTest.java

示例6: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin();
   Map<String, String> map = new HashMap<>();
   map.put(LegacyLDAPSecuritySettingPlugin.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_URL, "ldap://localhost:1024");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_USERNAME, "uid=admin,ou=system");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PASSWORD, "secret");
   map.put(LegacyLDAPSecuritySettingPlugin.CONNECTION_PROTOCOL, "s");
   map.put(LegacyLDAPSecuritySettingPlugin.AUTHENTICATION, "simple");
   map.put(LegacyLDAPSecuritySettingPlugin.ENABLE_LISTENER, "true");
   legacyLDAPSecuritySettingPlugin.init(map);

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);

   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:22,代码来源:LegacyLDAPSecuritySettingPluginListenerTest.java

示例7: createServer

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
/**
 * @return
 * @throws Exception
 */
private JMSServerManager createServer() throws Exception {
   Map<String, Object> params = new HashMap<>();
   params.put(TransportConstants.PROTOCOLS_PROP_NAME, StompProtocolManagerFactory.STOMP_PROTOCOL_NAME);
   params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT + 1);
   TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);

   Configuration config = createBasicConfig().addAcceptorConfiguration(stompTransport).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName())).addQueueConfiguration(new CoreQueueConfiguration().setAddress(getQueueName()).setName(getQueueName()).setDurable(false));

   ActiveMQServer activeMQServer = addServer(ActiveMQServers.newActiveMQServer(config));

   JMSConfiguration jmsConfig = new JMSConfigurationImpl();
   server = new JMSServerManagerImpl(activeMQServer, jmsConfig);
   server.setRegistry(null);
   return server;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:20,代码来源:StompWebSocketTest.java

示例8: testAttributes

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Test
public void testAttributes() throws Exception {
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   acceptorConfig.getParams().put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "password");

   Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig);
   ActiveMQServer service = createServer(false, config);
   service.setMBeanServer(mbeanServer);
   service.start();

   AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());

   Assert.assertEquals(acceptorConfig.getName(), acceptorControl.getName());
   Assert.assertEquals(acceptorConfig.getFactoryClassName(), acceptorControl.getFactoryClassName());
   Assert.assertNotEquals(acceptorConfig.getParams().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME), acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
   Assert.assertEquals("****", acceptorControl.getParameters().get(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME));
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:18,代码来源:AcceptorControlTest.java

示例9: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
   System.out.println("\nStarting Embedded");
   if (activeMQServer == null) {
      Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
      activeMQServer.start();
   }
   tjws.start();
   manager.setConfiguration(config);
   manager.start();
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:Embedded.java

示例10: startup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public static void startup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
   activeMQServer.start();

   deployment = EmbeddedContainer.start();
   manager = new MessageServiceManager(null);
   manager.start();
   deployment.getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   deployment.getRegistry().addSingletonResource(manager.getTopicManager().getDestination());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:PersistentPushQueueConsumerTest.java

示例11: start

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
public void start() throws Exception {
   System.out.println("\nStarting EmbeddedTestServer");
   if (activeMQServer == null) {
      Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

      activeMQServer = ActiveMQServers.newActiveMQServer(configuration);
      activeMQServer.start();
   }
   tjws.start();
   manager.setConfiguration(config);
   manager.start();
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getQueueManager().getDestination());
   tjws.getDeployment().getRegistry().addSingletonResource(manager.getTopicManager().getDestination());

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:EmbeddedTestServer.java

示例12: setup

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@BeforeClass
public static void setup() throws Exception {
   Configuration configuration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(false).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()));

   server = ActiveMQServers.newActiveMQServer(configuration);
   server.start();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:PersistentPushTopicConsumerTest.java

示例13: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   LegacyLDAPSecuritySettingPlugin legacyLDAPSecuritySettingPlugin = new LegacyLDAPSecuritySettingPlugin().setInitialContextFactory("com.sun.jndi.ldap.LdapCtxFactory").setConnectionURL("ldap://localhost:1024").setConnectionUsername("uid=admin,ou=system").setConnectionPassword("secret").setConnectionProtocol("s").setAuthentication("simple");

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false)).setPersistenceEnabled(false).addSecuritySettingPlugin(legacyLDAPSecuritySettingPlugin);

   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:13,代码来源:LegacyLDAPSecuritySettingPluginTest.java

示例14: setUp

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
   locator = ActiveMQClient.createServerLocatorWithoutHA(new TransportConfiguration(InVMConnectorFactory.class.getCanonicalName()));
   testDir = temporaryFolder.getRoot().getAbsolutePath();

   ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager("LDAPLogin");
   Configuration configuration = new ConfigurationImpl().setSecurityEnabled(true).addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getCanonicalName())).setJournalDirectory(ActiveMQTestBase.getJournalDir(testDir, 0, false)).setBindingsDirectory(ActiveMQTestBase.getBindingsDir(testDir, 0, false)).setPagingDirectory(ActiveMQTestBase.getPageDir(testDir, 0, false)).setLargeMessagesDirectory(ActiveMQTestBase.getLargeMessagesDir(testDir, 0, false));
   server = ActiveMQServers.newActiveMQServer(configuration, ManagementFactory.getPlatformMBeanServer(), securityManager, false);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:LDAPSecurityTest.java

示例15: testNotifications

import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory; //导入依赖的package包/类
@Test
public void testNotifications() throws Exception {
   TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   TransportConfiguration acceptorConfig2 = new TransportConfiguration(NettyAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
   Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addAcceptorConfiguration(acceptorConfig2);
   ActiveMQServer service = createServer(false, config);
   service.setMBeanServer(mbeanServer);
   service.start();

   AcceptorControl acceptorControl = createManagementControl(acceptorConfig2.getName());

   SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener();

   service.getManagementService().addNotificationListener(notifListener);

   Assert.assertEquals(0, notifListener.getNotifications().size());

   acceptorControl.stop();

   Assert.assertEquals(usingCore() ? 5 : 1, notifListener.getNotifications().size());
   Notification notif = notifListener.getNotifications().get(usingCore() ? 2 : 0);
   Assert.assertEquals(CoreNotificationType.ACCEPTOR_STOPPED, notif.getType());
   Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());

   acceptorControl.start();

   Assert.assertEquals(usingCore() ? 10 : 2, notifListener.getNotifications().size());
   notif = notifListener.getNotifications().get(usingCore() ? 7 : 1);
   Assert.assertEquals(CoreNotificationType.ACCEPTOR_STARTED, notif.getType());
   Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:AcceptorControlTest.java


注:本文中的org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。