javax.activation
Class CommandInfo

java.lang.Object
  extended by javax.activation.CommandInfo

public class CommandInfo
extends Object

Version:
$Rev: 123383 $ $Date: 2004-12-26 19:11:00 -0800 (Sun, 26 Dec 2004) $

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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getCommandName

public String getCommandName()
Return the command name.

Returns:
the command name

getCommandClass

public String getCommandClass()
Return the implementation class name.

Returns:
the name of the command's implementation class; may be null

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
Throws:
IOException - if there was a problem initializing the command
ClassNotFoundException - if the command class could not be found


Copyright © 2006 Apache Software Foundation. All Rights Reserved.