Remote Stub Object
The Java Card RMI API supports two formats for passing remote references. The format for remote references containing the class name requires stubs for remote objects available to the client application.
You can use the standard Java RMIC compiler tool as the stub compilation tool to produce stub classes required for the client application. To produce these stub classes, the RMIC compiler tool must have access to all the non-abstract classes defined in the applet package which directly or indirectly implement remote interfaces. In addition, it needs to access the .class
files of all the remote interfaces implemented by them.
If you want the stub class to be Java Card RMI-specific when it is instantiated on the client, it must be customized with a Java Card platform-specific implementation of the CardObjectFactory
interface.
The standard Java RMIC compiler is used to generate the remote stub objects. JCRemoteRefImpl, a Java Card platform-specific implementation of the java.rmi.server.RemoteRef
interface, allows these stub objects to work with the Java Card RMI API. The stub object delegates all method invocations to its configured RemoteRef instance.
The com.sun.javacard.rmiclientlib.JCRemoteRefImpl
class is an example of a RemoteRef object customized for the Java Card platform.
For examples of how to use these interfaces and classes, see Java Card Platform Application Programming Interface Specification, Classic Edition, Version 3.1.
Note:
Since the remote object is configured as a Java Card platform-specific object with a local connection to the smart card through the CardAccessor object, the object is inherently not portable. A bridge class must be used if it is to be accessed from outside of this client application.
Note:
Some versions of the RMIC do not treat Throwable
as a superclass of RemoteException
. The workaround is to declare remote methods to throw Exception
instead.