本文整理汇总了Java中org.jgroups.conf.ConfiguratorFactory类的典型用法代码示例。如果您正苦于以下问题:Java ConfiguratorFactory类的具体用法?Java ConfiguratorFactory怎么用?Java ConfiguratorFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfiguratorFactory类属于org.jgroups.conf包,在下文中一共展示了ConfiguratorFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getForkStream
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
public static InputStream getForkStream(String config) throws IOException {
InputStream configStream = null;
try {
configStream=new FileInputStream(config);
}
catch(FileNotFoundException | AccessControlException fnfe) { // catching ACE fixes http://jira.jboss.com/jira/browse/JGRP-94
}
// Check to see if the properties string is a URL.
if(configStream == null) {
try {
configStream=new URL(config).openStream();
}
catch (MalformedURLException mre) {
}
}
// Check to see if the properties string is the name of a resource, e.g. udp.xml.
if(configStream == null)
configStream=Util.getResourceAsStream(config, ConfiguratorFactory.class);
return configStream;
}
示例2: getConfigurationString
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
public static String getConfigurationString(String properties) throws Exception {
ProtocolStackConfigurator configurator = ConfiguratorFactory.getStackConfigurator(properties);
StringBuffer ret = new StringBuffer();
for(ProtocolConfiguration config: configurator.getProtocolStack()) {
substituteVariables(config);
if (ret.length() > 0) ret.append(":");
ret.append(config.getProtocolString());
}
return ret.toString();
}
示例3: createSharedChannel
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
private static JChannel createSharedChannel(String singleton_name, String props) throws Exception {
ProtocolStackConfigurator config=ConfiguratorFactory.getStackConfigurator(props);
List<ProtocolConfiguration> protocols=config.getProtocolStack();
ProtocolConfiguration transport=protocols.get(0);
transport.getProperties().put(Global.SINGLETON_NAME, singleton_name);
return new JChannel(config);
}
示例4: parseConfig
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
protected void parseConfig(String filename) throws Exception {
InputStream input=null;
try {
input=ConfiguratorFactory.getConfigStream(filename);
parseRules(input);
}
finally {
Util.close(input);
}
}
示例5: parseSiteConfiguration
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
/**
* Parses the configuration by reading the config file.
* @throws Exception
*/
protected void parseSiteConfiguration(final Map<String,RelayConfig.SiteConfig> map) throws Exception {
InputStream input=null;
try {
input=ConfiguratorFactory.getConfigStream(config);
RelayConfig.parse(input, map);
}
finally {
Util.close(input);
}
}
示例6: addToCache
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
@ManagedOperation(description="Reads logical-physical address mappings and logical name mappings from a " +
"file (or URL) and adds them to the local caches")
public void addToCache(String filename) throws Exception {
InputStream in=ConfiguratorFactory.getConfigStream(filename);
List<PingData> list=read(in);
if(list != null)
for(PingData data: list)
addDiscoveryResponseToCaches(data.getAddress(), data.getLogicalName(), data.getPhysicalAddr());
}
示例7: JChannel
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
/**
* Creates a JChannel without a protocol stack; used for programmatic creation of channel and protocol stack
* @param create_protocol_stack If true, the default configuration will be used. If false, no protocol stack
* will be created
* @param create_protocol_stack Creates the default stack if true, or no stack if false
*/
public JChannel(boolean create_protocol_stack) {
if(create_protocol_stack) {
try {
init(ConfiguratorFactory.getStackConfigurator(DEFAULT_PROTOCOL_STACK));
}
catch(Exception e) {
throw new RuntimeException(e);
}
}
}
示例8: createSharedChannel
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
private JChannel createSharedChannel(String singleton_name, String name) throws Exception {
ProtocolStackConfigurator config=ConfiguratorFactory.getStackConfigurator(channel_conf);
List<ProtocolConfiguration> protocols=config.getProtocolStack();
ProtocolConfiguration transport=protocols.get(0);
transport.getProperties().put(Global.SINGLETON_NAME, singleton_name);
JChannel ch=new JChannel(config);
if(name != null)
ch.setName(name);
return ch;
}
示例9: getConfigurator
import org.jgroups.conf.ConfiguratorFactory; //导入依赖的package包/类
public static ProtocolStackConfigurator getConfigurator(String properties) throws Exception {
ProtocolStackConfigurator configurator = ConfiguratorFactory.getStackConfigurator(properties);
JGroupsUtils.substituteVariables(configurator);
return configurator;
}