org.apache.geronimo.messaging
Class Request

java.lang.Object
  extended byorg.apache.geronimo.messaging.Request
All Implemented Interfaces:
Externalizable, Serializable

public class Request
extends Object
implements Externalizable

Encapsulates a method invocation.

Version:
$Revision: 1.2 $ $Date: 2004/06/01 13:37:14 $
See Also:
Serialized Form

Constructor Summary
Request()
          Required for Externalization.
Request(String aMethodName, Class[] anArrOfParamTypes, Object[] anArrOfParams)
          Wraps a method having the specified name and parameters.
 
Method Summary
 Result execute()
          Executes the command against the specified target.
 String getMethodName()
          Gets the method name to be executed.
 Object[] getParameters()
          Gets the parameters of the method to be executed.
 Class[] getParameterTypes()
          Gets the formal parameter of the method wrapped by this instance.
 void readExternal(ObjectInput in)
           
 void setTarget(Object aTarget)
          Sets the target against which the method is to be executed.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request()
Required for Externalization.


Request

public Request(String aMethodName,
               Class[] anArrOfParamTypes,
               Object[] anArrOfParams)
Wraps a method having the specified name and parameters.

Parameters:
aMethodName - Method name.
anArrOfParamTypes - Method formal parameters.
anArrOfParams - Parameters.
Method Detail

setTarget

public void setTarget(Object aTarget)
Sets the target against which the method is to be executed.

Parameters:
aTarget -

getMethodName

public String getMethodName()
Gets the method name to be executed.

Returns:
Returns the methodName.

getParameterTypes

public Class[] getParameterTypes()
Gets the formal parameter of the method wrapped by this instance.

Returns:
Formal parameters.

getParameters

public Object[] getParameters()
Gets the parameters of the method to be executed.

Returns:
Returns the parameters.

execute

public Result execute()
Executes the command against the specified target.

Returns:
CommandResult wrapping the invocation result. if the command does not exist for the specified target, then the CommandResult instance contains a NoSuchMethodException exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.