當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。