本文整理匯總了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);
}
}
示例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;
}
示例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;
}
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}