com.ibm.jc
Class RemoteObject

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

public class RemoteObject
extends java.lang.Object

This class represents a remote card object reference.


Constructor Summary
RemoteObject(JCApplet applet, boolean refWithClass)
          Selects the given JC RMI server applet via the current logical channel and constructs an initial remote object from the returned applet FCI.
RemoteObject(JCApplet applet, byte[] selectFCI, int off, boolean refWithClass)
          Constructs an initial remote object from the given applet FCI.
RemoteObject(JCApplet applet, int ins, int jcrmiVersion, byte[] desc, int off, boolean refWithClass)
          Constructs a remote object from the given remote object descriptor data.
 
Method Summary
 JCApplet getApplet()
          Returns the JC RMI server applet hosting this remote obejct.
 byte[] getHashModifier()
          Returns the hash modifier used by this object.
 int getINS()
          Returns the INVOKE instruction byte used to send INVOKE command APDUs.
 int getJCRMIVersion()
          Returns the version of the JC RMI protocol used.
 java.lang.Object getName()
          Returns the class/inteface name(s) of this remote object.
 int getRefID()
          Returns the remote object reference ID.
 RemoteMethod getRemoteMethod(java.lang.String name, java.lang.String signature)
          Generates a remote method for this remote object.
 RemoteMethod getRemoteMethodIntl(java.lang.String name, java.lang.String signature)
          Generates a remote method for this remote object.
 void setINS(int ins)
          Sets the INVOKE instruction byte used to send INVOKE command APDUs.
 java.lang.String toString()
          Returns a textual description of this remote object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteObject

public RemoteObject(JCApplet applet,
                    boolean refWithClass)
Selects the given JC RMI server applet via the current logical channel and constructs an initial remote object from the returned applet FCI.

Parameters:
applet - JavaCard RMI server applet hosting the remote object (might be of type OPApplet).
refWithClass - true if the applet is to be selected with the remote_ref_with_class bit (bit 5 of P2 in command header) not set, false otherwise (meaning format remote_ref_with_interfaces).
Throws:
JCException - if parameters are invalid, the FCI does not include a valid object descriptor or the FCI includes a null object reference.
JCRMIErrorException - if the FCI includes a JC RMI error response.
See Also:
JCException, JCRMIErrorException

RemoteObject

public RemoteObject(JCApplet applet,
                    byte[] selectFCI,
                    int off,
                    boolean refWithClass)
Constructs an initial remote object from the given applet FCI.

Parameters:
applet - JavaCard RMI server applet hosting the remote object (might be of type OPApplet).
selectFCI - the FCI including the remote object descriptor.
refWithClass - true if the applet has been selected with the remote_ref_with_class bit (bit 5 of P2 in command header) not set, false otherwise (meaning format remote_ref_with_interfaces).
Throws:
JCException - if parameters are invalid, the FCI does not include a valid object descriptor or the FCI includes a null object reference.
JCRMIErrorException - if the FCI includes a JC RMI error response.
See Also:
JCException, JCRMIErrorException

RemoteObject

public RemoteObject(JCApplet applet,
                    int ins,
                    int jcrmiVersion,
                    byte[] desc,
                    int off,
                    boolean refWithClass)
Constructs a remote object from the given remote object descriptor data.

Parameters:
applet - JavaCard RMI server applet hosting the remote object (might be of type OPApplet).
ins - The instruction byte to be used when invoking remote methods.
jcrmiVersion - The JC RMI version (e.g. 0x0202).
desc - The remote object descriptor.
off - Offset into desc.
refWithClass - true if the applet has been selected with the remote_ref_with_class bit (bit 5 of P2 in command header) not set, false otherwise (meaning format remote_ref_with_interfaces).
Throws:
JCException - if parameters are invalid, the data does not include a valid object descriptor or the descriptor includes a null object reference.
See Also:
JCException
Method Detail

getINS

public int getINS()
Returns the INVOKE instruction byte used to send INVOKE command APDUs.

Returns:
INVOKE instruction byte.

setINS

public void setINS(int ins)
Sets the INVOKE instruction byte used to send INVOKE command APDUs.

Parameters:
ins - INVOKE instruction byte.

getJCRMIVersion

public int getJCRMIVersion()
Returns the version of the JC RMI protocol used.

Returns:
JC RMI version (0x0202).

getRefID

public int getRefID()
Returns the remote object reference ID.

Returns:
The remote object reference ID.

getHashModifier

public byte[] getHashModifier()
Returns the hash modifier used by this object.

Returns:
The hash modifier (might be null).

getApplet

public JCApplet getApplet()
Returns the JC RMI server applet hosting this remote obejct.

Returns:
The applet.

getName

public java.lang.Object getName()
Returns the class/inteface name(s) of this remote object.

Returns:
If the returned object is of type String[2] it holds the package name at index 0 and the class name at index 1. If the returned object is of type String[N][2] it holds a list of interface descriptions, where for each interface (N) the package name is at index 0 and the interface name at index 1.

toString

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

Returns:
Info string.

getRemoteMethod

public RemoteMethod getRemoteMethod(java.lang.String name,
                                    java.lang.String signature)
Generates a remote method for this remote object.

Parameters:
name - The simple, not fully qualified, method name.
signature - The method signature in the format:

[<return type>] ([<parameter type>, <parameter type>, ...])

The return type must be either one of the basic types (byte; byte[];short;short[]; boolean;booolean[]) or a fully qualified class name (usually java.rmi.Remote) indicating an object reference. Parameters can be of basic type (as listed above) only. The type void can be omitted.
Returns:
The remote method object.
Throws:
JCException - if parameters are invalid.
See Also:
RemoteMethod, JCException

getRemoteMethodIntl

public RemoteMethod getRemoteMethodIntl(java.lang.String name,
                                        java.lang.String signature)
Generates a remote method for this remote object.

Parameters:
name - The simple, not fully qualified, method name.
signature - The method signature in the format as it is used internally within Java class files.
Returns:
The remote method object.
Throws:
JCException - if parameters are invalid.
See Also:
RemoteMethod, JCException