javax.activation
Class CommandInfo
java.lang.Object
javax.activation.CommandInfo
public class CommandInfo
extends java.lang.Object
CommandInfo(String commandName, String commandClass) - Constructor for a CommandInfo
|
CommandInfo
public CommandInfo(String commandName,
String commandClass)
Constructor for a CommandInfo
commandName
- the command namecommandClass
- the name of the command's implementation class
getCommandClass
public String getCommandClass()
Return the implementation class name.
- the name of the command's implementation class; may be null
getCommandName
public String getCommandName()
Return 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().
dh
- a DataHandler that provides the data to be passed to the commandloader
- the ClassLoader to be used to instantiate the command