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

ListJNDIEntriesCommand

public class ListJNDIEntriesCommand extends GenericCommand

Fields Summary
private static final String
CONTEXT_OPTION
Constructors Summary
Methods Summary
public voiddisplayExceptionMessage(java.lang.Exception e)


         
    
        Throwable t = e.getCause();
   
         if(t != null)
             CLILogger.getInstance().printDetailMessage(t.getMessage());
         else if(e != null)
             CLILogger.getInstance().printDetailMessage(e.getMessage()); 
		
         throw new CommandException(getLocalizedString("CommandUnSuccessful",
                                                       new Object[] {name} ), e);
    
protected voidhandleReturnValue(java.lang.Object retVal)

        final ArrayList list  =(ArrayList)retVal;

        if (!list.isEmpty())
        {
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                                                       "JndiEntries", new Object[]
                                                       {(String) getOperands().get(0),
                                                       getOption(CONTEXT_OPTION)==null?
                                                       "root":getOption(CONTEXT_OPTION)}) );
            
            final Iterator iterator= list.iterator();
            while (iterator.hasNext())
            {
                final NameClassPair nameClassPair = (NameClassPair) iterator.next();
            
                CLILogger.getInstance().printMessage(getLocalizedString("NameClassPair",                                                      new Object[]{nameClassPair.getName(), nameClassPair.getClassName()}));
            }
        }