javax.activation

Class CommandInfo

public class CommandInfo extends Object

Constructor Summary
CommandInfo(String commandName, String commandClass)
Constructor for a CommandInfo
Method Summary
StringgetCommandClass()
Return the implementation class name.
StringgetCommandName()
Return the command name.
ObjectgetCommandObject(DataHandler dh, ClassLoader loader)
Instantiate and return a command JavaBean.

Constructor Detail

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 Detail

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)
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

Throws: IOException if there was a problem initializing the command ClassNotFoundException if the command class could not be found