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

JBIListCommands

public class JBIListCommands extends JBICommand
Will list the names for the binding components, service engines, shared libraries, or service assemblies.
version
$Revision: 1.4 $

Fields Summary
private static final String
LIST_BINDING_COMPONENTS
private static final String
LIST_SERVICE_ENGINES
private static final String
LIST_SHARED_LIBRARIES
private static final String
LIST_SERVICE_ASSEMBLIES
Constructors Summary
Methods Summary
public voidrunCommand()
A method that Executes the command

throws
CommandException


                   
         
    
        String result = "";
        try {

            // Perform the pre run initialization
            if (preRunInit())
            {
                // Retrieve the options used for this command
                String  targetName     = getOption(TARGET_OPTION);
                String  libraryName    = getOption(LIBRARY_NAME_OPTION);                
                String  assemblyName   = getOption(ASSEMBLY_NAME_OPTION);  
                String  lifecycleState = getOption(LIFECYCLE_STATE_OPTION,validStates);                        
                String  componentName  = getOption(COMPONENT_NAME_OPTION);  

                // Using the command name, we'll determine how to process the command
                if (name.equals(LIST_BINDING_COMPONENTS)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).listBindingComponents(
                            lifecycleState,
                            libraryName,
                            assemblyName,
                            targetName);
                    processJBIAdminComponentListResult(result);
                }

                else if (name.equals(LIST_SERVICE_ENGINES)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).listServiceEngines(
                            lifecycleState,
                            libraryName,
                            assemblyName,
                            targetName);
                    processJBIAdminComponentListResult(result);
                }

                else if (name.equals(LIST_SHARED_LIBRARIES)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).listSharedLibraries(
                            componentName,
                            targetName);
                    processJBIAdminComponentListResult(result);
                }

                else if (name.equals(LIST_SERVICE_ASSEMBLIES)) {
                    result = ((JBIAdminCommands) mJbiAdminCommands).listServiceAssemblies(
                            lifecycleState,
                            componentName,
                            targetName);
                    processJBIAdminAsseblyListResult(result);
                }

                // Display the default success message
                CLILogger.getInstance().printDetailMessage (
                        getLocalizedString ("CommandSuccessful",new Object[] {name} ) );
            }
        }

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