• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FileSystemXmlConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.hazelcast.config.FileSystemXmlConfig的典型用法代码示例。如果您正苦于以下问题:Java FileSystemXmlConfig类的具体用法?Java FileSystemXmlConfig怎么用?Java FileSystemXmlConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileSystemXmlConfig类属于com.hazelcast.config包,在下文中一共展示了FileSystemXmlConfig类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ensureInstanceIsUp

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
protected void ensureInstanceIsUp() throws Exception {
    if (isInstanceNotActive(hz)) {
        hz = Hazelcast.newHazelcastInstance(
                new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    }
    if (serverXml1 != null) {
        if (server1 == null) {
            serverPort1 = availablePort();
            server1 = getServletContainer(serverPort1, sourceDir, serverXml1);
        } else if (!server1.isRunning()) {
            server1.start();
        }
    }
    if (serverXml2 != null) {
        if (server2 == null) {
            serverPort2 = availablePort();
            server2 = getServletContainer(serverPort2, sourceDir, serverXml2);
        } else if (!server2.isRunning()) {
            server2.start();
        }
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:23,代码来源:AbstractWebFilterTest.java


示例2: whenClusterIsDown_enabledDeferredWrite

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Test
public void whenClusterIsDown_enabledDeferredWrite() throws Exception {
    CookieStore cookieStore = new BasicCookieStore();
    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
    hz.shutdown();

    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
    assertEquals("true", executeRequest("remove", serverPort1, cookieStore));
    assertEquals("null", executeRequest("read", serverPort1, cookieStore));

    hz = Hazelcast.newHazelcastInstance(
            new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    assertClusterSizeEventually(1, hz);

    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:19,代码来源:WebFilterClientFailOverTests.java


示例3: whenClusterIsDownAtBeginning_enabledDeferredWrite

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Test
public void whenClusterIsDownAtBeginning_enabledDeferredWrite() throws Exception {
    hz.shutdown();

    CookieStore cookieStore = new BasicCookieStore();
    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));

    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
    assertEquals("true", executeRequest("remove", serverPort1, cookieStore));
    assertEquals("null", executeRequest("read", serverPort1, cookieStore));

    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));

    hz = Hazelcast.newHazelcastInstance(
            new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    assertClusterSizeEventually(1, hz);

    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
    assertEquals("true", executeRequest("remove", serverPort1, cookieStore));
    assertEquals("null", executeRequest("read", serverPort1, cookieStore));

}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:25,代码来源:WebFilterClientFailOverTests.java


示例4: testWhenClusterIsDownAtBeginningInNonDeferredMode

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Test
public void testWhenClusterIsDownAtBeginningInNonDeferredMode() throws Exception {
    if (!testName.equals("client - not deferred")) {
        return;
    }

    hz.shutdown();
    CookieStore cookieStore = new BasicCookieStore();
    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));

    hz = Hazelcast.newHazelcastInstance(
            new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    assertClusterSizeEventually(1, hz);

    assertEquals("value", executeRequest("read", serverPort1, cookieStore));
    IMap<String, Object> map = hz.getMap(DEFAULT_MAP_NAME);
    assertEquals(1, map.size());
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:20,代码来源:WebFilterClientFailOverTests.java


示例5: testWhenClusterIsDownAtBeginningInDeferedMode

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Test
public void testWhenClusterIsDownAtBeginningInDeferedMode() throws Exception {
    if (!testName.equals("client - not deferred")) {
        return;
    }

    hz.shutdown();
    CookieStore cookieStore = new BasicCookieStore();
    assertEquals("true", executeRequest("write", serverPort1, cookieStore));
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));

    hz = Hazelcast.newHazelcastInstance(
            new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    assertClusterSizeEventually(1, hz);
    assertEquals("value", executeRequest("read", serverPort1, cookieStore));

    IMap<String, Object> map = hz.getMap(DEFAULT_MAP_NAME);
    assertEquals(0, map.size());
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:20,代码来源:WebFilterClientFailOverTests.java


示例6: ensureInstanceIsUp

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Override
protected void ensureInstanceIsUp() throws Exception {
    if (isInstanceNotActive(hz)) {
        hz = Hazelcast.newHazelcastInstance(
                new FileSystemXmlConfig(new File(sourceDir + "/WEB-INF/", "hazelcast.xml")));
    }
    if (serverXml1 != null) {
        if (server1 == null) {
            serverPort1 = availablePort();
            server1 = getServletContainer(serverPort1, sourceDir, serverXml1);
        } else if (!server1.isRunning()) {
            server1.start();
        }
    }
    if (serverXml2 != null) {
        if (server2 == null) {
            serverPort2 = availablePort();
            server2 = getServletContainer(serverPort2, sourceDir, serverXml2);
        } else if (!server2.isRunning()) {
            server2.start();
        }
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:24,代码来源:DeferredWriteClusterTest.java


示例7: start

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
public void start() {
    try {
        logger.info("HazelcastServer starting");
        File configurationFile = new File(CONFIGURATION_DIRECTORY, CONFIGURATION_FILENAME);
        if (!configurationFile.exists()) {
            try (FileOutputStream fos = new FileOutputStream(configurationFile)) {
                fos.write(HybridbpmCoreUtil.getDefaultHazelcastConfig().getBytes());
            }
        }
        configurationFile = new File(CONFIGURATION_DIRECTORY, CONFIGURATION_FILENAME);
        hazelcastInstance = Hazelcast.newHazelcastInstance(new FileSystemXmlConfig(configurationFile));
        logger.info("HazelcastServer started");
    } catch (Exception ex) {
        logger.log(Level.SEVERE, ex.getMessage(), ex);
    }
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:17,代码来源:HazelcastServer.java


示例8: activate

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
@Activate
public void activate() {
    try {
        File hazelcastFile = new File(HAZELCAST_XML_FILE);
        if (!hazelcastFile.exists()) {
            createDefaultHazelcastFile(hazelcastFile);
        }

        Config config = new FileSystemXmlConfig(HAZELCAST_XML_FILE);

        instance = Hazelcast.newHazelcastInstance(config);
        log.info("Started");
    } catch (FileNotFoundException e) {
        log.error("Unable to configure Hazelcast", e);
    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:17,代码来源:StoreManager.java


示例9: configureHazelcast

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
private void configureHazelcast(final Properties properties) {
    if (null == hazelcast || !Hazelcast.getAllHazelcastInstances().contains(hazelcast)) {
        String configFile = properties.getProperty(CACHE_CONFIG_FILE);
        if (null == configFile) {
            LOGGER.warn("Config file not set using system property: " + CACHE_CONFIG_FILE
                    + ". Using default settings");

            hazelcast = Hazelcast.newHazelcastInstance();
        } else {
            try {
                final Config config = new FileSystemXmlConfig(configFile);
                hazelcast = Hazelcast.newHazelcastInstance(config);
            } catch (final Exception e) {
                throw new IllegalArgumentException("Could not create cache using config path: " + configFile, e);
            }
        }
    }
}
 
开发者ID:gchq,项目名称:Gaffer,代码行数:19,代码来源:HazelcastCacheService.java


示例10: configureCluster

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
private void configureCluster(IConfig config) throws FileNotFoundException {
    LOG.info("Configuring embedded Hazelcast instance");
    String interceptHandlerClassname = config.getProperty(BrokerConstants.INTERCEPT_HANDLER_PROPERTY_NAME);
    if (interceptHandlerClassname == null || !HZ_INTERCEPT_HANDLER.equals(interceptHandlerClassname)) {
        LOG.info("There are no Hazelcast intercept handlers. The server won't start a Hazelcast instance.");
        return;
    }
    String hzConfigPath = config.getProperty(BrokerConstants.HAZELCAST_CONFIGURATION);
    if (hzConfigPath != null) {
        boolean isHzConfigOnClasspath = this.getClass().getClassLoader().getResource(hzConfigPath) != null;
        Config hzconfig = isHzConfigOnClasspath
                ? new ClasspathXmlConfig(hzConfigPath)
                : new FileSystemXmlConfig(hzConfigPath);
        LOG.info("Starting Hazelcast instance. ConfigurationFile={}", hzconfig);
        hazelcastInstance = Hazelcast.newHazelcastInstance(hzconfig);
    } else {
        LOG.info("Starting Hazelcast instance with default configuration");
        hazelcastInstance = Hazelcast.newHazelcastInstance();
    }
    listenOnHazelCastMsg();
}
 
开发者ID:andsel,项目名称:moquette,代码行数:22,代码来源:Server.java


示例11: HazelcastInstanceProxy

import com.hazelcast.config.FileSystemXmlConfig; //导入依赖的package包/类
/**
  * 
  * @param configFile
  * @param entityBasePkg
  * @throws FileNotFoundException
  */
public HazelcastInstanceProxy(File configFile, String entityBasePkg) throws FileNotFoundException
{
  this(new FileSystemXmlConfig(configFile), entityBasePkg);
}
 
开发者ID:javanotes,项目名称:reactive-data,代码行数:11,代码来源:HazelcastInstanceProxy.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DirectMemoryUtils类代码示例发布时间:2022-05-22
下一篇:
Java CompletedExecutionInstruction类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap