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


Java ConfiguratorFactory类代码示例

本文整理汇总了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;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:24,代码来源:FORK.java

示例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();
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:JGroupsUtils.java

示例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);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:8,代码来源:PubSub.java

示例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);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:11,代码来源:SUPERVISOR.java

示例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);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:15,代码来源:RELAY2.java

示例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());
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:10,代码来源:Discovery.java

示例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);
        }
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:17,代码来源:JChannel.java

示例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;
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:11,代码来源:SharedTransportTest.java

示例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;
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:6,代码来源:JGroupsUtils.java


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