com.ibm.jc
Class RemoteMethod

java.lang.Object
  extended bycom.ibm.jc.RemoteMethod

public class RemoteMethod
extends java.lang.Object

This class represents a remote method of a remote card object.

See Also:
RemoteObject

Method Summary
 java.lang.String getDescriptor()
          Returns the method descriptor as used in Java class files.
 byte[] getEncodedParameters()
          Returns the method parameters encoded as sent within the INVOKE command.
 int getIdentifier()
          Returns the remote method identifier.
 java.lang.String getName()
          Returns the simple (not fully qualified) method name.
 RemoteObject getObject()
          Returns the remote object this method belongs to.
 java.lang.String getParamType(int param)
          Returns the type string of a particular parameter.
 java.lang.String getReturnType()
          Returns the type string defining the return type of this method.
 java.lang.String getSignature()
          Returns the method signature description as described in com.ibm.jc.RemoteObject.getRemoteMethod().
 java.lang.Object invoke()
          Invokes this remote method by sending an INVOKE command APDU.
 int numberParams()
          Returns the number of parameters this method has.
 void setNullArrayParameter(int pNumber)
          Sets the value of an array parameter to null.
 void setParameter(int pNumber, boolean value)
          Sets a parameter value of type boolean.
 void setParameter(int pNumber, boolean[] value)
          Sets a parameter value of type boolean[].
 void setParameter(int pNumber, boolean[] value, int offset, int length)
          Sets a parameter value of type boolean[].
 void setParameter(int pNumber, byte value)
          Sets a parameter value of type byte.
 void setParameter(int pNumber, byte[] value)
          Sets a parameter value of type byte[].
 void setParameter(int pNumber, byte[] value, int offset, int length)
          Sets a parameter value of type byte[].
 void setParameter(int pNumber, short value)
          Sets a parameter value of type short.
 void setParameter(int pNumber, short[] value)
          Sets a parameter value of type short[].
 void setParameter(int pNumber, short[] value, int offset, int length)
          Sets a parameter value of type short[].
 java.lang.String toString()
          Returns a textual description of this remote method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setParameter

public void setParameter(int pNumber,
                         short value)
Sets a parameter value of type short.

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The short value to be set.
Throws:
JCException - if the target parameter is not of type short or if the parameter number is out of range.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         short[] value)
Sets a parameter value of type short[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The short array to be set (might be null).
Throws:
JCException - if the target parameter is not of type short[], the parameter number is out of range or the max. array length is exceeded.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         short[] value,
                         int offset,
                         int length)
Sets a parameter value of type short[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The short array holding the parameter value to be set (might be null).
offset - Offset into value.
length - The number of short elements to be set. Max. array length is 254.
Throws:
JCException - if the target parameter is not of type short[], the parameter number is out of range or the max. array length is exceeded.
java.lang.IndexOutOfBoundsException - if the value array is accessed out of bounds.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         byte value)
Sets a parameter value of type byte.

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The byte value to be set.
Throws:
JCException - if the target parameter is not of type byte or if the parameter number is out of range.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         byte[] value)
Sets a parameter value of type byte[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The byte array to be set (might be null).
Throws:
JCException - if the target parameter is not of type byte[], the parameter number is out of range or the max. array length is exceeded.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         byte[] value,
                         int offset,
                         int length)
Sets a parameter value of type byte[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The byte array holding the parameter value to be set (might be null).
offset - Offset into value.
length - The number of byte elements to be set. Max. array length is 254.
Throws:
JCException - if the target parameter is not of type byte[], the parameter number is out of range or the max. array length is exceeded.
java.lang.IndexOutOfBoundsException - if the value array is accessed out of bounds.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         boolean value)
Sets a parameter value of type boolean.

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The boolean value to be set.
Throws:
JCException - if the target parameter is not of type boolean or if the parameter number is out of range.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         boolean[] value)
Sets a parameter value of type boolean[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The booelan array to be set (might be null).
Throws:
JCException - if the target parameter is not of type boolean[], the parameter number is out of range or the max. array length is exceeded.
See Also:
JCException

setParameter

public void setParameter(int pNumber,
                         boolean[] value,
                         int offset,
                         int length)
Sets a parameter value of type boolean[].

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
value - The booelan array holding the parameter value to be set (might be null).
offset - Offset into value.
length - The number of boolean elements to be set. Max. array length is 254.
Throws:
JCException - if the target parameter is not of type boolean[], the parameter number is out of range or the max. array length is exceeded.
java.lang.IndexOutOfBoundsException - if the value array is accessed out of bounds.
See Also:
JCException

setNullArrayParameter

public void setNullArrayParameter(int pNumber)
Sets the value of an array parameter to null. Allows to set null array references independent of the array type (byte[], short[] or boolean[]).

Parameters:
pNumber - The number of the target parameter (parameters are numbered from left to right 1-n, where n denotes the number of parameters this method has)
Throws:
JCException - if the target parameter is not an array parameter or the parameter number is out of range.
See Also:
JCException

invoke

public java.lang.Object invoke()
Invokes this remote method by sending an INVOKE command APDU. All parameters, if any, must be set via the setParameter() methods prior to calling this method. Note: If the JC RMI server applet hosting the remote object is of type OPApplet then the applet's secure channel, if any, is used for remote method invokation.

Returns:
The object returned by the remote method. This might be an object of type Byte, Short, Boolean, byte[], short[], boolean[] or RemoteObject. If the remote method returns a null array or object reference or the return type is void this method returns null.
Throws:
RemoteException - If the remote method has thrown an exception.
JCRMIErrorException - If the card reported an JC RMI error.
JCException - If not all parameters have been set, the encoded parameters do not fit into one APDU (parameters > 251), the command failed, the response is invalid, or there is a return type mismatch.
See Also:
JCException, JCRMIErrorException, RemoteException

getEncodedParameters

public byte[] getEncodedParameters()
Returns the method parameters encoded as sent within the INVOKE command.

Returns:
The encoded parameters or null if this method has no parameters.
Throws:
JCException - If not all parameters have been set.
See Also:
JCException

getObject

public RemoteObject getObject()
Returns the remote object this method belongs to.

Returns:
The remote object this method belongs to.

getIdentifier

public int getIdentifier()
Returns the remote method identifier.

Returns:
The remote method identifier.

getDescriptor

public java.lang.String getDescriptor()
Returns the method descriptor as used in Java class files.

Returns:
The remote method descriptor.

getSignature

public java.lang.String getSignature()
Returns the method signature description as described in com.ibm.jc.RemoteObject.getRemoteMethod().

Returns:
The remote method signature.
See Also:
RemoteObject

getName

public java.lang.String getName()
Returns the simple (not fully qualified) method name.

Returns:
The remote method name.

toString

public java.lang.String toString()
Returns a textual description of this remote method.

Returns:
Info string.

getParamType

public java.lang.String getParamType(int param)
Returns the type string of a particular parameter.

Returns:
The Java type string (e.g. byte[]).
Throws:
JCException - if the parameter number is out of range.
See Also:
JCException

getReturnType

public java.lang.String getReturnType()
Returns the type string defining the return type of this method.

Returns:
The Java type string (e.g. byte[]).

numberParams

public int numberParams()
Returns the number of parameters this method has.

Returns:
Number of parameters.