|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.licel.jcardsim.base.SimulatorSystem
public class SimulatorSystem
Base implementation of JCSystem
JCsystem
Field Summary | |
---|---|
static byte |
currentChannel
|
static NullPointerException |
nullPointerException
|
static Object |
previousActiveObject
|
static SecurityException |
securityException
|
static short |
SW_APPLET_CRATION_FAILED
Response status : Applet creation failed = 0x6444 |
static short |
SW_EXCEPTION_OCCURED
Response status : Exception occured = 0x6424 |
Method Summary | |
---|---|
static void |
abortTransaction()
Aborts the atomic transaction. |
static void |
beginTransaction()
Begins an atomic transaction. |
static void |
commitTransaction()
Commits an atomic transaction. |
static AID |
getAID()
Returns the Java Card runtime environment-owned instance of the AID object associated with
the current applet context, or
null if the Applet.register() method
has not yet been invoked. |
static short |
getAvailablePersistentMemory()
Current method implementation returns 32767. |
static short |
getAvailableTransientDeselectMemory()
Current method implementation returns 32767. |
static short |
getAvailableTransientResetMemory()
Current method implementation returns 32767. |
static byte |
getCurrentlySelectedChannel()
|
static short |
getJavaContext(Object obj)
|
static Object |
getJavaOwner(Object obj)
|
static short |
getMaxCommitCapacity()
Returns the total number of bytes in the commit buffer. |
static AID |
getPreviousContextAID()
Obtains the Java Card runtime environment-owned instance of the AID object associated
with the previously active applet context. |
static Shareable |
getSharedObject(AID serverAID,
byte parameter)
Called by a client applet to get a server applet's shareable interface object. |
static byte |
getTransactionDepth()
Returns the current transaction nesting depth level. |
static short |
getUnusedCommitCapacity()
Returns the number of bytes left in the commit buffer. |
static boolean |
isAppletActive(AID theApplet)
This method is used to determine if the specified applet is active on the card. |
static boolean |
isAppletSelecting(Applet aThis)
|
static boolean |
isObjectDeletionSupported()
Alway return false |
static byte |
isTransient(Object theObj)
Checks if the specified object is transient. |
static AID |
lookupAID(byte[] buffer,
short offset,
byte length)
Returns the Java Card runtime environment-owned instance of the AID object, if any,
encapsulating the specified AID bytes in the buffer parameter
if there exists a successfully installed applet on the card whose instance AID
exactly matches that of the specified AID bytes. |
static boolean[] |
makeTransientBooleanArray(short length,
byte event)
Creates a transient boolean array with the specified array length. |
static byte[] |
makeTransientByteArray(short length,
byte event)
Creates a transient byte array with the specified array length. |
static Object[] |
makeTransientObjectArray(short length,
byte event)
Creates a transient array of Object with the specified array length. |
static short[] |
makeTransientShortArray(short length,
byte event)
Creates a transient short array with the specified array length. |
static void |
registerApplet(Applet applet)
This method is used by the applet to register this applet instance with
the Java Card runtime environment and to
assign the Java Card platform name of the applet as its instance AID bytes. |
static void |
registerApplet(Applet applet,
byte[] bArray,
short bOffset,
byte bLength)
This method is used by the applet to register this applet instance with the Java Card runtime environment and
assign the specified AID bytes as its instance AID bytes. |
static void |
requestObjectDeletion()
Always throw SystemException.ILLEGAL_USE |
static void |
resetRuntime()
|
static void |
sendAPDU(byte[] buffer,
short bOff,
short len)
|
static void |
setJavaOwner(Object obj,
Object owner)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short SW_APPLET_CRATION_FAILED
public static final short SW_EXCEPTION_OCCURED
public static byte currentChannel
public static Object previousActiveObject
public static NullPointerException nullPointerException
public static SecurityException securityException
Method Detail |
---|
public static byte isTransient(Object theObj)
Note:
NOT_A_TRANSIENT_OBJECT
if the specified object is
null
or is not an array type.
theObj
- the object being queried
NOT_A_TRANSIENT_OBJECT
, CLEAR_ON_RESET
, or CLEAR_ON_DESELECT
makeTransientBooleanArray(short, byte)
,
#makeByteArray(short, byte)
,
#makeObjectArray(short, byte)
,
#makeShortArray(short, byte)
public static boolean[] makeTransientBooleanArray(short length, byte event)
length
- the length of the boolean arrayevent
- the CLEAR_ON...
event which causes the array elements to be cleared
NegativeArraySizeException
- if the length
parameter is negative
SystemException
- with the following reason codes:
SystemException.ILLEGAL_VALUE
if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE
if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT
if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT
is specified.
public static byte[] makeTransientByteArray(short length, byte event)
length
- the length of the byte arrayevent
- the CLEAR_ON...
event which causes the array elements to be cleared
NegativeArraySizeException
- if the length
parameter is negative
SystemException
- with the following reason codes:
SystemException.ILLEGAL_VALUE
if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE
if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT
if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT
is specified.
public static short[] makeTransientShortArray(short length, byte event)
length
- the length of the short arrayevent
- the CLEAR_ON...
event which causes the array elements to be cleared
NegativeArraySizeException
- if the length
parameter is negative
SystemException
- with the following reason codes:
SystemException.ILLEGAL_VALUE
if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE
if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT
if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT
is specified.
public static Object[] makeTransientObjectArray(short length, byte event)
Object
with the specified array length.
length
- the length of the Object arrayevent
- the CLEAR_ON...
event which causes the array elements to be cleared
NegativeArraySizeException
- if the length
parameter is negative
SystemException
- with the following reason codes:
SystemException.ILLEGAL_VALUE
if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE
if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT
if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT
is specified.
public static AID getAID()
AID
object associated with
the current applet context, or
null
if the Applet.register()
method
has not yet been invoked.
Java Card runtime environment-owned instances of AID
are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
AID
objectpublic static AID lookupAID(byte[] buffer, short offset, byte length)
AID
object, if any,
encapsulating the specified AID bytes in the buffer
parameter
if there exists a successfully installed applet on the card whose instance AID
exactly matches that of the specified AID bytes.
Java Card runtime environment-owned instances of AID
are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
buffer
- byte array containing the AID bytesoffset
- offset within buffer where AID bytes beginlength
- length of AID bytes in buffer
AID
object, if any; null
otherwise. A VM exception
is thrown if buffer
is null
,
or if offset
or length
are out of range.public static void beginTransaction()
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
TransactionException
- with the following reason codes:
TransactionException.IN_PROGRESS
if a transaction is already in progress.
abortTransaction()
,
commitTransaction()
public static void abortTransaction()
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
null
reference.
TransactionException
- - with the following reason codes:
TransactionException.NOT_IN_PROGRESS
if a transaction is not in progress.
beginTransaction()
,
commitTransaction()
public static void commitTransaction()
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
TransactionException
- ith the following reason codes:
TransactionException.NOT_IN_PROGRESS
if a transaction is not in progress.
beginTransaction()
,
abortTransaction()
public static byte getTransactionDepth()
public static short getUnusedCommitCapacity()
Note:
getMaxCommitCapacity()
public static short getMaxCommitCapacity()
Note:
getUnusedCommitCapacity()
public static AID getPreviousContextAID()
AID
object associated
with the previously active applet context. This method is typically used by a server applet,
while executing a shareable interface method to determine the identity of its client and
thereby control access privileges.
Java Card runtime environment-owned instances of AID
are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
AID
object of the previous context, or null
if Java Card runtime environmentpublic static short getAvailablePersistentMemory()
public static short getAvailableTransientResetMemory()
public static short getAvailableTransientDeselectMemory()
public static Shareable getSharedObject(AID serverAID, byte parameter)
This method returns null
if:
Applet.register()
has not yet been invokednull
serverAID
- the AID of the server appletparameter
- optional parameter data
null
Applet.getShareableInterfaceObject(AID, byte)
public static boolean isObjectDeletionSupported()
public static void requestObjectDeletion()
public static byte getCurrentlySelectedChannel()
public static boolean isAppletActive(AID theApplet)
Note:
false
if the specified applet is
not active, even if its context is active.
theApplet
- the AID of the applet object being queried
true
if and only if the applet specified by the
AID parameter is currently active on this or another logical channelpublic static void sendAPDU(byte[] buffer, short bOff, short len)
public static void registerApplet(Applet applet) throws SystemException
this
applet instance with
the Java Card runtime environment and to
assign the Java Card platform name of the applet as its instance AID bytes.
One of the register()
methods must be called from within install()
to be registered with the Java Card runtime environment.
See Runtime Environment Specification for the Java Card Platform, section 3.1 for details.
Note:
AID[AID_length]
item in the applets[]
item of the applet_component
, as documented in Section 6.5
Applet Component in the Virtual Machine Specification for the Java Card Platform.
SystemException
- with the following reason codes:SystemException.ILLEGAL_AID
if the Applet
subclass AID bytes are in use or
if the applet instance has previously successfully registered with the Java Card runtime environment via one of the
register()
methods or if a Java Card runtime environment initiated install()
method execution is not in progress.
public static void registerApplet(Applet applet, byte[] bArray, short bOffset, byte bLength) throws SystemException
this
applet instance with the Java Card runtime environment and
assign the specified AID bytes as its instance AID bytes.
One of the register()
methods must be called from within install()
to be registered with the Java Card runtime environment.
See Runtime Environment Specification for the Java Card Platform, section 3.1 for details.
Note:
SystemException
public static boolean isAppletSelecting(Applet aThis)
public static void resetRuntime()
public static void setJavaOwner(Object obj, Object owner)
public static Object getJavaOwner(Object obj)
public static short getJavaContext(Object obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |