Package com.sun.enterprise.cli.framework

Examples of com.sun.enterprise.cli.framework.CommandException


        CLILogger.getInstance().printMessage(mgr.list());
      }
      else
      {
        // IMPOSSIBLE!!!
        throw new CommandException("Internal Error");
      }
    }
    catch(BackupWarningException bwe)
    {
      CLILogger.getInstance().printMessage(bwe.getMessage());
    }
    catch(BackupException be)
    {
      throw new CommandException(be);
    }
  }
View Full Code Here


    {
        File file = new File(filePath);
        String absolutePath = file.getAbsolutePath();
        if ((!file.exists()) || (file.isDirectory()))
        {
            throw new CommandException(getLocalizedString(errorKey,
                                                    new Object[]{filePath}));
        }
        return absolutePath;
    }
View Full Code Here

        }

        // Make sure we have a valid command object
        if (mJbiAdminCommands == null)
        {
            throw new CommandException(getLocalizedString("CouldNotInvokeCommand",
                                                    new Object[]{name}));
        }
        return true;
    }
View Full Code Here

                CLILogger.getInstance().printDetailMessage (msg);
            }
            else
            {
                String msg = mgmtMsg.getMessage();
                throw new CommandException(msg);
            }
        }
    }
View Full Code Here

            DomainsManager manager = getFeatureFactory().getDomainsManager();
            domainsList = manager.listDomains(domainConfig);
        }
        catch(Exception e)
        {
            throw new CommandException(getLocalizedString("CommandUnSuccessful",
                                                     new Object[] {name} ), e);
        }
        boolean allDomainsStopped = true;

        if (domainsList.length == 0)
            throw new CommandException(getLocalizedString("NoDomainsToStop"));
        else
            CLILogger.getInstance().printDetailMessage(getLocalizedString("StoppingAppserv",
                                                             new Object[] {getDomainsRoot()}));
       
        for (int i = 0; i < domainsList.length; i++)
        {
            try
            {
                stopDomain(domainsList[i]);               
            }
            catch(Exception e)
            {
                allDomainsStopped = false;
                CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
                CLILogger.getInstance().printExceptionStackTrace(e);
                CLILogger.getInstance().printError(getLocalizedString("CannotStopDomainMsg",
                                                       new Object[] {domainsList[i]}));
            }
        }
        if (!allDomainsStopped)
        {
            throw new CommandException(getLocalizedString("CannotStopOneOrMoreDomains"));

        }
    }
View Full Code Here

    public boolean validate() throws CommandException, CommandValidationException
    {
        //verify for no-spaces in domaindir option on non-windows platform
        String domainDirValue = getOption(DOMAINDIR_OPTION);
        if ((domainDirValue != null) && !isWindows() && isSpaceInPath(domainDirValue))
            throw new CommandException(getLocalizedString("SpaceNotAllowedInPath",
                                                            new Object[]{DOMAINDIR_OPTION}));
        //verify admin port is valid if specified on command line
        if (getOption(ADMIN_PORT) != null)
            verifyPortIsValid(getOption(ADMIN_PORT));
        //instance option is entered then verify instance port is valid
View Full Code Here

            DomainsManager manager = getFeatureFactory().getDomainsManager();
            DomainConfig config = getDomainConfig(domainName);
            manager.validateDomain(config, false);
        } catch (Exception e) {
            CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
            throw new CommandException(getLocalizedString("CouldNotCreateDomain",
                new Object[] {domainName}), e);
        }
    }
View Full Code Here

            create(domainConfig);
        }
        catch (Exception e)
        {
            CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
            throw new CommandException(getLocalizedString("CouldNotCreateDomain",
                new Object[] {domainName}), e);
        }
    }
View Full Code Here

        final int portToVerify = convertPortStr(portNum);

        if (portToVerify <= 0 || portToVerify > PORT_MAX_VAL)
        {
            throw new CommandException(getLocalizedString("InvalidPortRange",
                                         new Object[] {portNum}));
        }
        if (getBooleanOption(CHECKPORTS_OPTION) && !NetUtils.isPortFree(portToVerify))
        {
            throw new CommandException(getLocalizedString("PortInUse",
                                         new Object[] {(String) operands.firstElement(),
                                                       portNum}));
        }
        CLILogger.getInstance().printDebugMessage("Port =" + portToVerify);
    }
View Full Code Here

                for (int i=0; i<16384; i++) {
                        CFout.write(myString); // 16384 x 16 = 256k
                }
        } catch (IOException e) {
            CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
            throw new CommandException(getLocalizedString("NotEnoughFreeDiskSpace",
                new Object[] {domainName}), e);
        } finally {
                try {
                       CFout.close();
                } catch (Exception ex) { } // no-op
View Full Code Here

TOP

Related Classes of com.sun.enterprise.cli.framework.CommandException

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.