热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration.getName()方法的使用及代码示例

本文整理了Java中org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration.getName()

本文整理了Java中org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration.getName()方法的一些代码示例,展示了DiscoveryGroupConfiguration.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DiscoveryGroupConfiguration.getName()方法的具体详情如下:
包路径:org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration
类名称:DiscoveryGroupConfiguration
方法名:getName

DiscoveryGroupConfiguration.getName介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: apache/activemq-artemis

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: apache/activemq-artemis

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: org.apache.activemq/artemis-core-client

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: apache/activemq-artemis

private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
}

代码示例来源:origin: org.wildfly/wildfly-messaging-activemq

final String name = groupConfiguration.getName();
final String key = "discovery" + name;
final DiscoveryGroupConfiguration config;

代码示例来源:origin: org.jboss.eap/wildfly-messaging-activemq

final String name = groupConfiguration.getName();
final String key = "discovery" + name;
final DiscoveryGroupConfiguration config;

代码示例来源:origin: apache/activemq-artemis

private void createDiscoveryFactoryJGroupsFile() throws Exception {
// Deploy a connection factory with discovery
List bindings = new ArrayList<>();
bindings.add("MyConnectionFactory");
JGroupsFileBroadcastEndpointFactory cOnfig= new JGroupsFileBroadcastEndpointFactory().setChannelName("myChannel").setFile("/META-INF/myfile.xml");
DiscoveryGroupConfiguration dcCOnfig= new DiscoveryGroupConfiguration().setName("dg1").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(config);
jmsServer.getActiveMQServer().getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
jmsServer.createConnectionFactory("MyConnectionFactory", false, JMSFactoryType.CF, dcConfig.getName(), "/MyConnectionFactory");
}

代码示例来源:origin: apache/activemq-artemis

private void createDiscoveryFactoryJGroupsProperties() throws Exception {
// Deploy a connection factory with discovery
List bindings = new ArrayList<>();
bindings.add("MyConnectionFactory");
JGroupsPropertiesBroadcastEndpointFactory cOnfig= new JGroupsPropertiesBroadcastEndpointFactory().setChannelName("myChannel").setProperties("param=1,param2=2");
DiscoveryGroupConfiguration dcCOnfig= new DiscoveryGroupConfiguration().setName("dg1").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(config);
jmsServer.getActiveMQServer().getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
jmsServer.createConnectionFactory("MyConnectionFactory", false, JMSFactoryType.CF, dcConfig.getName(), "/MyConnectionFactory");
}

代码示例来源:origin: org.wildfly/wildfly-messaging-activemq

private DiscoveryGroupConfiguration translateDiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration newDiscoveryGroupConfiguration) throws StartException {
org.apache.activemq.artemis.api.core.BroadcastEndpointFactory newBroadcastEndpointFactory = newDiscoveryGroupConfiguration.getBroadcastEndpointFactory();
BroadcastEndpointFactoryConfiguration legacyBroadcastEndpointFactory;
if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) {
org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) newBroadcastEndpointFactory;
legacyBroadcastEndpointFactory = new UDPBroadcastGroupConfiguration(
factory.getGroupAddress(),
factory.getGroupPort(),
factory.getLocalBindAddress(),
factory.getLocalBindPort());
} else if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) {
org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) newBroadcastEndpointFactory;
legacyBroadcastEndpointFactory = new org.hornetq.api.core.JGroupsBroadcastGroupConfiguration(
factory.getChannel(),
factory.getChannelName());
} else {
throw MessagingLogger.ROOT_LOGGER.unsupportedBroadcastGroupConfigurationForLegacy(newBroadcastEndpointFactory.getClass().getName());
}
return new DiscoveryGroupConfiguration(newDiscoveryGroupConfiguration.getName(),
newDiscoveryGroupConfiguration.getRefreshTimeout(),
newDiscoveryGroupConfiguration.getDiscoveryInitialWaitTimeout(),
legacyBroadcastEndpointFactory);
}

代码示例来源:origin: org.jboss.eap/wildfly-messaging-activemq

private DiscoveryGroupConfiguration translateDiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration newDiscoveryGroupConfiguration) throws StartException {
org.apache.activemq.artemis.api.core.BroadcastEndpointFactory newBroadcastEndpointFactory = newDiscoveryGroupConfiguration.getBroadcastEndpointFactory();
BroadcastEndpointFactoryConfiguration legacyBroadcastEndpointFactory;
if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) {
org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) newBroadcastEndpointFactory;
legacyBroadcastEndpointFactory = new UDPBroadcastGroupConfiguration(
factory.getGroupAddress(),
factory.getGroupPort(),
factory.getLocalBindAddress(),
factory.getLocalBindPort());
} else if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) {
org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) newBroadcastEndpointFactory;
legacyBroadcastEndpointFactory = new org.hornetq.api.core.JGroupsBroadcastGroupConfiguration(
factory.getChannel(),
factory.getChannelName());
} else {
throw MessagingLogger.ROOT_LOGGER.unsupportedBroadcastGroupConfigurationForLegacy(newBroadcastEndpointFactory.getClass().getName());
}
return new DiscoveryGroupConfiguration(newDiscoveryGroupConfiguration.getName(),
newDiscoveryGroupConfiguration.getRefreshTimeout(),
newDiscoveryGroupConfiguration.getDiscoveryInitialWaitTimeout(),
legacyBroadcastEndpointFactory);
}

