Package com.hazelcast.core

Examples of com.hazelcast.core.HazelcastException


        }
        if (!this.groupConfig.getName().equals(config.getGroupConfig().getName())) {
            return false;
        }
        if (!this.groupConfig.getPassword().equals(config.getGroupConfig().getPassword())) {
            throw new HazelcastException("Incompatible group password");
        }
        checkMapConfigCompatible(config);
        return true;
    }
View Full Code Here


        for (final String name : mapConfigNames) {
            final MapConfig thisMapConfig = lookupByPattern(mapConfigs, name);
            final MapConfig thatMapConfig = lookupByPattern(config.mapConfigs, name);
            if (thisMapConfig != null && thatMapConfig != null &&
                    !thisMapConfig.isCompatible(thatMapConfig)) {
                throw new HazelcastException(format("Incompatible map config this:\n{0}\nanother:\n{1}",
                        thisMapConfig, thatMapConfig));
            }
        }
    }
View Full Code Here

    }

    public static ResponseHandler createRemoteResponseHandler(NodeEngine nodeEngine, Operation op) {
        if (op.getCallId() == 0) {
            if (op.returnsResponse()) {
                throw new HazelcastException("Op: " + op.getClass().getName() + " can not return response without call-id!");
            }
            return NO_RESPONSE_HANDLER;
        }
        return new RemoteInvocationResponseHandler(nodeEngine, op);
    }
View Full Code Here

                        error = e;
                    } else {
                        String msg = "Port [" + port + "] is already in use and auto-increment is " +
                                "disabled. Hazelcast cannot start.";
                        logger.severe(msg, e);
                        throw new HazelcastException(msg, error);
                    }
                }
            }
            if (serverSocket == null || !serverSocket.isBound()) {
                throw new HazelcastException("ServerSocket bind has failed. Hazelcast cannot start! " +
                        "config-port: " + networkConfig.getPort() + ", latest-port: " + port, error);
            }
            serverSocketChannel.configureBlocking(false);
            bindAddress = createAddress(bindAddressDef, port);
            log(Level.INFO, "Picked " + bindAddress + ", using socket " + serverSocket + ", bind any local is " + bindAny);
View Full Code Here

    Config build(Config config) {
        try {
            parse(config);
        } catch (Exception e) {
            throw new HazelcastException(e);
        }
        config.setConfigurationFile(configurationFile);
        config.setConfigurationUrl(configurationUrl);
        return config;
    }
View Full Code Here

        final ServiceInfo serviceInfo = new ServiceInfo(serviceName, service);
        final ServiceInfo currentServiceInfo = services.putIfAbsent(serviceName, serviceInfo);
        if (currentServiceInfo != null) {
            logger.warning("Replacing " + currentServiceInfo + " with " + serviceInfo);
            if (currentServiceInfo.isCoreService()) {
                throw new HazelcastException("Can not replace a CoreService! Name: " + serviceName
                        + ", Service: " + currentServiceInfo.getService());
            }
            if (currentServiceInfo.isManagedService()) {
                shutdownService((ManagedService) currentServiceInfo.getService(), false);
            }
View Full Code Here

    public boolean isCompatible(ConfigCheck other) {
        if (!groupName.equals(other.groupName)) {
            return false;
        }
        if (!groupPassword.equals(other.groupPassword)) {
            throw new HazelcastException("Incompatible group password!");
        }
        if (!joinerType.equals(other.joinerType)) {
            throw new HazelcastException("Incompatible joiners! " + joinerType + " -vs- " + other.joinerType);
        }
        if (!partitionGroupEnabled && other.partitionGroupEnabled
                || partitionGroupEnabled && !other.partitionGroupEnabled) {
            throw new HazelcastException("Incompatible partition groups! " +
                    "this: " + (partitionGroupEnabled ? "enabled" : "disabled") + " / " + memberGroupType +
                    ", other: " + (other.partitionGroupEnabled ? "enabled" : "disabled") + " / " + other.memberGroupType);
        }
        if (partitionGroupEnabled && memberGroupType != other.memberGroupType) {
            throw new HazelcastException("Incompatible partition groups! this: " + memberGroupType + ", other: " + other.memberGroupType);
        }
        return true;
    }
View Full Code Here

    public void handle(TouchCommand touchCommand) {
        String key = null;
        try {
            key = URLDecoder.decode(touchCommand.getKey(), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new HazelcastException(e);
        }
        String mapName = DefaultMapName;
        int index = key.indexOf(':');
        if (index != -1) {
            mapName = MapNamePreceder + key.substring(0, index);
View Full Code Here

                    } catch (InterruptedException e) {
                        logger.warning(e);
                        node.shutdown(false);
                    }
                } else {
                    throw new HazelcastException("Failed to join in " + (maxJoinMillis / 1000) + " seconds!");
                }
                return;
            }
        }
        if (node.getClusterService().getSize() == 1) {
View Full Code Here

            // one might have overridden getServiceName() method...
            final String name = serviceName != null ? serviceName : getServiceName();
            service = ((NodeEngineImpl) nodeEngine).getService(name);
            if (service == null) {
                if (nodeEngine.isActive()) {
                    throw new HazelcastException("Service with name '" + name + "' not found!");
                } else {
                    throw new RetryableHazelcastException("HazelcastInstance[" + nodeEngine.getThisAddress()
                        + "] is not active!");
                }
            }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.HazelcastException

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.