Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcre:2._lifetime_of_the_java_card_virtual_machine

2. Lifetime of the Java Card Virtual Machine

In a PC or workstation, the Java virtual machine<SUP>[1]</SUP> runs as an operating system process. When the OS process is terminated, the Java programming language applications and their objects are automatically destroyed.

In Java Card technology, the execution lifetime of the virtual machine (VM) is the lifetime of the card. Most of the information stored on a card shall be preserved even when power is removed from the card. Persistent memory technology (such as EEPROM) enables a smart card to store information when power is removed. Because the VM and the objects created on the card are used to represent application information that is persistent, the Java Card VM appears to run forever. When power is removed, the VM only stops temporarily. When the card is next reset, the VM starts again and recovers its previous object heap from persistent storage.

Aside from its persistent nature, the Java Card virtual machine is just like the Java virtual machine.

The card initialization time is the time after masking, and prior to the time of card personalization and issuance. At the time of card initialization, the Java Card RE is initialized. The framework objects created by the Java Card RE exist for the lifetime of the virtual machine. Because the execution lifetime of the virtual machine and the Java Card RE framework span Card Acceptance Device (CAD or card reader) sessions of the card, the lifetimes of objects created by applets also span CAD sessions. Objects that have this property are called persistent objects. Card sessions are those periods when the card is inserted into the CAD, powered up, and exchanging streams of APDUs with the CAD. The card session ends when the card is removed from the CAD.

Note - The acronym CAD is used here and throughout this specification to refer to both types of card readers - the conventional Card Acceptance Device (CAD) for contacted I/O interfaces and the Proximity Coupling Device (PCD) for contactless interfaces.

The Java Card RE implementer shall make an object persistent when:

  • The Applet.register method is called. The Java Card RE stores a reference to the instance of the applet object. The Java Card RE implementer shall ensure that instances of class applet are persistent.
  • A reference to an object is stored in a field of any other persistent object or in a class's static field. This requirement stems from the need to preserve the integrity of the Java Card RE's internal data structures.

Copyright &#169; 2005, Sun Microsystems, Inc. All Rights Reserved.

javacard/jcre/2._lifetime_of_the_java_card_virtual_machine.txt · Last modified: 2017/05/13 04:08 (external edit)