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


Java XmlClientConfigBuilder类代码示例

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


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

示例1: lifecycleEvent

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
@Override
public void lifecycleEvent(LifecycleEvent event) {

    if (getConfigLocation() == null) {
        setConfigLocation("hazelcast-client-default.xml");
    }

    if ("start".equals(event.getType())) {

        try {
            XmlClientConfigBuilder builder = new XmlClientConfigBuilder(getConfigLocation());
            config = builder.build();
        } catch (IOException e) {
            throw new RuntimeException("failed to load Config:", e);
        }

        if (config == null) {
            throw new RuntimeException("failed to find configLocation:" + getConfigLocation());
        }
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-tomcat-sessionmanager,代码行数:22,代码来源:ClientServerLifecycleListener.java

示例2: perform

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
/**
 * Wait till master node prepare configuration for sending, then create it's own sender and starts document insertion.
 */
@Override
public void perform(DefaultProperties properties) throws IOException {
	ClientConfig config = new XmlClientConfigBuilder("hazelcast/hazelcast-slave.xml").build();
	String[] masterAddresses = properties.getProperty(ClusterConstants.CLUSTER_MASTER_PROP).split(",");
	config.getNetworkConfig().addAddress(masterAddresses);

	HazelcastInstance client = HazelcastClient.newHazelcastClient(config);
	try {
		init(client, properties);
	} catch (InterruptedException ex) {
		LOGGER.error("Thread interrupted: ", ex);
	} finally {
		client.shutdown();
	}
}
 
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:19,代码来源:SlaveNodeInsertAction.java

示例3: initClient

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
@BeforeClass
public static void initClient() throws Exception {
    ClientConfig cc = new XmlClientConfigBuilder("hazelcast-client.xml").build();
    cc.getNetworkConfig().addAddress(hazelcast.getContainerIpAddress() + ":" + hazelcast.getFirstMappedPort());
    hazelcastClient = HazelcastClient.newHazelcastClient(cc);
    supplements = hazelcastClient.getMap("supplements");
}
 
开发者ID:gAmUssA,项目名称:testcontainers-hazelcast,代码行数:8,代码来源:MongoMapLoaderTest.java

示例4: main

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
public static void main(String... args) throws IOException {
    HazelcastInstance client =
            HazelcastClient.newHazelcastClient(new XmlClientConfigBuilder("src/main/resources/hazelcast-client.xml").build());

    try {
        IMap<String, Language> map = client.getMap("language");

        Stream
                .generate(() -> System.console().readLine("Command> "))
                .filter(Objects::nonNull)
                .forEach(line -> {
                    String[] tokens = line.split("\\s+");
                    String command = tokens[0];

                    switch (command) {
                        case "put":
                            String key = tokens[1];
                            Language language = new Language(tokens[2]);
                            map.put(key, language);
                            System.out.printf("putted %s/%s%n", key, language);
                            break;
                        case "get":
                            System.out.printf("get => %s%n", map.get(tokens[1]));
                            break;
                        default:
                            System.out.printf("Unknown command => %s%n", command);
                            break;
                    }
                });
    } finally {
        client.getLifecycleService().shutdown();
        HazelcastClient.shutdownAll();
    }
}
 
开发者ID:kazuhira-r,项目名称:hazelcast-examples,代码行数:35,代码来源:Client.java

示例5: withConfig

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
public HazelcastClientInstanceFactoryBuilder withConfig(XmlClientConfigBuilder configBuilder) {
    return withConfig(configBuilder.build());
}
 
开发者ID:r2dg,项目名称:smesh,代码行数:4,代码来源:HazelcastClientInstanceFactoryBuilder.java

示例6: initConfig

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
protected void initConfig() {
    if (config == null) {
        this.config = new XmlClientConfigBuilder().build();
    }
}
 
开发者ID:r2dg,项目名称:smesh,代码行数:6,代码来源:HazelcastClientInstanceFactoryBuilder.java

示例7: createHazelcastClient

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
private HazelcastInstance createHazelcastClient() throws IOException {
    File f = new File("hazelcast-client.xml");
    XmlClientConfigBuilder builder = new XmlClientConfigBuilder(f);
    config = builder.build();
    return HazelcastClient.newHazelcastClient(config);
}
 
开发者ID:hazelcast,项目名称:hazelcast-hadoop,代码行数:7,代码来源:HazelcastOutputFormat.java

示例8: getClientConfig

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
public static ClientConfig getClientConfig(Properties properties) {
    return new XmlClientConfigBuilder(getClientConfigStream(properties)).build();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:4,代码来源:XmlJetConfigBuilder.java

示例9: buildClientConfig

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
protected ClientConfig buildClientConfig()
{
    ClientConfig config = new XmlClientConfigBuilder().build();
    config.setManagedContext( new CountingManagedContext() );
    return config;
}
 
开发者ID:noctarius,项目名称:castmapr,代码行数:7,代码来源:AbstractMapReduceTaskTest.java

示例10: newClient

import com.hazelcast.client.config.XmlClientConfigBuilder; //导入依赖的package包/类
public static HazelcastInstance newClient(final String xmlConfiguration) throws IOException {
    return HazelcastClient.newHazelcastClient(
        new XmlClientConfigBuilder(IOs.findConfiguration(xmlConfiguration)).build());
}
 
开发者ID:apache,项目名称:incubator-batchee,代码行数:5,代码来源:HazelcastClientFactory.java


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