**javacard.framework.service** ====Interface Service ==== **All Known Subinterfaces:** [[javacard:java-card-api:RemoteService|RemoteService]] , [[javacard:java-card-api:SecurityService|SecurityService]] **All Known Implementing Classes:** [[javacard:java-card-api:BasicService|BasicService]] , [[javacard:java-card-api:RMIService|RMIService]] ---- This is the base interface for the service framework on the Java Card platform. A Service is an object that is able to perform partial or complete processing on a set of incoming commands encapsulated in an APDU. Services collaborate in pre-processing, command processing and post-processing of incoming APDU commands. They share the same APDU object by using the communication framework and the Common Service Format (CSF) defined in BasicService. An application is built by combining pre-built and newly defined Services within a Dispatcher object. **Version:** 1.0 **See Also:**[[javacard:java-card-api:BasicService|BasicService]] ---- ^ Method Summary ^^ | ** boolean** | **[[javacard:java-card-api:Service#processCommand(javacard.framework.APDU)|processCommand]] **([[javacard:java-card-api:APDU|APDU]]  apdu)          Processes the command in the APDU object. | | ** boolean** | **[[javacard:java-card-api:Service#processDataIn(javacard.framework.APDU)|processDataIn]] **([[javacard:java-card-api:APDU|APDU]]  apdu)          Pre-processes the input data for the command in the APDU object. | | ** boolean** | **[[javacard:java-card-api:Service#processDataOut(javacard.framework.APDU)|processDataOut]] **([[javacard:java-card-api:APDU|APDU]]  apdu)          Post-processes the output data for the command in the APDU object. |   ^ Method Detail ^ === processDataIn === boolean **processDataIn**([[javacard:java-card-api:APDU|APDU]]  apdu) Pre-processes the input data for the command in 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. The method must return true if no more pre-processing should be performed, and false otherwise. In particular, it must return false if it has not performed any processing on the command. After normal completion, the APDU object is usually in STATE_FULL_INCOMING with the APDU buffer in the Input Ready format defined in BasicService. However, in some cases if the Service processes the command entirely, the APDU object may be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService. **Parameters:**apdu - the APDU object containing the command being processed **Returns:**true if input processing is finished, false otherwise ---- === processCommand === boolean **processCommand**([[javacard:java-card-api:APDU|APDU]]  apdu) Processes the command in the APDU object. When invoked, the APDU object should normally 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. However, in some cases, if a pre-processing service has processed the command entirely, the APDU object may be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService. The method must return true if no more command processing is required, and false otherwise. In particular, it should return false if it has not performed any processing on the command. After normal completion, the APDU object must be in STATE_OUTGOING and the output response must be in the APDU buffer in the Output Ready format defined in BasicService. **Parameters:**apdu - the APDU object containing the command being processed **Returns:**true if the command has been processed, false otherwise ---- === processDataOut === boolean **processDataOut**([[javacard:java-card-api:APDU|APDU]]  apdu) Post-processes the output data for the command in the APDU object. When invoked, the APDU object should be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService. The method should return true if no more post-processing is required, and false otherwise. In particular, it should return false if it has not performed any processing on the command. After normal completion, the APDU object should must be in STATE_OUTGOING and the output response must be in the APDU buffer in the Output Ready format defined in BasicService. **Parameters:**apdu - the APDU object containing the command being processed **Returns:**true if output processing is finished, false otherwise