Package com.hazelcast.config

Examples of com.hazelcast.config.XmlConfigBuilder


        }
    }

    public static HazelcastInstance newHazelcastInstance(Config config) {
        if (config == null) {
            config = new XmlConfigBuilder().build();
        }

        return newHazelcastInstance(config, config.getInstanceName(), new DefaultNodeContext());
    }
View Full Code Here


    }

    public static HazelcastInstance newHazelcastInstance(Config config, String instanceName,
                                                              NodeContext nodeContext) {
        if (config == null) {
            config = new XmlConfigBuilder().build();
        }

        String name = instanceName;
        if (name == null || name.trim().length() == 0) {
            name = createInstanceName(config);
View Full Code Here

      catch (final FileNotFoundException e) {
        throw new IllegalArgumentException(e.getMessage());
      }
    }
    else {
      config = new XmlConfigBuilder().build();
    }

    config.getSemaphoreConfig("default").setInitialPermits(Integer.MAX_VALUE);
    config.setClassLoader(Hazelcast.class.getClassLoader());
View Full Code Here

     *
     * @return
     */
    public Config getHazelcastConfig() {
        System.setProperty("hazelcast.config", xmlConfigLocation);
        Config config = new XmlConfigBuilder().build();
        if (discoveredMemberSet != null) {
            TcpIpConfig tcpIpConfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
            tcpIpConfig.getMembers().addAll(discoveredMemberSet);
        }
        return 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 {
            config = new XmlConfigBuilder().build();
            RegistryConfig rc = new RegistryConfig(properties);
            config.setPort(rc.getBindPort());
            //config.setPortAutoIncrement(false);

            if (!rc.getBindAddress().equals("*")) {
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

     * @return the created hazelcast configuration
     * @throws ResourceAdapterInternalException If there was a problem with the configuration creation
     */
    private ConfigBuilder buildConfiguration()
            throws ResourceAdapterInternalException {
        XmlConfigBuilder config;
        if (configurationLocation == null || configurationLocation.length() == 0) {
            config = new XmlConfigBuilder();
        } else {
            try {
                config = new XmlConfigBuilder(configurationLocation);
            } catch (FileNotFoundException e) {
                throw new ResourceAdapterInternalException(e.getMessage(), e);
            }
        }
        return config;
View Full Code Here

        return instance;
    }

    private void createOrGetInstance() throws DuplicateInstanceNameException {
        if (config == null) {
            config = new XmlConfigBuilder().build();
        }
        config.setInstanceName(instanceName);
        instance = Hazelcast.newHazelcastInstance(config);
    }
View Full Code Here

            this.entryCount = entryCount;
            this.threadCount = threadCount;
            this.valueSize = valueSize;
            this.nodeId = nodeId;
            es = Executors.newFixedThreadPool(threadCount);
            Config cfg = new XmlConfigBuilder().build();
            hazelcast = Hazelcast.newHazelcastInstance(cfg);
            esStats = Executors.newSingleThreadExecutor();
            createTime = System.currentTimeMillis();
        }
View Full Code Here

        this.entryCount = entryCount;
        this.valueSize = valueSize;
        this.getPercentage = getPercentage;
        this.putPercentage = putPercentage;
        this.load = load;
        Config cfg = new XmlConfigBuilder().build();

        instance = Hazelcast.newHazelcastInstance(cfg);
//        Hazelcast.newHazelcastInstance(cfg);

        logger = instance.getLoggingService().getLogger("SimpleCacheTest");
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.