javax.activation

Class CommandInfo


public class CommandInfo
extends java.lang.Object

Constructor Summary

CommandInfo(String commandName, String commandClass)
Constructor for a CommandInfo

Method Summary

String
getCommandClass()
Return the implementation class name.
String
getCommandName()
Return the command name.
Object
getCommandObject(DataHandler dh, ClassLoader loader)
Instantiate and return a command JavaBean.

Constructor Details

CommandInfo

public CommandInfo(String commandName,
                   String commandClass)
Constructor for a CommandInfo
Parameters:
commandName - the command name
commandClass - the name of the command's implementation class

Method Details

getCommandClass

public String getCommandClass()
Return the implementation class name.
Returns:
the name of the command's implementation class; may be null

getCommandName

public String getCommandName()
Return the command name.
Returns:
the command name

getCommandObject

public Object getCommandObject(DataHandler dh,
                               ClassLoader loader)
            throws IOException,
                   ClassNotFoundException
Instantiate and return a command JavaBean. The bean is created using Beans.instantiate(loader, commandClass). If the new bean implements CommandObject then its setCommandContext(String, DataHandler) method is called. Otherwise if it implements Externalizable and the supplied DataHandler is not null then its readExternal(ObjectInputStream) method is called with a stream obtained from DataHandler.getInputStream().
Parameters:
dh - a DataHandler that provides the data to be passed to the command
loader - the ClassLoader to be used to instantiate the command
Returns:
a new command instance