**javacard.framework.service** ====Class RMIService ==== *[[javacard:java-card-api:object|java.lang.Object]] \\ *[[javacard:java-card-api:basicservice|javacard.framework.service.BasicService]] \\ **All Implemented Interfaces:** [[javacard:java-card-api:RemoteService|RemoteService]] , [[javacard:java-card-api:Service|Service]] ---- public class **RMIService**extends [[javacard:java-card-api:BasicService|BasicService]] implements [[javacard:java-card-api:RemoteService|RemoteService]] An implementation of a service that is used to process Java Card platform RMI requests for remotely accessible objects. ---- ^ Field Summary ^^ | **static byte** | **[[javacard:java-card-api:RMIService#DEFAULT_RMI_INVOKE_INSTRUCTION|DEFAULT_RMI_INVOKE_INSTRUCTION]] ** The default INS value (0x38) used for the remote method invocation command (INVOKE) in the Java Card platform RMI protocol. | ^ Constructor Summary ^^ | **[[javacard:java-card-api:RMIService#RMIService(java.rmi.Remote)|RMIService]] **([[javacard:java-card-api:Remote|Remote]] initialObject) Creates a new RMIService and sets the specified remote object as the initial reference for the applet. | ^ Method Summary ^^ | ** boolean** | **[[javacard:java-card-api:RMIService#processCommand(javacard.framework.APDU)|processCommand]] **([[javacard:java-card-api:APDU|APDU]] apdu) Processes the command within the APDU object. | | ** void** | **[[javacard:java-card-api:RMIService#setInvokeInstructionByte(byte)|setInvokeInstructionByte]] **(byte ins) Defines the instruction byte to be used in place of DEFAULT_RMI_INVOKE_INSTRUCTION in the Java Card platform RMI protocol for the INVOKE commands used to access the RMIService for remote method invocations. | ^ Methods inherited from class javacard.framework.service.BasicService ^ | [[javacard:java-card-api:BasicService#fail(javacard.framework.APDU, short)|fail]] , [[javacard:java-card-api:BasicService#getCLA(javacard.framework.APDU)|getCLA]] , [[javacard:java-card-api:BasicService#getINS(javacard.framework.APDU)|getINS]] , [[javacard:java-card-api:BasicService#getOutputLength(javacard.framework.APDU)|getOutputLength]] , [[javacard:java-card-api:BasicService#getP1(javacard.framework.APDU)|getP1]] , [[javacard:java-card-api:BasicService#getP2(javacard.framework.APDU)|getP2]] , [[javacard:java-card-api:BasicService#getStatusWord(javacard.framework.APDU)|getStatusWord]] , [[javacard:java-card-api:BasicService#isProcessed(javacard.framework.APDU)|isProcessed]] , [[javacard:java-card-api:BasicService#processDataIn(javacard.framework.APDU)|processDataIn]] , [[javacard:java-card-api:BasicService#processDataOut(javacard.framework.APDU)|processDataOut]] , [[javacard:java-card-api:BasicService#receiveInData(javacard.framework.APDU)|receiveInData]] , [[javacard:java-card-api:BasicService#selectingApplet()|selectingApplet]] , [[javacard:java-card-api:BasicService#setOutputLength(javacard.framework.APDU, short)|setOutputLength]] , [[javacard:java-card-api:BasicService#setProcessed(javacard.framework.APDU)|setProcessed]] , [[javacard:java-card-api:BasicService#setStatusWord(javacard.framework.APDU, short)|setStatusWord]] , [[javacard:java-card-api:BasicService#succeed(javacard.framework.APDU)|succeed]] , [[javacard:java-card-api:BasicService#succeedWithStatusWord(javacard.framework.APDU, short)|succeedWithStatusWord]] | ^ Methods inherited from class java.lang.Object ^ | [[javacard:java-card-api:Object#equals(java.lang.Object)|equals]] | ^ Methods inherited from interface javacard.framework.service.Service ^ | [[javacard:java-card-api:Service#processDataIn(javacard.framework.APDU)|processDataIn]] , [[javacard:java-card-api:Service#processDataOut(javacard.framework.APDU)|processDataOut]] | ^ Field Detail ^ === DEFAULT_RMI_INVOKE_INSTRUCTION === public static final byte **DEFAULT_RMI_INVOKE_INSTRUCTION** The default INS value (0x38) used for the remote method invocation command (INVOKE) in the Java Card platform RMI protocol. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.service.RMIService.DEFAULT_RMI_INVOKE_INSTRUCTION|Constant Field Values]] ^ Constructor Detail ^ === RMIService === public **RMIService**([[javacard:java-card-api:Remote|Remote]] initialObject) throws [[javacard:java-card-api:NullPointerException|NullPointerException]] Creates a new RMIService and sets the specified remote object as the initial reference for the applet. The initial reference will be published to the client in response to the SELECT APDU command processed by this object. The RMIService instance may create session data to manage exported remote objects for the current applet session in CLEAR_ON_DESELECT transient space. **Parameters:**initialObject - the remotely accessible initial object **Throws:** [[javacard:java-card-api:NullPointerException|NullPointerException]] - if the initialObject parameter is null ^ Method Detail ^ === setInvokeInstructionByte === public void **setInvokeInstructionByte**(byte ins) Defines the instruction byte to be used in place of DEFAULT_RMI_INVOKE_INSTRUCTION in the Java Card platform RMI protocol for the INVOKE commands used to access the RMIService for remote method invocations. Note: \\ *//The new instruction byte goes into effect next time this RMIService instance processes an applet SELECT command. The Java Card platform RMI protocol until then is unchanged.// \\ **Parameters:**ins - the instruction byte ---- === processCommand === public boolean **processCommand**([[javacard:java-card-api:APDU|APDU]] apdu) Processes the command within the APDU object. When invoked, the APDU object should either be in STATE_INITIAL with the APDU buffer in the Init format or in STATE_FULL_INCOMING with the APDU buffer in the Input Ready format defined in BasicService. This method first checks if the command in the APDU object is a Java Card platform RMI access command. The Java Card platform RMI access commands currently defined are: Applet SELECT and INVOKE. If it is not a Java Card platform RMI access command, this method does nothing and returns false. If the command is a Java Card platform RMI access command, this method processes the command and generates the response to be returned to the terminal. For a detailed description of the APDU protocol used in Java Card platform RMI access commands please see the Remote Method Invocation Service chapter of //Runtime Environment Specification for the Java Card Platform//. Java Card platform RMI access commands are processed as follows: \\ *An applet SELECT command results in a Java Card platform RMI information structure in FCI format containing the initial reference object as the response to be returned to the terminal. \\ *An INVOKE command results in the following sequence - \\