Sun Microsystems 2 Wireless Office Headset User Manual


 
Chapter 1 Introduction 3
Robustness
In addition to providing the multitasking that users want, tasks have the following
benefits:
Fault containment - If a Java application crashes, then any problems caused by
this crash are limited to the task. Applications running in other tasks are
unaffected.
Clean termination - When a Java application exits, it leaves the virtual machine
in a consistent state. In the past, some have tried to run multiple Java applications
in a single process by running the applications in separate threads within a single
virtual machine. When applications share a virtual machine, it is impossible to
guarantee that an application can exit cleanly, because objects might be left in an
inconsistent state. In contrast, tasks can and do terminate cleanly.
Note that in MIDP, a Java application is a MIDlet suite. A MIDlet suite is one or
more MIDlets in the same Java Archive (JAR) file. Each MIDlet suite, then, runs in its
own task. The user interacts with one of the MIDlets in the MIDlet suite.
Mechanisms Compared With Policies
Mechanisms are actions that the system carries out, such as starting, pausing, and
stopping a MIDlet. Policies are the system-wide decisions that device manufacturers
and service providers make about when and how to use the available mechanisms.
Policies take generic mechanisms and combine them into a predictable set of system
behaviors.
The Java Wireless Client software provides both the necessary mechanisms for a
complete application environment, such as mechanisms for managing competition
for limited shared resources, and a default set of policies. For example, memory is a
limited shared resource for which the Java Wireless Client software provides
mechanisms and a few default policies. The mechanism is the allocation of heap
memory. One default policy is to allow the applications to compete for available
heap memory.
The default policies are useful, but device manufacturers and service providers are
likely to need to tailor policies to their particular platforms. Devices of different
capabilities might use different policies. Devices with different user interface styles
might use different policies so that their Java applications interact with users in
ways that match the native applications interactions. Because policy decisions are
often intertwined with user interface style and user model decisions, the Java
Wireless Client software enables the development of alternative policies.