Package com.sun.enterprise.admin.servermgmt

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


            cmds.addAll(pidList);
            ProcessBuilder pb = new ProcessBuilder(cmds);
            Process killer = pb.start();
            return killer.waitFor();
        } catch (Exception ex) {
            throw new InstanceException(ex);
        }
    }
View Full Code Here


     * @param args arguments to be passed to the log message
     * @return InstanceException
     */   
    public InstanceException handleInstanceException(Exception ex, String messageId, String[] args)
    {
        InstanceException result = null;
        Level level = Level.FINE;
        if (ex instanceof InstanceException) {                      
            result = (InstanceException)ex;           
        } else if (ex instanceof ConfigException) {           
            result = new InstanceException(ex);
        } else
            level = Level.WARNING;
            result = new InstanceException(ex);
        }
        StringManagerBase sm = StringManagerBase.getStringManager(getLogger().getResourceBundleName());           
        getLogger().log(level, sm.getString(messageId, args), ex);            
        return result;
    }                   
View Full Code Here

        {
            state = ss;
        }
        else
        {
            throw new InstanceException("State transition (" + state.toString()
                + "->" + s.toString() + ") not allowed.");
        }
    }
View Full Code Here

            }
            catch(Exception e)
            {
                String s =_strMgr.getString("CSCMB.starthadberror", new Object[] { clusterName, e});
                getLogger().log(Level.WARNING, s);
                throw new InstanceException(s);
            }
        }
        try
        {
            return getClustersConfigBean().startCluster(clusterName);
View Full Code Here

            }
            catch(Exception e)
            {
                String s =_strMgr.getString("CSCMB.stophadberror", new Object[] { clusterName, e});
                getLogger().log(Level.WARNING, s);
                throw new InstanceException(s);
            }
        }
       
        return ret;
    }
View Full Code Here

            }
            catch(Exception e)
            {
                String s =_strMgr.getString("CSCMB.removehadberror", new Object[] { clusterName, e});
                getLogger().log(Level.WARNING, s);
                throw new InstanceException(s);
            }
        }
    }
View Full Code Here

                ret = false;
            else
            {
                String s =_strMgr.getString("CSCMB.badAutoHadbOverrideArg", autoHadbOverride);
                getLogger().log(Level.WARNING, s);
                throw new InstanceException(s);
            }
        }
        else
        {
            // autoHadbOverride is null or empty -- use persisted value...
View Full Code Here

                // handle this the same as the test for negative integer below...
                timeout = -1
            }

            if(timeout < 0)
                throw new InstanceException(sm.getString("StopInstance.BadTimeout", timeoutString));
           
            try {
                dsh.setstate(serverName, StateManageable.STATE_STOPPING);
                getServersConfigBean().stopServerInstance(serverName, timeout);
            } catch (InstanceException ie) {
View Full Code Here

        ConfigContext ctx = getConfigContext();
        try {
            //validate that the server exists
            final Target target = TargetBuilder.INSTANCE.createTarget(VALID_TYPES, serverName, ctx);
        } catch (Exception e) {
            throw new InstanceException(sm.getString("noSuchInstance", serverName));
        }
        long wTime = 0;
        long dTime = 0;
        try {
            wTime = Long.parseLong(waitTime);
            dTime = Long.parseLong(drainTime);
        } catch (Exception e) {
            throw new InstanceException(e.getMessage());
        }
        RollingUpgradeEvent ruEvent = new RollingUpgradeEvent(serverName, operation, wTime, dTime);
        ruEvent.setTargetDestination(serverName);
        AdminEventResult r = AdminEventMulticaster.multicastEvent(ruEvent);
        if ( r != null && !r.getResultCode().equals(AdminEventResult.SUCCESS)) {
            ArrayList list = (ArrayList) r.getExceptions(serverName);
            Iterator itr = list.iterator();
            String message = "";
            while (itr.hasNext())
                message = message + ((Exception)itr.next()).getMessage() + ". ";
            throw new InstanceException(message);
        }
    }   
View Full Code Here

    public Map<String, List<Long>> getClusterHealth(String targetCluster) throws InstanceException {
        if (targetCluster == null)
            throw new IllegalArgumentException("null_arg");
        try {
            if (!ClusterHelper.isACluster(acc, targetCluster)) {
                throw new InstanceException(sm.getString("noSuchCluster", targetCluster));
            }
        } catch (final Exception e) {
            throw new InstanceException(e);
        }
        Map<String, List<Long>> health = null;
        if (gmsEnabled(targetCluster)) {
            health = getHealthFromGMS(targetCluster);
        }
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.