代码示例来源:origin: apache/activemq-artemis

private void createDiscoveryFactoryUDP() throws Exception {
// Deploy a connection factory with discovery
List bindings = new ArrayList<>();
bindings.add("MyConnectionFactory");
final String groupAddress = getUDPDiscoveryAddress();
final int port = getUDPDiscoveryPort();
String localBindAddress = getLocalHost().getHostAddress();
UDPBroadcastEndpointFactory cOnfig= new UDPBroadcastEndpointFactory().setGroupAddress(groupAddress).setGroupPort(port).setLocalBindAddress(localBindAddress).setLocalBindPort(8580);
DiscoveryGroupConfiguration dcCOnfig= new DiscoveryGroupConfiguration().setName("dg1").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(config);
jmsServer.getActiveMQServer().getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
jmsServer.createConnectionFactory("MyConnectionFactory", false, JMSFactoryType.CF, dcConfig.getName(), "/MyConnectionFactory");
}

代码示例来源:origin: apache/activemq-artemis

@Override
@Before
public void setUp() throws Exception {
try {
super.setUp();
PlainConfigurator cOnfigurator= new PlainConfigurator(jgroupsConfigString);
channel = new JChannel(configurator);
String channelName1 = "channel1";
String channelName2 = "channel2";
BroadcastEndpointFactory jgroupsBroadcastCfg1 = new ChannelBroadcastEndpointFactory(channel, channelName1);
BroadcastEndpointFactory jgroupsBroadcastCfg2 = new JGroupsFileBroadcastEndpointFactory().setChannelName(channelName2).setFile(jgroupsConfigString);
DiscoveryGroupConfiguration dcConfig1 = new DiscoveryGroupConfiguration().setName("dg1").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(jgroupsBroadcastCfg1);
DiscoveryGroupConfiguration dcConfig2 = new DiscoveryGroupConfiguration().setName("dg2").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(jgroupsBroadcastCfg2);
jmsServer.getActiveMQServer().getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig1.getName(), dcConfig1);
jmsServer.getActiveMQServer().getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig2.getName(), dcConfig2);
jmsServer.createConnectionFactory("ConnectionFactory1", false, JMSFactoryType.CF, dcConfig1.getName(), "/ConnectionFactory1");
jmsServer.createConnectionFactory("ConnectionFactory2", false, JMSFactoryType.CF, dcConfig2.getName(), "/ConnectionFactory2");
testQueue = createQueue("testQueueFor1389");
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}

代码示例来源:origin: apache/activemq-artemis

