org.sapia.ubik.rmi.server.invocation
Class InvokeCommand

java.lang.Object
  extended by org.sapia.ubik.rmi.server.command.Command
      extended by org.sapia.ubik.rmi.server.RMICommand
          extended by org.sapia.ubik.rmi.server.invocation.InvokeCommand
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Executable
Direct Known Subclasses:
CallBackInvokeCommand, ReplicatedCommand

public class InvokeCommand
extends RMICommand
implements java.io.Externalizable

This commands performs a remote method invocation.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.sapia.ubik.rmi.server.RMICommand
_config, _vmId
 
Constructor Summary
InvokeCommand()
          Do not call; used for externalization only.
InvokeCommand(OID oid, java.lang.String methodName, java.lang.Object[] params, java.lang.Class[] paramClasses, java.lang.String transportType)
           
 
Method Summary
protected  void convertParams(java.lang.ClassLoader loader)
          Internally converts the parameters of the method to call.
 java.lang.Object execute()
          Executes this command.
 java.lang.String getMethodName()
          Returns the name of the method to invoke.
 OID getOID()
          Returns the object identifier of the object on which the invocation will be performed.
 java.lang.Class[] getParameterTypes()
          Returns the signature (the types of the method's parameters) of the method to call.
 java.lang.Object[] getParams()
          Returns the parameters of the method to call.
 void readExternal(java.io.ObjectInput in)
           
 void setParams(java.lang.Object[] params)
           
 boolean usesMarshalledObjects()
          Returns true if this instance encapsulates method call parameters and return value in MarshalledObject instances.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.sapia.ubik.rmi.server.RMICommand
getConnection, getServerAddress, getVmId, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvokeCommand

public InvokeCommand()
Do not call; used for externalization only.


InvokeCommand

public InvokeCommand(OID oid,
                     java.lang.String methodName,
                     java.lang.Object[] params,
                     java.lang.Class[] paramClasses,
                     java.lang.String transportType)
Parameters:
oid - the OID (unique object identifier) of the object on which the method call should be performed.
methodName - the name of the method to call.
params - the method's parameters.
paramClasses - the method's signature, as a class array.
Method Detail

getOID

public OID getOID()
Returns the object identifier of the object on which the invocation will be performed.

Returns:
an OID.

getMethodName

public java.lang.String getMethodName()
Returns the name of the method to invoke.

Returns:
a method name.

getParameterTypes

public java.lang.Class[] getParameterTypes()
Returns the signature (the types of the method's parameters) of the method to call.

Returns:
an array of Class instances.

setParams

public void setParams(java.lang.Object[] params)

usesMarshalledObjects

public boolean usesMarshalledObjects()
Returns true if this instance encapsulates method call parameters and return value in MarshalledObject instances.

Returns:
true if this instance uses MarshalledObjects.
See Also:
MarshalledObject

getParams

public java.lang.Object[] getParams()
Returns the parameters of the method to call.


execute

public java.lang.Object execute()
                         throws java.lang.Throwable
Description copied from class: RMICommand
Executes this command.

Specified by:
execute in interface Executable
Specified by:
execute in class RMICommand
Returns:
any value returned by this method.
Throws:
java.lang.Throwable - if an error occurs while executing this command
See Also:
RMICommand.execute()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class RMICommand
Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Externalizable.readExternal(ObjectInput)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class RMICommand
Throws:
java.io.IOException
See Also:
Externalizable.writeExternal(ObjectOutput)

convertParams

protected void convertParams(java.lang.ClassLoader loader)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Internally converts the parameters of the method to call. Internally unmarshals the parameters if they are instances of MarshalledObject.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
MarshalledObject


Copyright © 2010 Sapia OSS. All Rights Reserved.