Package com.hazelcast.config

Examples of com.hazelcast.config.NetworkConfig


    }

    private Collection<Address> getPossibleAddresses() {
        final Collection<String> possibleMembers = getMembers();
        final Set<Address> possibleAddresses = new HashSet<Address>();
        final NetworkConfig networkConfig = config.getNetworkConfig();
        for (String possibleMember : possibleMembers) {
            AddressHolder addressHolder = AddressUtil.getAddressHolder(possibleMember);
            try {
                boolean portIsDefined = addressHolder.getPort() != -1 || !networkConfig.isPortAutoIncrement();
                int count = portIsDefined ? 1 : MAX_PORT_TRIES;
                int port = addressHolder.getPort() != -1 ? addressHolder.getPort() : networkConfig.getPort();
                AddressMatcher addressMatcher = null;
                try {
                    addressMatcher = AddressUtil.getAddressMatcher(addressHolder.getAddress());
                } catch (InvalidAddressException ignore) {
                }
                if (addressMatcher != null) {
                    final Collection<String> matchedAddresses;
                    if (addressMatcher.isIPv4()) {
                        matchedAddresses = AddressUtil.getMatchingIpv4Addresses(addressMatcher);
                    } else {
                        // for IPv6 we are not doing wildcard matching
                        matchedAddresses = Collections.singleton(addressHolder.getAddress());
                    }
                    for (String matchedAddress : matchedAddresses) {
                        addPossibleAddresses(possibleAddresses, null, InetAddress.getByName(matchedAddress), port, count);
                    }
                } else {
                    final String host = addressHolder.getAddress();
                    final InterfacesConfig interfaces = networkConfig.getInterfaces();
                    if (interfaces.isEnabled()) {
                        final InetAddress[] inetAddresses = InetAddress.getAllByName(host);
                        if (inetAddresses.length > 1) {
                            for (InetAddress inetAddress : inetAddresses) {
                                if (AddressUtil.matchAnyInterface(inetAddress.getHostAddress(),
View Full Code Here


      mapcfg.setMaxSizeConfig(new MaxSizeConfig().setSize(25).setMaxSizePolicy(USED_HEAP_PERCENTAGE));
      cfg.addMapConfig(mapcfg);
      cfg.setProperty("hazelcast.jmx", "true");
      cfg.setProperty("hazelcast.logging.type", "slf4j");
      if (Config.IN_PRODUCTION) {
        cfg.setNetworkConfig(new NetworkConfig().setJoin(new JoinConfig().
          setMulticastConfig(new MulticastConfig().setEnabled(false)).
            setTcpIpConfig(new TcpIpConfig().setEnabled(false)).
            setAwsConfig(new AwsConfig().setEnabled(true).
              setAccessKey(Config.AWS_ACCESSKEY).
              setSecretKey(Config.AWS_SECRETKEY).
View Full Code Here

      mapcfg.setMaxSizeConfig(new MaxSizeConfig().setSize(25).setMaxSizePolicy(USED_HEAP_PERCENTAGE));
      cfg.addMapConfig(mapcfg);
      cfg.setProperty("hazelcast.jmx", "true");
      cfg.setProperty("hazelcast.logging.type", "slf4j");
      if (Config.IN_PRODUCTION) {
        cfg.setNetworkConfig(new NetworkConfig().setJoin(new JoinConfig().
          setMulticastConfig(new MulticastConfig().setEnabled(false)).
            setTcpIpConfig(new TcpIpConfig().setEnabled(false)).
            setAwsConfig(new AwsConfig().setEnabled(true).
              setAccessKey(Config.AWS_ACCESSKEY).
              setSecretKey(Config.AWS_SECRETKEY).
View Full Code Here

TOP

Related Classes of com.hazelcast.config.NetworkConfig

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.