javax.activation
Class CommandInfo
java.lang.Object
javax.activation.CommandInfo
- public class CommandInfo
- extends java.lang.Object
- Version:
- $Rev: 123383 $ $Date: 2004-12-26 20:11:00 -0700 (Sun, 26 Dec 2004) $
|
Constructor Summary |
CommandInfo(java.lang.String commandName,
java.lang.String commandClass)
Constructor for a CommandInfo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
commandName
private final java.lang.String commandName
commandClass
private final java.lang.String commandClass
CommandInfo
public CommandInfo(java.lang.String commandName,
java.lang.String commandClass)
- Constructor for a CommandInfo
- Parameters:
commandName - the command namecommandClass - the name of the command's implementation class
getCommandName
public java.lang.String getCommandName()
- Return the command name.
- Returns:
- the command name
getCommandClass
public java.lang.String getCommandClass()
- Return the implementation class name.
- Returns:
- the name of the command's implementation class; may be null
getCommandObject
public java.lang.Object getCommandObject(DataHandler dh,
java.lang.ClassLoader loader)
throws java.io.IOException,
java.lang.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 commandloader - the ClassLoader to be used to instantiate the command
- Returns:
- a new command instance
- Throws:
java.io.IOException - if there was a problem initializing the command
java.lang.ClassNotFoundException - if the command class could not be found