Package com.hazelcast.config

Examples of com.hazelcast.config.XmlConfigBuilder


     * Builds a Hazelcast {@link Config}
     *
     * @return
     */
    public Config buildConfig() {
        Config config = new XmlConfigBuilder().build();
        config.setGroupConfig(buildGroupConfig());
        config.getNetworkConfig().getJoin().setMulticastConfig(buildMulticastConfig());
        config.getNetworkConfig().getJoin().setTcpIpConfig(buildTcpIpConfig());
        return config;
    }
View Full Code Here


//        Assert.assertEquals("bla1", h6map.get("key1"));

    }

    private HazelcastInstance create(String multicast, int listenPort, int... connectPorts) throws UnknownHostException {
        Config config = new XmlConfigBuilder().build();
        config.setPort(listenPort);
        config.setPortAutoIncrement(false);

        // declare the interface Hazelcast should bind to
        config.getNetworkConfig().getInterfaces().clear();
View Full Code Here

        Config config;
        this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
        String configFile = properties.getProperty("hazelcastConfig");
        if (configFile != null) {
            try {
                config = new XmlConfigBuilder(configFile).build();
            } catch (FileNotFoundException e) {
                throw new IllegalArgumentException(configFile, e);
            }
        } else {
            // TUSCANY-3675 - domainRegistryURI properties don't seem to be copied into the
            //                properties collection anywhere
            config = new XmlConfigBuilder().build();
            RegistryConfig rc = RegistryConfig.parseConfigURI(domainRegistryURI);
            config.setPort(rc.getBindPort());
            //config.setPortAutoIncrement(false);

            if (!rc.getBindAddress().equals("*")) {
View Full Code Here

    public static HazelcastInstance newMember(final String name, final String prefix) {
        final HazelcastInstance hazelcastInstanceByName = Hazelcast.getHazelcastInstanceByName(name);
        if (hazelcastInstanceByName != null) {
            return hazelcastInstanceByName;
        }
        return Hazelcast.newHazelcastInstance(new XmlConfigBuilder().build().setInstanceName(name));
    }
View Full Code Here

    @Override
    public void doStart() throws Exception {
        super.doStart();
        if (hazelcastInstance == null) {
            createOwnInstance = true;
            Config config = new XmlConfigBuilder().build();
            // Disable the version check
            config.getProperties().setProperty("hazelcast.version.check.enabled", "false");
            hazelcastInstance = Hazelcast.newHazelcastInstance(config);
        }
    }
View Full Code Here

        Config config;
        this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
        String configFile = properties.getProperty("hazelcastConfig");
        if (configFile != null) {
            try {
                config = new XmlConfigBuilder(configFile).build();
            } catch (FileNotFoundException e) {
                throw new IllegalArgumentException(configFile, e);
            }
        } else {
            // TUSCANY-3675 - domainRegistryURI properties don't seem to be copied into the
            //                properties collection anywhere
            config = new XmlConfigBuilder().build();
            RegistryConfig rc = RegistryConfig.parseConfigURI(domainRegistryURI);
            config.setPort(rc.getBindPort());
            //config.setPortAutoIncrement(false);

            if (!rc.getBindAddress().equals("*")) {
View Full Code Here

    @Override
    public void doStart() throws Exception {
        super.doStart();
        if (hazelcastInstance == null) {
            createOwnInstance = true;
            Config config = new XmlConfigBuilder().build();
            // Disable the version check
            config.getProperties().setProperty("hazelcast.version.check.enabled", "false");
            hazelcastInstance = Hazelcast.newHazelcastInstance(config);
        }
    }
View Full Code Here

        if (recoveryInterval < 0) {
            throw new IllegalArgumentException("Recovery interval must be zero or a positive integer.");
        }
        ObjectHelper.notEmpty(mapName, "repositoryName");
        if (useLocalHzInstance)  {
            Config cfg = new XmlConfigBuilder().build();
            cfg.setProperty("hazelcast.version.check.enabled", "false");
            hzInstance = Hazelcast.newHazelcastInstance(cfg);
        } else {
            ObjectHelper.notNull(hzInstance, "hzInstanse");
        }
View Full Code Here

    public void setHazelcastInstance(HazelcastInstance hazelcastInstance) {
        this.hazelcastInstance = hazelcastInstance;
    }

    private HazelcastInstance createOwnInstance() {
        Config config = new XmlConfigBuilder().build();
        // Disable the version check
        config.getProperties().setProperty("hazelcast.version.check.enabled", "false");
        return Hazelcast.newHazelcastInstance(config);
    }
View Full Code Here

   @Override
   public void start() {
      log.info("Creating cache with the following configuration: " + config);
      InputStream configStream = getAsInputStreamFromClassLoader(config);
      Config cfg = new XmlConfigBuilder(configStream).build();
      hazelcastInstance = Hazelcast.newHazelcastInstance(cfg);
      log.info("Hazelcast configuration:" + hazelcastInstance.getConfig().toString());
   }
View Full Code Here

TOP

Related Classes of com.hazelcast.config.XmlConfigBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.