public interface Service
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.
BasicService
Modifier and Type | Method and Description |
---|---|
boolean |
processCommand(APDU apdu)
Processes the command in the
APDU object. |
boolean |
processDataIn(APDU apdu)
Pre-processes the input data for the command in the
APDU
object. |
boolean |
processDataOut(APDU apdu)
Post-processes the output data for the command in the
APDU
object. |
boolean processDataIn(APDU apdu)
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
.
apdu
- the APDU
object containing the command being
processedtrue
if input processing is finished,
false
otherwiseboolean processCommand(APDU apdu)
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
.
apdu
- the APDU
object containing the command being
processedtrue
if the command has been processed,
false
otherwiseboolean processDataOut(APDU apdu)
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
.
apdu
- the APDU
object containing the command being
processedtrue
if output processing is finished,
false
otherwiseCopyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms