Java Reference
In-Depth Information
are not required to instruct loading of libraries. At build time, tables
that map Java native methods to their C counterparts are built and
all the linkage is done statically. No dynamic lookup is performed
at run time and only pre-built native functions can be invoked by
the VM.
10.4.3 Garbage Collection and Internal Finalization
There are various relatively small mechanisms that are built as extensions
to the supplied Configuration. Although small in size and complexity, they
are nevertheless quite important for internal implementation or proper
execution of the run-time process. For example, the Configuration should
be extended with a mechanism that ensures that all native resources are
freed before the owning Java object is reclaimed by the garbage collector
(GC). An internal mechanism of Object , finalization, was introduced
which ensures that native resources are still released even when applica-
tion code has not properly released them. This is a simple mechanism in
which instances of internal system classes register themselves for internal
object finalization. When memory is reclaimed by the GC, every object
that is not referenced any more and was registered for finalization can
release native resources by executing an internal finalization method. This
is a simple mechanism indeed, but highly important to free up acquired
resources to allow other multitasking applications or system processes to
acquire these resources.
10.5 MIDP Implementation Layer
The MIDP layer is implemented by Symbian OS and is integrated on top
of the Configuration and the VM to provide a full run-time environment
for Java applications.
Since the VM is a headless engine which can execute Java bytecode
but has no notion of applications, the initialization of the Java ME run-
time environment is performed at the MIDP layer. Upon launching of the
VM by SystemAMS, it is given a class name whose static main function
is the first Java code to be executed. The main class loaded into the
Java ME subsystem is the system class that initializes the MIDP run-time
environment. It instantiates all required system classes and resources,
initializes them and, when the environment is finally ready, it triggers the
lifecycle sequence of the launched MIDlet.
The MIDP layer comprises various MIDP components; each is typi-
cally a JSR implementation. A JSR implementation can be a pure Java
implementation e.g., JSR-172 Web Services, or it can be a mix of Java
code and native code which uses the native Symbian OS services. In the
Search WWH ::




Custom Search