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


Java ConnectionFactoryParser类代码示例

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


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

示例1: setBrokerURL

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
private void setBrokerURL(String brokerURL) {
   ConnectionFactoryParser cfParser = new ConnectionFactoryParser();
   try {
      URI uri = cfParser.expandURI(brokerURL);
      serverLocator = ServerLocatorImpl.newLocator(uri);
      cfParser.populateObject(uri, this);
   } catch (Exception e) {
      throw new RuntimeException(e.getMessage(), e);
   }

   if (getUser() == null) {
      setUser(DefaultConnectionProperties.DEFAULT_USER);
   }

   if (getPassword() == null) {
      setPassword(DefaultConnectionProperties.DEFAULT_PASSWORD);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:ActiveMQConnectionFactory.java

示例2: toURI

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
public URI toURI() throws IOException {
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   String scheme;
   if (serverLocator.getDiscoveryGroupConfiguration() != null) {
      if (serverLocator.getDiscoveryGroupConfiguration().getBroadcastEndpointFactory() instanceof UDPBroadcastEndpointFactory) {
         scheme = "udp";
      } else {
         scheme = "jgroups";
      }
   } else {
      if (serverLocator.allInVM()) {
         scheme = "vm";
      } else {
         scheme = "tcp";
      }
   }

   URI uri;

   try {
      uri = parser.createSchema(scheme, this);
   } catch (Exception e) {
      if (e instanceof IOException) {
         throw (IOException) e;
      }
      throw new IOException(e);
   }
   return uri;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:30,代码来源:ActiveMQConnectionFactory.java

示例3: readExternal

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   String url = in.readUTF();
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   ServerLocatorParser locatorParser = new ServerLocatorParser();
   try {
      URI uri = new URI(url);
      serverLocator = locatorParser.newObject(uri, null);
      parser.populateObject(uri, this);
   } catch (Exception e) {
      InvalidObjectException ex = new InvalidObjectException(e.getMessage());
      ex.initCause(e);
      throw ex;
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:16,代码来源:ActiveMQConnectionFactory.java

示例4: defaultConnectionFactory

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
@Bean
public ConnectionFactory defaultConnectionFactory() throws Exception {
  ConnectionFactoryParser parser = new ConnectionFactoryParser();
  return parser.newObject(parser.expandURI(artemisProperties.getUri()), "defaultConnectionFactory");
}
 
开发者ID:bighector,项目名称:-artemis-disruptor-miaosha,代码行数:6,代码来源:ArtemisJmsConfiguration.java

示例5: createConnectionFactory

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
/**
 * Factory method to create a new connection factory from the given environment
 */
protected ConnectionFactory createConnectionFactory(String uri, String name) throws Exception {
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   return parser.newObject(parser.expandURI(uri), name);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:TestContextFactory.java

示例6: getFactoryType

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
public JMSFactoryType getFactoryType(String uri) throws Exception {
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   Map<String, String> queryParams = URISchema.parseQuery(parser.expandURI(uri).getQuery(), null);
   String type = queryParams.get("type");
   return type == null ? null : JMSConnectionOptions.convertCFType(type);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:7,代码来源:ActiveMQInitialContextFactory.java

示例7: createConnectionFactory

import org.apache.activemq.artemis.uri.ConnectionFactoryParser; //导入依赖的package包/类
/**
 * Creates an ActiveMQConnectionFactory;
 *
 * @return the ActiveMQConnectionFactory
 */
public static ActiveMQConnectionFactory createConnectionFactory(final String url, String name) throws Exception {
   ConnectionFactoryParser parser = new ConnectionFactoryParser();
   return parser.newObject(parser.expandURI(url), name);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:10,代码来源:ActiveMQJMSClient.java


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