@Test
public void testConnectionFactoryUDP() throws Exception {
createDiscoveryFactoryUDP();
cf = (ActiveMQConnectionFactory) namingContext.lookup("/MyConnectionFactory");
// apparently looking up the connection factory with the org.apache.activemq.artemis.jms.tests.tools.container.InVMInitialContextFactory
// is not enough to actually serialize it so we serialize it manually
byte[] x = serialize(cf);
ActiveMQConnectionFactory y = deserialize(x, ActiveMQConnectionFactory.class);
checkEquals(cf, y);
DiscoveryGroupConfiguration dgc = y.getDiscoveryGroupConfiguration();
Assert.assertEquals(dgc.getName(), "dg1");
Assert.assertEquals(dgc.getDiscoveryInitialWaitTimeout(), 5000);
Assert.assertEquals(dgc.getRefreshTimeout(), 5000);
Assert.assertTrue(dgc.getBroadcastEndpointFactory() instanceof UDPBroadcastEndpointFactory);
UDPBroadcastEndpointFactory befc = (UDPBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
Assert.assertEquals(Integer.parseInt(System.getProperty("org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory.localBindPort", "-1")), befc.getLocalBindPort());
Assert.assertEquals(System.getProperty("org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory.localBindAddress"), befc.getLocalBindAddress());
Assert.assertEquals(getUDPDiscoveryPort(), befc.getGroupPort());
Assert.assertEquals(getUDPDiscoveryAddress(), befc.getGroupAddress());
}

代码示例来源:origin: apache/activemq-artemis

protected void setupBackupServerWithDiscovery(final int node,
final int liveNode,
final String groupAddress,
final int port,
final boolean fileStorage,
final boolean netty,
final boolean sharedStorage) throws Exception {
if (servers[node] != null) {
throw new IllegalArgumentException("Already a server at node " + node);
}
Map params = generateParams(node, netty);
TransportConfiguration cOnnector= createTransportConfiguration(netty, false, params);
List cOnnectorPairs= new ArrayList<>();
connectorPairs.add(connector.getName());
UDPBroadcastEndpointFactory endpoint = new UDPBroadcastEndpointFactory().setGroupAddress(groupAddress).setGroupPort(port);
BroadcastGroupConfiguration bcCOnfig= new BroadcastGroupConfiguration().setName("bg1").setBroadcastPeriod(1000).setConnectorInfos(connectorPairs).setEndpointFactory(endpoint);
DiscoveryGroupConfiguration dcCOnfig= new DiscoveryGroupConfiguration().setName("dg1").setRefreshTimeout(5000).setDiscoveryInitialWaitTimeout(5000).setBroadcastEndpointFactory(endpoint);
Configuration cOnfiguration= createBasicConfig(sharedStorage ? liveNode : node).clearAcceptorConfigurations().addAcceptorConfiguration(createTransportConfiguration(netty, true, params)).addConnectorConfiguration(connector.getName(), connector).addBroadcastGroupConfiguration(bcConfig).addDiscoveryGroupConfiguration(dcConfig.getName(), dcConfig).setHAPolicyConfiguration(sharedStorage ? new SharedStoreSlavePolicyConfiguration() : new ReplicatedPolicyConfiguration());
ActiveMQServer server;
if (sharedStorage) {
server = createInVMFailoverServer(fileStorage, configuration, nodeManagers[liveNode], liveNode);
} else {
boolean enablePersistency = fileStorage ? configuration.isPersistenceEnabled() : false;
server = addServer(ActiveMQServers.newActiveMQServer(configuration, enablePersistency));
}
servers[node] = server;
}

代码示例来源:origin: apache/activemq-artemis

@Test
public void testConnectionFactoryJgroupsFile() throws Exception {
createDiscoveryFactoryJGroupsFile();
cf = (ActiveMQConnectionFactory) namingContext.lookup("/MyConnectionFactory");
// apparently looking up the connection factory with the org.apache.activemq.artemis.jms.tests.tools.container.InVMInitialContextFactory
// is not enough to actually serialize it so we serialize it manually
byte[] x = serialize(cf);
ActiveMQConnectionFactory y = deserialize(x, ActiveMQConnectionFactory.class);
checkEquals(cf, y);
DiscoveryGroupConfiguration dgc = y.getDiscoveryGroupConfiguration();
Assert.assertEquals(dgc.getName(), "dg1");
Assert.assertEquals(dgc.getDiscoveryInitialWaitTimeout(), 5000);
Assert.assertEquals(dgc.getRefreshTimeout(), 5000);
Assert.assertTrue(dgc.getBroadcastEndpointFactory() instanceof JGroupsFileBroadcastEndpointFactory);
JGroupsFileBroadcastEndpointFactory befc = (JGroupsFileBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
Assert.assertEquals("myChannel", befc.getChannelName());
Assert.assertEquals("/META-INF/myfile.xml", befc.getFile());
}

代码示例来源:origin: apache/activemq-artemis

Configuration cOnfiguration= createBasicConfig(node).setJournalMaxIO_AIO(1000).clearAcceptorConfigurations().addAcceptorConfiguration(createTransportConfiguration(netty, true, params)).addConnectorConfiguration(connector.getName(), connector).addBroadcastGroupConfiguration(bcConfig).addDiscoveryGroupConfiguration(dcConfig.getName(), dcConfig).setHAPolicyConfiguration(sharedStorage ? new SharedStoreMasterPolicyConfiguration() : new ReplicatedPolicyConfiguration());

代码示例来源:origin: apache/activemq-artemis

@Test
public void testConnectionFactoryJgroupsProperties() throws Exception {
createDiscoveryFactoryJGroupsProperties();
cf = (ActiveMQConnectionFactory) namingContext.lookup("/MyConnectionFactory");
// apparently looking up the connection factory with the org.apache.activemq.artemis.jms.tests.tools.container.InVMInitialContextFactory
// is not enough to actually serialize it so we serialize it manually
byte[] x = serialize(cf);
ActiveMQConnectionFactory y = deserialize(x, ActiveMQConnectionFactory.class);
checkEquals(cf, y);
DiscoveryGroupConfiguration dgc = y.getDiscoveryGroupConfiguration();
Assert.assertEquals(dgc.getName(), "dg1");
Assert.assertEquals(dgc.getDiscoveryInitialWaitTimeout(), 5000);
Assert.assertEquals(dgc.getRefreshTimeout(), 5000);
Assert.assertTrue(dgc.getBroadcastEndpointFactory() instanceof JGroupsPropertiesBroadcastEndpointFactory);
JGroupsPropertiesBroadcastEndpointFactory befc = (JGroupsPropertiesBroadcastEndpointFactory) dgc.getBroadcastEndpointFactory();
Assert.assertEquals("myChannel", befc.getChannelName());
Assert.assertEquals("param=1,param2=2", befc.getProperties());
}

推荐阅读
author-avatar
daniel
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有