FileDocCategorySizeDatePackage
JBIUninstallCommands.javaAPI DocGlassfish v2 API4994Fri May 04 22:25:12 BST 2007com.sun.enterprise.cli.commands

JBIUninstallCommands

public class JBIUninstallCommands extends JBICommand
Will start the JBI component on the specified target.
version
$Revision: 1.4 $

Fields Summary
private static final String
UNINSTALL_COMPONENT
private static final String
UNINSTALL_SHARED_LIBRARY
private static final String
UNDEPLOY_SERVICE_ASSEMBLY
Constructors Summary
Methods Summary
public voidrunCommand()
A method that Executes the command

throws
CommandException


                   

         
    
        String result = "";
        String successKey = "";
        try {

            // Perform the pre run initialization
            if (preRunInit())
            {
                // Retrieve the options
                String  targetName  = getOption(TARGET_OPTION);
                boolean force       = getBooleanOption(FORCE_OPTION);
                boolean keepArchive = getBooleanOption(KEEP_ARCHIVE_OPTION);

                // Retrieve the operand
                String  componentName = (String) getOperands().get(0);

                // Using the command name, we'll determine how to process the command
                if (name.equals(UNINSTALL_COMPONENT)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).uninstallComponent(
                            componentName,
                            force,
                            keepArchive,
                            targetName);
                    successKey = "JBISuccessUninstallComponent";
                }

                else if (name.equals(UNINSTALL_SHARED_LIBRARY)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).uninstallSharedLibrary(
                            componentName,
                            force,
                            keepArchive,
                            targetName);
                    successKey = "JBISuccessUninstallSharedLibrary";
                }

                else if (name.equals(UNDEPLOY_SERVICE_ASSEMBLY)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).undeployServiceAssembly(
                            componentName,
                            force,
                            keepArchive,
                            targetName);
                    successKey = "JBISuccessUndeployServiceAssembly";
                }

                // Display the success message
                CLILogger.getInstance().printDetailMessage (
                        getLocalizedString (successKey,new Object[] {componentName}));
            }
        }

        catch (Exception e) {
            processTaskException(e);
        }