本文整理汇总了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);
}