FileDocCategorySizeDatePackage
InstallAddonCommand.javaAPI DocGlassfish v2 API3759Fri May 04 22:25:10 BST 2007com.sun.enterprise.cli.commands

InstallAddonCommand

public class InstallAddonCommand extends BaseLifeCycleCommand
Install an Addon on top of appserver.

Fields Summary
Constructors Summary
public InstallAddonCommand()
Creates new DeleteDomainCommand

    
Methods Summary
public voidrunCommand()
Executes the command

throws
CommandException

        validateOptions();
	
	String addonJar = null;
        try
        {            
	    addonJar = (String)operands.firstElement();
            File addonJarFile = new File(addonJar);
            if (addonJarFile.isFile() && addonJarFile.exists()) {
                AddonControl ac = new AddonControl();
                ac.install(addonJarFile);
            } else {
	        throw new CommandException
                (getLocalizedString("InvalidAddonFile", new Object[] {addonJar}));
            }
        }
        catch (CommandException ce)
        {
            throw ce;
        }
        catch (Throwable t)
        {
	    CLILogger.getInstance().printDetailMessage(t.getLocalizedMessage());
	    throw new CommandException(getLocalizedString("InstallAddonFailed",
							  new Object[] {addonJar}));
        }

	CLILogger.getInstance().printDetailMessage(getLocalizedString("InstallAddonCompleted",
                                             new Object[] {addonJar}));
    
public booleanvalidateOptions()
Validates the Options for correctness

return
boolean returns true if validation is succesful else false

        return super.validateOptions();