|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavacard.framework.Applet
com.licel.jcardsim.samples.ChannelsDemo.AccountAccessor
public class AccountAccessor
This applet keeps track of the account information for a fictional wireless device connecting to a network service. The device has a home area, but it is also capable of operating in remote areas at a higher rate. Using the device debuts the amount of available credits. The terminal can also add credits to the account via a specific command.
Method Summary | |
---|---|
void |
deselect()
Called by the Java Card runtime environment to inform that this currently selected applet is being deselected on this logical channel and no applet from the same package is still active on any other logical channel. |
void |
deselect(boolean appInstStillSelected)
Called by the Java Card runtime environment to inform that this applet instance has been selected while the same applet instance or another applet instance from the same package is active on another logical channel. |
static AccountAccessor |
getAccount()
|
static void |
install(byte[] bArray,
short bOffset,
byte bLength)
|
void |
process(APDU apdu)
Called by the Java Card runtime environment to process an incoming APDU command. |
boolean |
select()
Called by the Java Card runtime environment to inform this applet that it has been selected when no applet from the same package is active on any other logical channel. |
boolean |
select(boolean appInstAlreadySelected)
Called by the Java Card runtime environment to inform that this applet instance has been selected while the same applet instance or another applet instance from the same package is active on another logical channel. |
Methods inherited from class javacard.framework.Applet |
---|
getShareableInterfaceObject, register, register, selectingApplet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void install(byte[] bArray, short bOffset, byte bLength)
public boolean select()
Applet
It is called when a SELECT APDU command or MANAGE CHANNEL OPEN APDU command is received and before the applet is selected. SELECT APDU commands use instance AID bytes for applet selection. See Runtime Environment Specification for the Java Card Platform, section 4.5 for details.
A subclass of Applet
should override this method
if it should perform any initialization that may be required to
process APDU commands that may follow.
This method returns a boolean to indicate that it is ready to accept incoming APDU
commands via its process()
method. If this method returns false, it indicates to
the Java Card runtime environment that this Applet declines to be selected.
Note:
javacard.framework.MultiSelectable.select(
) method is not
called if this method is invoked.
The implementation of this method provided by
Applet
class returns true
.
select
in class Applet
true
to indicate success, false
otherwisepublic void deselect()
Applet
select()
method being invoked.
A subclass of Applet
should override this method if
it has any cleanup or bookkeeping work to be performed before another
applet is selected.
The default implementation of this method provided by Applet
class does nothing.
Notes:
javacard.framework.MultiSelectable.deselect(
) method is not
called if this method is invoked.
JCSystem.CLEAR_ON_DESELECT
clear event type
are cleared to their default value by the Java Card runtime environment after this method.
deselect
in class Applet
public boolean select(boolean appInstAlreadySelected)
MultiSelectable
It is called either when the MANAGE CHANNEL APDU (open) command or the SELECT APDU command is received and before the applet instance is selected. SELECT APDU commands use instance AID bytes for applet selection. See Runtime Environment Specification for the Java Card Platform, section 4.5 for details.
A subclass of Applet
should, within this method,
perform any initialization that may be required to
process APDU commands that may follow.
This method returns a boolean to indicate that it is ready to accept
incoming APDU commands via its process()
method. If this method returns
false, it indicates to the Java Card runtime environment that this applet instance declines to be selected.
Note:
javacard.framework.Applet.select(
) method is not
called if this method is invoked.
select
in interface MultiSelectable
public void deselect(boolean appInstStillSelected)
MultiSelectable
It is called either when the MANAGE CHANNEL APDU (open) command or the SELECT APDU command is received and before the applet instance is selected. SELECT APDU commands use instance AID bytes for applet selection. See Runtime Environment Specification for the Java Card Platform, section 4.5 for details.
A subclass of Applet
should, within this method,
perform any initialization that may be required to
process APDU commands that may follow.
This method returns a boolean to indicate that it is ready to accept
incoming APDU
commands via its process()
method. If this method returns
false, it indicates to the Java Card runtime environment that this applet instance declines to be selected.
Note:
javacard.framework.Applet.select(
) method is not
called if this method is invoked.
deselect
in interface MultiSelectable
appInstStillSelected
- boolean flag is true
when the same applet instance
is still active on another logical channel and false
otherwisepublic void process(APDU apdu)
Applet
Upon normal return from this
method the Java Card runtime environment sends the ISO 7816-4 defined success status (90 00) in APDU response.
If this method throws an ISOException
the Java Card runtime environment sends the associated reason code as the
response status instead.
The Java Card runtime environment zeroes out the APDU buffer before receiving a new APDU command from the CAD. The five header bytes of the APDU command are available in APDU buffer[0..4] at the time this method is called.
The APDU
object parameter is a temporary Java Card runtime environment Entry Point Object.
A temporary Java Card runtime environment Entry Point Object can be accessed from any applet context. References
to these temporary objects cannot be stored in class variables or instance variables
or array components.
Notes:
APDU.setIncomingAndReceive()
method if incoming data is expected. Altering
the APDU buffer[5..] could corrupt incoming data.
process
in class Applet
apdu
- the incoming APDU
objectAPDU
public static AccountAccessor getAccount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |