Examples of CLBRuntimeException


Examples of org.jvnet.glassfish.comms.clb.core.CLBRuntimeException

        String instanceName = getLocalInstanceName();
        String clusterName = null;
        try{
            clusterName = getLocalClusterName();
        }catch(ConfigException ex){
            throw new CLBRuntimeException("Unable to get cluster name : " +
                    ex, ex);
        }
        String hostName = LoadbalancerUtil.getLocalSocket(SipTransports.TCP_PROT).getHostName();
        return IDGenerator.getId(hostName, clusterName, instanceName);       
    }
View Full Code Here

Examples of org.jvnet.glassfish.comms.clb.core.CLBRuntimeException

        byte[] address = null;

        try {
            address = InetAddress.getByName(hostName).getAddress();
        } catch (UnknownHostException ex) {
            throw new CLBRuntimeException("Unknown host (" + hostName +
                ") specified as host name ", ex);
        }

        long ip;
        long portLong;
        long first;
        long second;
        long third;
        long fourth;

        // Use IP and port
        if (address.length == 4) {
            ip = getValue(address, 0);
            hash = (hash ^ ip) & 0xFFFFFFFFL;
            portLong = (long) (port << 16);
            hash = (hash ^ portLong) & 0xFFFFFFFFL;
        } else if (address.length == 16) {
            ip = getValue(address, 0);
            hash = (hash ^ ip) & 0xFFFFFFFFL;
            ip = getValue(address, 4);
            hash = (hash ^ ip) & 0xFFFFFFFFL;
            ip = getValue(address, 8);
            hash = (hash ^ ip) & 0xFFFFFFFFL;
            ip = getValue(address, 12);
            hash = (hash ^ ip) & 0xFFFFFFFFL;
            portLong = (long) (port << 16);
            hash = (hash ^ portLong) & 0xFFFFFFFFL;
        } else {
            throw new CLBRuntimeException("Unknown address format");
        }

        return hash;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.