Package com.sun.enterprise.admin.servermgmt

Examples of com.sun.enterprise.admin.servermgmt.InstanceException


        try {
            final Cluster cluster = ClusterHelper.getClusterByName(acc, cn);
            final boolean gms = cluster.isHeartbeatEnabled();
            return ( gms );
        } catch(final Exception e) {
            throw new InstanceException(e);
        }
    }
View Full Code Here


            final Object[] p                    = new String[]{cluster};
            final String[] s                    = new String[]{"java.lang.String"};
            health                              = (Map<String, List<Long>>) mbsc.invoke(on, m, p, s);
            return ( health );
        } catch(final Exception e) {
            throw new InstanceException(e);
        }
    }
View Full Code Here

        try {
            final RuntimeStatusList list = invokeClusterMBeanForStatus(cluster);
            final Map<String, List<Long>> map = statusList2Map(list);
            return ( map );
        } catch(final Exception e) {
            throw new InstanceException(e);
        }
    }
View Full Code Here

        RuntimeStatusList beforeStatus = getRuntimeStatus(clusterName);
        String[] servers = null;
        try {
            servers = getServersInCluster(clusterName);
        } catch (ConfigException ce) {
            throw new InstanceException(_strMgr.getString("configException", clusterName));
        }
        List<String> members = Arrays.asList(servers);
        if (beforeStatus.isEmpty()) {
            //no instances
            throw new InstanceException(_strMgr.getString("clusterIsEmpty",
                clusterName));
        } else if (beforeStatus.allRunning()) {
            //already started
            for (Object rso : beforeStatus)
            {
                RuntimeStatus rs = (RuntimeStatus)rso;
                rs.resetRecentErrorMessages();
            }
            return  beforeStatus;
        } else {
            ArrayList msgsList = new ArrayList();
            RuntimeStatusList afterStatus = null;
            try {
                announceClusterStartState(clusterName, INITIATED, members);
                doStartCluster(clusterName, servers, msgsList);
                afterStatus = getRuntimeStatus(clusterName);
            } finally {
                if (afterStatus != null && afterStatus.allRunning()) {
                    announceClusterStartState(clusterName, COMPLETED_SUCCESS, members);
                    for (int i = 0; i < afterStatus.size(); i++) {
                        // this will get us a special error message from RuntimeStatus.toString()
                        afterStatus.getStatus(i).setStartClusterFlag(beforeStatus.getStatus(i));
                    }
                } else {
                    announceClusterStartState(clusterName, COMPLETED_FAILED, getFailedMembers(afterStatus));
                    boolean bAny = afterStatus != null ? afterStatus.anyRunning() : false;
                    String msg = _strMgr.getString(bAny ? "clusterNotFullyStarted" : "clusterNotStarted", clusterName);
                    for (int i = 0; i < msgsList.size(); i++) {
                    msg = msg + "\n" + msgsList.get(i);
                }
                    if (bAny) {
                    throw new WarningException(msg);
                    } else {
                    throw new InstanceException(msg);
            }
            }
            }
            return afterStatus;
        }
View Full Code Here

        throws InstanceException
    {
        RuntimeStatusList beforeStatus = getRuntimeStatus(clusterName);
        if (beforeStatus.isEmpty()) {
            //no instances
            throw new InstanceException(_strMgr.getString("clusterIsEmpty",
                clusterName));
        }

        doStopCluster(clusterName);
       
        RuntimeStatusList afterStatus = getRuntimeStatus(clusterName);
        if (afterStatus.anyRunning()) {
            throw new InstanceException(_strMgr.getString("clusterNotFullyStopped",
                clusterName));
        }

        for(int i = 0; i < afterStatus.size(); i++) {
            // this will get us a special error message from RuntimeStatus.toString()
View Full Code Here

           
            //Ensure that the cluster contains no server instances
            Server[] servers = ServerHelper.getServersInCluster(configContext,
                clusterName);
            if (servers.length > 0) {
                throw new InstanceException(_strMgr.getString("clusterNotEmpty",
                    clusterName, ServerHelper.getServersAsString(servers)));
            }                                              
           
            //Remove the the cluster. This is the last thing we want to do.
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);
View Full Code Here

    {
        try {                      
            final ConfigContext configContext = getConfigContext();
            //validate name uniqueness
            if (!ConfigAPIHelper.isNameUnique(configContext, clusterName)) {
                 throw new InstanceException(_strMgr.getString("clusterNameNotUnique",
                    clusterName));
            }
                          
            //Ensure that cluster specified by clusterName does not already exist.
            //Given that we've already checked for uniqueness earlier, this should never
            //be the case, but we'll be extra safe here.
            Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            Clusters clusters = domain.getClusters();
            Cluster cluster = clusters.getClusterByName(clusterName);
            if (cluster != null) {
                throw new InstanceException(_strMgr.getString("clusterAlreadyExists",
                    clusterName));
            }
   
            //Create the new cluster instance
            cluster = new Cluster();           
View Full Code Here

    {
        try {
            String dasName = ServerHelper.getDAS(configContext).getName();
            return getInstanceConnection(dasName);
        } catch (ConfigException ex) {
            throw new InstanceException(ex);
        }
    } 
View Full Code Here

        throws InstanceException
    {
        try {
            getInstanceRegistry().removeConnectorFromCache(instanceName);
        } catch (IOException ex) {
            throw new InstanceException(ex);
        }
    }
View Full Code Here

        throws InstanceException
    {
        try {
            getInstanceRegistry().disconnectCachedConnector(instanceName);
        } catch (IOException ex) {
            throw new InstanceException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.servermgmt.InstanceException

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.