Package org.glassfish.loadbalancer.admin.cli.reader.api

Examples of org.glassfish.loadbalancer.admin.cli.reader.api.LbReaderException


            if ((port != null) && (port.length() > 1) && (port.charAt(0) == '$')
                    && (port.charAt(1) == '{') && (port.charAt(port.length() - 1) == '}')) {
                String portVar = port.substring(2, port.length() - 1);
                port = resolver.getPropertyValue(portVar);
                if (port == null) {
                    throw new LbReaderException(LbLogUtil.getStringManager().getString("UnableToResolveSystemProperty", portVar, _server.getName()));
                }
            }
            listenerStr.append(port);
        }
        return listenerStr.toString();
View Full Code Here


        if (!address.equals(BIND_TO_ANY)) {
            try {
                addr = InetAddress.getByName(address);
            } catch (UnknownHostException ex) {
                String msg = LbLogUtil.getStringManager().getString("CannotResolveHostName", address);
                throw new LbReaderException(msg, ex);
            }
            if (!addr.isLoopbackAddress()) {
                return address;
            }
        }
        String nodeName = _server.getNodeRef();
        Node node = _domain.getNodes().getNode(nodeName);
        if (node == null) {
            String msg = LbLogUtil.getStringManager().getString("UnableToGetNode", _server.getName());
            throw new LbReaderException(msg);
        }
        if (node.getNodeHost() != null && !node.getNodeHost().equals(LOCALHOST)) {
            return node.getNodeHost();
        }
        return System.getProperty("com.sun.aas.hostName");
View Full Code Here

            return getClustersDataFromLBConfig();
        } else if (_clusters != null) {
            return getClustersData();
        } else {
            String msg = LbLogUtil.getStringManager().getString("NoConfigOrCluster");
            throw new LbReaderException(msg);
        }
    }
View Full Code Here

                isFirstServer = isServer;
            } else {
                //Mix of standalone instances and clusters is not allowed
                if (isFirstServer^isServer) {
                    String msg = LbLogUtil.getStringManager().getString("MixofServerAndClusterNotSupported");
                    throw new LbReaderException(msg);
                }
            }
            if (isServer) {
                Server server = _domain.getServerNamed(name);
                //An instance within cluster is not allowed
                if(server.getCluster() != null){
                    String msg = LbLogUtil.getStringManager().getString("ServerPartofClusterNotSupported", name);
                    throw new LbReaderException(msg);
                }
                cls[i++] = new StandAloneClusterReaderImpl(_domain, _appRegistry, server);
            } else {
                Cluster cluster = _domain.getClusterNamed(name);
                if(cluster == null){
                    String msg = LbLogUtil.getStringManager().getString("ClusterorInstanceNotFound", name);
                    throw new LbReaderException(msg);
                }
                cls[i++] = new ClusterReaderImpl(_domain, _appRegistry, cluster);
            }
        }
        return cls;
View Full Code Here

            } else if (ref instanceof ClusterRef) {
                cls[i++] = new ClusterReaderImpl(_domain, _appRegistry,
                        (ClusterRef) ref);
            } else {
                String msg = LbLogUtil.getStringManager().getString("UnableToDetermineType", ref.getRef());
                throw new LbReaderException(msg);
            }
        }
        return cls;
    }
View Full Code Here

            if ((port != null) && (port.length() > 1) && (port.charAt(0) == '$')
                    && (port.charAt(1) == '{') && (port.charAt(port.length() - 1) == '}')) {
                String portVar = port.substring(2, port.length() - 1);
                port = resolver.getPropertyValue(portVar);
                if (port == null) {
                    throw new LbReaderException(LbLogUtil.getStringManager().getString("UnableToResolveSystemProperty", portVar, _server.getName()));
                }
            }
            listenerStr.append(port);
        }
        return listenerStr.toString();
View Full Code Here

        if (!address.equals(BIND_TO_ANY)) {
            try {
                addr = InetAddress.getByName(address);
            } catch (UnknownHostException ex) {
                String msg = LbLogUtil.getStringManager().getString("CannotResolveHostName", address);
                throw new LbReaderException(msg, ex);
            }
            if (!addr.isLoopbackAddress()) {
                return address;
            }
        }
        String nodeName = _server.getNodeRef();
        Node node = _domain.getNodes().getNode(nodeName);
        if (node == null) {
            String msg = LbLogUtil.getStringManager().getString("UnableToGetNode", _server.getName());
            throw new LbReaderException(msg);
        }
        if (node.getNodeHost() != null && !node.getNodeHost().equals(LOCALHOST)) {
            return node.getNodeHost();
        }
        return System.getProperty("com.sun.aas.hostName");
View Full Code Here

            return getClustersDataFromLBConfig();
        } else if (_clusters != null) {
            return getClustersData();
        } else {
            String msg = LbLogUtil.getStringManager().getString("NoConfigOrCluster");
            throw new LbReaderException(msg);
        }
    }
View Full Code Here

                isFirstServer = isServer;
            } else {
                //Mix of standalone instances and clusters is not allowed
                if (isFirstServer^isServer) {
                    String msg = LbLogUtil.getStringManager().getString("MixofServerAndClusterNotSupported");
                    throw new LbReaderException(msg);
                }
            }
            if (isServer) {
                Server server = _domain.getServerNamed(name);
                //An instance within cluster is not allowed
                if(server.getCluster() != null){
                    String msg = LbLogUtil.getStringManager().getString("ServerPartofClusterNotSupported", name);
                    throw new LbReaderException(msg);
                }
                cls[i++] = new StandAloneClusterReaderImpl(_domain, _appRegistry, server);
            } else {
                Cluster cluster = _domain.getClusterNamed(name);
                if(cluster == null){
                    String msg = LbLogUtil.getStringManager().getString("ClusterorInstanceNotFound", name);
                    throw new LbReaderException(msg);
                }
                cls[i++] = new ClusterReaderImpl(_domain, _appRegistry, cluster);
            }
        }
        return cls;
View Full Code Here

            } else if (ref instanceof ClusterRef) {
                cls[i++] = new ClusterReaderImpl(_domain, _appRegistry,
                        (ClusterRef) ref);
            } else {
                String msg = LbLogUtil.getStringManager().getString("UnableToDetermineType", ref.getRef());
                throw new LbReaderException(msg);
            }
        }
        return cls;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.loadbalancer.admin.cli.reader.api.LbReaderException

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.