FileDocCategorySizeDatePackage
Command.javaAPI DocExample1292Wed Apr 05 11:25:42 BST 2000None

Command.java

/*
 * This example is from the book "Java Enterprise in a Nutshell".
 * Copyright (c) 1999 by O'Reilly & Associates.  
 * You may distribute this source code for non-commercial purposes only.
 * You may study, modify, and use this example for any purpose, as long as
 * this notice is retained.  Note that this example is provided "as is",
 * WITHOUT WARRANTY of any kind either expressed or implied.
 */

/******************************************************************************
 Command.java
 
 Defines the behavior of a NamingShell command.
 
 The method execute(Context, Vector) is how the NamingShell executes the
 command. The Context parameter represents the Context the command operates
 upon, and the Vector packages up any data necessary. Any data that the command 
 returns to the NamingShell is required to use a NamingShell accessor method.  
 
 Any unrecoverable error that a Command encounters should cause the Command
 to throw a CommandException, and the shell will handle it gracefully.
******************************************************************************/

import java.util.Vector;
import javax.naming.Context;

public interface Command
{
    public void execute(Context c, Vector v)
        throws CommandException;
        
    public void help();
    
}