International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

Motivating The Class Concept Runtime Environment in Lan- guage for Reliability Services and Ability Interface {T.Gopinath, A.Satish Kumar, P.Rajesh Kumar}

Abstract: C and C++ but is organized rather differently, with a The most java is one of the popular programming number of aspects of and C++ omitted and a few architectures because of its platform-independence. ideas from other languages included. It is intended to be a production language, not a research language. A monitoring infrastructure is a key component in The Java programming language is strongly typed. each task aimed at evaluating the dependability of a This specification clearly distinguishes between the starting be employed in mission and safety critical compile-time errors that can and must be detected at application, often with real time requirements. This compile time, and those that occur at run time. Com- infrastructure, named JVM on, collects data about pile time normally consists of translating programs both the state and the failures of the monitored Vir- into a machine-independent byte code representation. tual Machine. The state of the JVM was defined ac- Run time activities include loading and linking of the cording to the specification. classes needed to execute a program, optional ma- JVM on is constituted by three components: a moni- chine code generation and dynamic optimization of toring agent which collects data from on it order the program and actual program execution. The Hot JVM; a local monitor daemon that receives data from Spot VM is the garbage collector that comes with the such an agent and updates the state of the JVM; a Java Soft virtual machine. Its specification is deli- data collector, which stores events and state snap- vered to all JVM providers (HP, IBM, BEA, etc.) and the standard implementation is deployed by Java Soft shots in a database. The impact on the performance on Solaris, Windows and LINUX. of the JVM has been evaluated running the SPEC JVM98 benchmark suite. This paper describes re- search in the use of Java as J2SE, J2EE and J2ME 1.1 JVM Architecture in Java virtual machine to develop cross platform computer In the Java virtual machine specification, the beha- vision applications. J2ME is powerful competitor of viour of a virtual machine instance is described in mobile operating system and drawn the attention of terms of subsystems, memory areas, data types, and IJERTIJERTinstructions. These components describe an abstract the leading manufacturers of the industry and be- inner architecture for the abstract Java virtual ma- came a hot spot of research. As it adopts the virtual chine. The purpose of these components is not so machine Dalvik which is different from SUN Java much to dictate an inner architecture for implementa- and its Java application developing framework. The tions. It is more to provide a way to strictly define the paper on takes the transplant of J2SE, J2EE applica- external behavior of implementations. The specifica- tion virtual machine’s process with extension on tion defines the required behavior of any Java virtual J2ME applications process. The java experiments machine implementation in terms of these abstract conducted to evaluate the compatibility, portability components and their interactions. Figure shows a and efficiency of our library. block diagram of the Java virtual machine that in- cludes the major subsystems and memory areas de- Key words: Mobile mapping applications, J2ME scribed in the specification. each Java virtual ma- MIDP, Connected, Limited Device Configuration chine has a class loader subsystem: a mechanism for (CLDC), Connected Device Configuration (CDC), loading types (classes and interfaces) given fully Mobile Information Device Profile (MIDP), Kilo qualified names. Each Java virtual machine also has Virtual Machine (KVM), card Virtual Machine an execution engine: a mechanism responsible for executing the instructions contained in the methods (CDC). of loaded classes. A complete Java technology stack 1. Introduction: exists today to support embedded devices such as mobile phones. The stack is based on the Java 2 Plat- The Java™ programming language is a general- form, Micro Edition (J2ME™), and includes layers purpose, concurrent, class based, Object oriented from the Java virtual machine to GUI support . These language. It is designed to be simple enough that devices are characterized as small, battery-powered many programmer scan achieve fluency in the lan- devices with limited, wireless connection to the In- guage. The Java programming language is related to

IJERTV2IS110753 www.ijert.org 2345 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

ternet. J2ME defines configurations and profiles, information it extracts from loaded class files, objects which, in combination with a Java virtual machine, the program instantiates, parameters to methods, re- make up the Java technology stack. A configuration turn values, local variables, and intermediate results of J2ME includes a Java virtual machine, as well as of computations. The Java virtual machine organizes the Java programming language libraries that are re- the memory it needs to execute a program into sever- quired as the lowest common denominator of a range al runtime data areas. Although the same runtime of embedded devices. A profile is a layer on top of data areas exist in some form in every Java virtual the configuration that provides additional APIs for a machine implementation, their specification is quite specific class of devices. A particular combination of abstract. Many decisions about the structural details configuration and profile is appropriate only for spe- of the runtime data areas are left to the designers of cific Java virtual machines. J2ME fits in with the individual implementations. Different implementa- other editions of Java, J2SE and J2EE, as illustrated tions of the virtual machine can have very different in FIGURE 1.1 Up to now, small, battery-powered memory constraints. Some implementations may devices are the domain of the KVM and the Mobile have a lot of memory in which to work, others may Information Device Profile (MIDP), also shown. have very little. Some implementations may be able to take advantage of virtual memory, others may not. The abstract nature of the specification of the runtime data areas helps make it easier to implement the Java virtual machine on a wide variety of computers and devices. Some runtime data areas are shared among all of an application's threads and others are unique to individual threads. Each instance of the Java virtual machine has one method area and one heap. These areas are shared by all threads running inside the vir- tual machine. When the virtual machine loads a class file, it parses information about a type from the bi- nary data contained in the class file. It places this type information into the method area. As the pro- gram runs, the virtual machine places all objects the Figure 1.1: Java complete architecture program instantiates onto the heap. See Figure 2.1 for a graphical depiction of these memory areas. CLDC hotspot Implementation is now poised to takeIJERT IJERT the place of the KVM as the high-performance Java 2.2 Runtime data areas shared among all virtual machine for the next generation of embedded threads: devices. Java programming language

2. J2SE and J2EE JVM:

2.1 The internal architecture of the Java virtual machine

Figure: 2.2 Runtime data areas shared among all threads

As each new thread comes into existence, it gets its own pc register (program counter) and Java stack. If the thread is executing a Java method (not a native Figure: 2.1 The internal architecture of the Java vir- method), the value of the pc register indicates the tual machine. In java we have Four Components next instruction to execute. A thread's Java stack (technologies) they are given bellow When a Java stores the state of Java (not native) method invoca- virtual machine runs a program, it needs memory to tions for the thread. The state of a Java method invo- store many things, including byte codes and other cation includes its local variables, the parameters

IJERTV2IS110753 www.ijert.org 2346 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

with which it was invoked, its return value (if any), network connections. These include mobile phones, and intermediate calculations. The state of native pagers, wireless devices and set-top boxes among method invocations is stored in an implementation- other technology has evolved from a programming dependent way in native method stacks, as well as language designed to create machine-independent possibly in registers or other implementation- embedded systems into a robust, vendor-independent, dependent memory areas. machine-independent, server-side technology, enabl- The Java stack is composed of stack frames (or ing the corporate community to realize the full poten- frames). A stack frame contains the state of one Java tial of web-centric applications. Java began with the method invocation. When a thread invokes a method, release of the (JDK). It was the Java virtual machine pushes a new frame onto obvious from the start that Java was on a fast track to that thread's Java stack. When the method completes, becoming a solution to the problems of many corpo- the virtual machine pops and discards the frame for rate systems. More interface and libraries were ex- that method. The Java virtual machine has no regis- tended in the JDK as the corporate world de- ters to hold intermediate data values. The instruction manded—and received—application programming set uses the Java stack for storage of intermediate interfaces (API) that addressed real-world situations. data values. This approach was taken by Java's de- JDK API extensions fully integrated into the JDK signers to keep the Java virtual machine's instruction with the release of the Java 2 Standard Edition (J2SE) set compact and to facilitate implementation on archi- of the JDK. J2SE contains all the APIs needed to tectures with few or irregular general purpose regis- build industrial strength Java applications. However, ters. In addition, the stack-based architecture of the the corporate world felt J2SE lacked the strength re- Java virtual machine's instruction set facilitates the quired for developing enterprise-wide applications code optimization work done by just-in-time and and for servicing the needs of developers of mobile dynamic compilers that operate at run-time in some and embedded systems .Again the corporate commu- virtual machine implementations. nity pushed , Inc. to revise Java See Figure 2.3 for a graphical depiction of the mem- technology to address needs of an enterprise. Sun ory areas the Java virtual machine creates for each Microsystems, Inc. then launched the Java Communi- thread. These areas are private to the owning thread. ty Program (JCP) that brought together corporate No thread can access the pc register or Java stack of users, vendors, and technologists to develop a stan- another thread. dard for enterprise Java API’s Java 2 Platform Enter- prise Edition, commonly referred to as Java 2 Enter- prise Edition(J2EE), and the Java 2 Micro Edition IJERTIJERT(J2ME).

3.1 What’s inside J2ME application development divided into these five parts: ■ Part I: J2ME Basics ■ Part II: J2ME User Interface ■ Part III: J2ME Data Management ■ Part IV: J2ME Personal Information Manager Pro- file ■ Part V: J2ME Networking and Web Services

Figure 2.3 for a graphical depiction of the memory areas

3. J2ME JVM J2ME stands for Java 2, Micro Edition. It is a stripped-down version of Java targeted at devices which have limited processing power and storage capabilities and intermittent or fairly low-bandwidth

IJERTV2IS110753 www.ijert.org 2347 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

you’ll learn database concepts of the J2ME user in- terface. Part I: J2ME Basics Part III: J2ME Data Management At the center of The new web-centric corporation is changing the way nearly every J2ME application is a repository of in- in which it delivers highly efficient, enterprise-wide formation that is accessed and manipulated by both distributive systems to meet the round-the-clock in- service-side components, such as Web services, and stantaneous demand expected by thousands of con- client-side applications. A repository is a database current users—anywhere at any time. The old way of management system that stores, retrieves, and main- building enterprise systems won’t solve today’s cor- tains the integrity of information stored in its data- porate IT requirements Technologists at Sun Micro- bases A J2ME application uses Java data objects, systems, Inc. and the Java Community Program re- JDBC, and other technology that is necessary to inte- wrote the way developers build large-scale, web- ract with a database management system to provide centric distributive systems by using Java 2 Enter- information to the J2ME application. In Part III prise Edition (J2EE), and Java 2 Micro Edition you’ll learn database concepts in relation to Java data (J2ME). J2EE addresses complex server-side issues objects. You’ll also explore the details of JDBC, faced by programmers who develop these systems which is used to connect to and interact with popu- while J2ME addresses the need to create mobile and lar— and some not so popular—database manage- embedded components that makes these systems ac- ment systems. And you’ll also learn how to create cessible from other than the desktop. Part I of this and send requests for information and integrate the book introduces you to basic concepts used in J2ME results of a request into your J2ME application. technology and in Web services technology. These Part IV: J2ME Personal Information Manager Profile concepts focus on four areas of interest, beginning Many corporations have practically made PDAs the with an overview of J2ME that defines J2ME and de facto standard as a mobile communicator, espe- illustrates J2ME’s role in the evolutionary process of cially since PDA and cell phone technologies have computer programming. The next area of interest merged, causing a blur between PDAs and cell examines the J2ME architecture. It is here where you phones. That is, a PDA can be used as a cell phone roll up your sleeves and get your hands into the guts and cell phones have incorporated PDA applications. of J2ME to investigate how J2ME works within the Until recently, J2ME applications lacked the capabili- Web services infrastructure. At first glance, you ty to interact with native PDA databases such as might feel overwhelmed by the power of J2ME. those used to store calendar, to-do list, and address However, that feeling is short-lived because the third information. The released a area of interest in Part I discuss J2ME best practices,IJERT IJERTnew Personal Information Manager (PIM) API, showing you commonly used design principles used which is used to develop sophisticated J2ME applica- by J2ME programmers to build advanced J2ME Web tions. This enables J2ME applications to interact with centric distributive systems. Part I concludes with a the J2ME device’s personal information database, look at J2ME design patterns used to solve common which is used by the device’s address book, notepad, Programming problems that crop up during the de- and calendar applications. In Part IV of this book velopment of a J2ME application. you’ll explore this API and learn how to implement it in your J2ME application. Part II: J2ME User Interface Part V: J2ME Networking and Web Services The Nearly every J2ME application that you develop re- glue that enables J2ME applications to interact with quires a way for a user to interact with it unless the external applications, including server-side compo- application is an embedded closed system. An em- nents, is networking capabilities. In Part V you’ll bedded closed system such as those that control an learn how to implement routines that take advantage automobile’s engine doesn’t require input from the of a J2ME device’s network features to open com- user but instead receives input from electro- munications with other applications using a hard-wire mechanical devices. Abuser interface for a J2ME or wireless network connection. You’ll also learn application is similar to yet different from a user in- how to utilize Web services to expand the horizon of terface that you find on a desktop application. They your J2ME application. Web services are a web of are similar in that both display options available to services where services are software building blocks the user and then receive and process the option se- that are available on a network from which pro- lected by the user. grammers can efficiently create large-scale distribu- However, a J2ME user interface is less sophisticated tive systems. You won’t learn how to create Web than those found on a desktop application because of services, but you will learn how to utilize them to the limited resources (i.e., screen size) that are avail- increase the functionality of your J2ME application able on a J2ME device (i.e., cellular phone). In Part II beyond the limited resources found on a J2ME de-

IJERTV2IS110753 www.ijert.org 2348 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

vice. In Part V, you’ll also learn about Service Method Invocation classes to the core classes con- Oriented Architecture Protocol SOAP), Universal tained in the Foundation Profile. Description, Discovery, and Web Services Descrip- tion Language (WSDL), and how to implement them 4. J2ME Configuration? in your J2ME application. A configuration defines the minimum Java technolo- gy that an application developer can expect on a 3.2 J2ME Profiles broad range of implementing devices. A profile consists of Java classes that enable imple- mentation of features for either a particular small J2ME Connected, Limited Device Configuration computing device or for a class of small computing (CLDC) devices. Small computing technology continues to . specifies the Java environment for mobile phone, evolve, and with that, there is an ongoing process of pager and wireless devices defining J2ME profiles. Seven profiles have been . CLDC devices are usually wireless defined as of this writing. These are the Foundation . 160 - 512k of memory available for Java Profile, Game Profile, Mobile Information Device . typically has limited power or battery operated Profile, PDA Profile, Personal Profile, Personal Basis . network connectivity, often wireless, intermit- Profile, and RMI Profile. tent, low-bandwidth (9600bps or less)

■ The Foundation Profile is used with the CDC J2ME Connected Device Configuration (CDC) configuration and is the core for nearly all other pro- . Describes the Java environment for digital tele- files used with the CDC configuration because the vision set-top boxes, high end wireless devices Foundation Profile contains core Java classes. and automotive telemetric systems. ■ The Game Profile is also used with the CDC con- . device is powered by a 32-bit processor figuration and contains the necessary classes for de- . 2MB or more of total memory available for Java veloping game applications for any small computing . network connectivity, often wireless, intermit- device that uses the CDC configuration. tent, low-bandwidth (9600bps or less) ■ The Mobile Information Device Profile (MIDP) These two configurations differ only in their respec- is used with the CLDC configuration and contains tive memory and display capabilities. classes that provide local storage, a user interface, J2ME Profile and networking capabilities to an application that A specification layer above the configuration which runs on a mobile computing describes the Java configuration for a specific vertical device such as Palm OS devices. MIDP is used withIJERT IJERTmarket or device type. wireless Java applications. J2ME Profiles ■ The PDA Profile (PDAP) is used with the CLDC J2ME Mobile Information Device Profile (MIDP) configuration and contains classes that utilize sophis- ticated resources found on personal digital assistants. . this is the application environment for wire- These features include better displays and larger less devices based on the CLDC memory than similar resources found on MIDP mo- . contains classes for user interface, storage bile devices (such as cell phones). and networking ■ The Personal Profile is used with the CDC confi- guration and the Foundation Profile and contains classes to implement a complex user interface. The Foundation Profile provides core classes, and the Personal Profiles provide classes to implement a so- J2ME Foundation Profile, Personal Basis, Person- phisticated user interface, which is a user interface al and RMI profiles that is capable of displaying . these are profiles for devices based on the CDC, multiple windows at a time. which are not addressed in this tutorial ■ The Personal Basis Profile is similar to the Per- 4.1 Virtual Machines sonal Profile in that it is used with the CDC configu- The CLDC and the CDC each require their own vir- ration and the Foundation Profile. However, the Per- tual machine because of their different memory and sonal Basis Profile provides classes to implement a display capabilities. The CLDC virtual machine is far simple user interface, which is a user interface that is smaller than that required by the CDC and supports capable of displaying one window at a time. less features. The virtual machine for the CLDC is ■ The RMI Profile is used with the CDC configura- called the Kilo (Kubai) Virtual Machine (KVM) and tion and the Foundation Profile to provide Remote the virtual machine for the CDC is called the CVM.

IJERTV2IS110753 www.ijert.org 2349 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

4.2 KVM 2-16 MB, most often using TCP/IP Personal, mobile, Everything will be connected to the Internet Custo- connected information devices (represented by mizable, Personal Services by downloading new ser- CLDC): memory budget: about 128KB, low band- vices and applications from the internet currently, width, intermittent network connections, often not interactive games, banking and ticketing applications based on TCP/IP

Figure : 4.2 Downloading customized services

Figure : 4.2.2 Java 2 edition target editions Technology that enables this: Java2 Platform Micro Edition Configurations and Profiles Three layers of software built upon the Host Operat- 4.3 J2ME Building Blocks Configuration ing System of the device: Defines a minimum platform for a horizontal catego- 4.2.1 JVM Layer ry or grouping of devices, each with similar require- Configuration Layer ments on a total memory budget and processing pow- Profile Layer er. Profile

Is layered on top of a configuration. It addresses the IJERTIJERTspecific demands of a certain vertical device family. It guarantees interoperability within a family or do- main White Paper from Sun.com

Figure: 4.3 relationship between J2ME configuration and J2SE KVM is a compact, portable JVM intended for small,

resource-constrained devices such as cell phones, Figure : 4.2.1 J2ME software layer stack pagers, etc. J2ME keeps key features of Java Technology The high-level design goal for KVM was to create Built-in consistency: run anywhere, any time, on any the smallest possible complete JVM that would main- device tain all the central aspects of the Java programming High-level OOP language, and that would nevertheless run in a re- Portability of code source-constrained device with only a few tens or Safe network delivery hundreds of KB of available memory (hence the Upward scalability with J2SE and J2EE 2 broad cat- name K, for Kilobytes egories of products Shared, fixed, connected informa- tion devices (represented by CDC): Memory budget: CLDC hotspot Implementation is a pure 32 bit virtual machine. This provides a large address space and

IJERTV2IS110753 www.ijert.org 2350 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

scalable architecture well-suited for mid- to high-end fast byte code execution. A well-known problem with mobile phones. It is especially suited for the emerg- compiling byte codes into native instructions is that ing 2.5G and next generation mobile phones, which the generated code takes up four to eight times as typically have larger memory capacity. much space as the original byte codes. Adaptive Compact Object Layout CLDC HotSpot Implementa- compilation alleviates this problem by only compil- tion supports a compact object layout to reduce gen- ing methods that are recognized as ―hotspots‖, i.e., eral memory consumption. A Java object has two the most frequently used parts of the application. The parts. The first part is the object header, which pro- CLDC HotSpot Implementation dynamic compiler vides reflective information and contains hash code finds the hotspot by running a statistical profiler. To and locking status. The second part is the object minimize the amount of compiled code, the CLDC body, containing the object fields. Most other virtual HotSpot Implementation virtual machine includes an machines use at least two words for the object head- optimized interpreter used for infrequently executed er’s however, since the average object size is small, methods. The CLDC HotSpot Implementation com- object headers take up a big fraction of the total piler is a simple one-pass compiler that utilizes the object space. CLDC HotSpot Implementation intro- following basic optimizations: constant folding, con- duces a new design, in which only one word is stant propagation, loop peeling. The components of needed for the object header. In addition to reducing the CLDC HotSpot Implementation virtual machine memory usage, object allocation becomes faster. Uni- are shown in FIGURE 4.4 fied Resource Management A major benefit of CLDC HotSpot Implementation is unified resource man- agement. This means that all allocated data resides inside the object heap. Allocated data includes:

• Java level objects, • Reflective objects, such as methods and classes, • Compiler generated code, and Figure :4.4 execute engine • Virtual machine internal data structures. Fast Thread Synchronization The Java programming An important advantage of this unification is that the language provides language-level thread synchroni- same garbage collector takes care of cleaning up all zation, which makes it easy to express multi-threaded allocated resources, even compiled code. Almost t allIJERT IJERTprograms with fine-grained locking. other virtual machines have designated areas for user CLDC HotSpot Implementation uses a variant of the objects, reflective data, temporary data and generated block structured locking mechanism developed for code. Such a scheme results in memory fragmenta- the HotSpot virtual machine. As a result, synchroni- tion, multiple cleanup strategies and other complexi- zation performance becomes so fast that it is no long- ties. CLDC HotSpot Implementation solves these er a performance bottleneck for Java programs. issues by using the mark-sweep-compact garbage collector for everything. Another benefit of unified 5. CVM resource management is that compiled code can be A Java runtime environment is an implementation of removed dynamically to free up space for user-level Java technology for a specific target platform. It per- objects. The CLDC HotSpot Implementation Gar- forms a middleware function with features common bage Collector A garbage collector automatically to a native application: it is installed, launched and reclaims unused object memory and makes the freed run like a native application. But its real purpose is to memory available for new allocations. CLDC HotS- launch, run and manage Java application software on pot Implementation uses an accurate generational the target platform. mark-sweep-compact garbage collector, which results The Connected Device Configuration (CDC) Java in: runtime environment is an implementation of Java • Fast object allocation technology for connected devices. These include mo- • Small garbage collection pauses bile devices like PDAs and smartphones as well as • No memory fragmentation attached devices like set-top boxes, printers and 4.4 Execution Engine kiosks. CDC target devices can vary widely based on In general, Java virtual machines with a compiler are their features and purpose. FIGURE 1-1 describes an order of magnitude faster than those with only an some CDC target device categories and organizes interpreter. For that reason, CLDC HotSpot Imple- them by their two most important characteristics: mentation includes a dynamic compiler to provide

IJERTV2IS110753 www.ijert.org 2351 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

purpose (fixed or general) and mobility (mobile or ■When an application is complete and tested, it’s attached). ready for deployment. CDC provides a number of deployment mechanisms including preloading with Java Code Compact, managed application models like applets and xlets and network-based provisioning systems. 5.1 CDC Target Device Requirements CDC is an adaptable technology that can support a range of connected target devices that exist today and in the future. The baseline system requirements of these connected devices are the following: ■Network connectivity ■32-bit RISC-based microprocessor Figure 5: JVM architecture in J2ME The memory requirements for a CDC Java runtime environment vary based on the native platform, the This runtime guide describes how to use the CDC profile and optional packages and the application. Java runtime environment for different purposes in- See Section 4.4, ―Memory Management‖ on page 4-7 cluding application development, runtime develop- for memory usage guidelines. ment and solution deployment. Other features of the CDC target device can include: This chapter briefly introduces the CDC Java runtime ■a display for a graphical user interface (GUI) environment through the following: ■Unicode font support ■Goals ■an open or proprietary native platform that provides ■Usage Contexts operating system services ■CDC Technology Implementations ■CDC Target Device Requirements 5.2 Running Applications ■Java ME Technology Standards The CDC Java runtime environment includes CVM, ■Java ME API Choices the CDC application launcher, for loading and ex- ■CDC Application Features ecuting Java applications. This chapter describes ba- ■Application Management sic use of the cvm command to launch different kinds ■Developer Tools of Java applications, as well as more advanced topics IJERTlike memory management and dynamic compiler The CDC Java runtime environment described in thisIJERT policies. cvm, the CDC application launcher is simi- runtime guide can operate in several different usage lar to java, the Java SE application launcher. Many of contexts: CVM’s command-line options are borrowed from ■During product development, the CDC Java runtime java. The basic method of launching a Java applica- environment has testing features that can help isolate tion is to specify the top-level application class con- problems while porting CDC technology to a new taining the main() method on the cvm command-line. target platform. For example, the trace features pro- For example, cvm Hello World By default, cvm vide details about code and method execution as well looks for the top-level application class in the current as garbage collection (GC) state. directory. As an alternative, the -cp and -class path ■One of the final stages of product development is command-line options can specify a list of locations TCK verification. A TCK is a test suite that verifies the behavior of an implementation of Java technolo- where cvm can search for application classes. For gy. The TCK includes a test harness that runs a can- example, didate Java runtime environment and launches a se- % cvm -cp /mylib: demo classes.jar Hello World ries of test Java applications. TCK verification is Here cvm searches for a top-level application class described in the TCK user guides listed in ―Related named Hello World, first in the directory /mylib and Documentation‖ on page xvi. then in the archive file democlasses.jar. ―Class Search Path Basics‖ on page 4-4 for more informa- ■Application development for the CDC platform re- tion about class search paths. quires a target Java class library for compiling Java The -help option displays a brief description of the source code and a CDC Java runtime environment for available command-line options. Appendix A pro- testing and debugging. Chapter 8 provides more in- vides a complete description of the command-line formation about application development with the options available for cvm. CDC Java runtime environment.

IJERTV2IS110753 www.ijert.org 2352 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

5.3 Running Managed Applications (Personal Basis \ -name xletName \ (-path xletPath | -codebase url- Profile and Personal Profile only) Path) \ -args arg1 arg2 arg3 ...} \ ...% cvm Managed application models allow developers to com.sun.xlet.XletRunner -filename optionsFile% offload the tasks of deployment and resource man- cvm com.sun.xlet.XletRunner –usage agement to a separate application manager. The CDC 6. Concussion Java runtime environment includes sample applica- With the help of JVM we can run any kind of appli- tion managers for two different application models: cations in java runtime environment technologies ■The applet application model was one of the first success stories of Java technology. An applet con- and the dramatic increase of mobile communication tains dynamic web content that a user can view and devices the demand for applications run on these de- manipulate through an applet viewer, typically built vices also increased where the consumers expects into a web browser. quality services.J2ME provides standard to meet this ■The xlet application model is similar in purpose to expectations. To keep pace with the demands for per- the applet application model, but different in design. formance of the next generation of mobile phones The main differences between an x let and an applet and other wireless devices, Sun Microsystems saw are that an xlet has a cleaner life cycle model and the need for a new Java virtual machine technologist doesn’t require an explicit dependency on AWT. result is CLDC Hotspot Implementation, which These features make x lets more appropriate for em- achieves a performance gain of nearly an order of bedded device scenarios like set-top boxes and magnitude compared to the first generation of J2ME PDAs. deployments. The CLDC Hotspot Implementation virtual machine was demonstrated on real devices at 5.3.1 Running an Applet (Personal Profile Java One 2002.This technology is available to device only) manufacturers under license from Sun Microsystems.

The CDC Java runtime environment includes a sim- 7.References: ple applet launcher named sun. applet. Applet Viewer [1] Minoi,J. L., Green P., Arab, S., 2002, Navigation which displays each applet in a separate frame. App- Application with Mobile Telephony: Shortest-path, let Viewer is a simplified version of the Java SE app- University Malaysia Sarawak, University of Man- let viewer utility (see chester, http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/a Map Asia 2002, http://www.gisdevelopment.net/ ppletviewer.html). The CDC version does not have IJERTa IJERTtechnology/lbs./techlbs008pf.htm separate command-line utility and does not support [2] Liu, J., 2002, Mobile Map: A Case Study in the all of the options available in the Java SE version, Design & such as -debug, -encoding, and -J. The basic com- Implementation of a Mobile Application, Computer mand syntax to launch an applet with Applet Viewer Engineering Dept. of Carleton University, is: cvm sun. applet. AppletViewer URL http://www.sce. URL identifies an HTML file containing an APPLET, carleton.ca/wick/chameleon/mc/JaneThesis.pdf OBJECT or EMBED tag that identifies an applet. See [3] Revel, S., 2001, How Does Location Govern http://java.sun.com/j2se/1.4.2/docs/tooldocs/appletvie Task? The wertags.html for a description of the HTML tags Delivery of an Intelligent Tourist Aide over a Palm supported by AppletViewer. Device, Here is a simple example of how to launch an applet Univ. of Edinburgh, MSc Dissertation Plan, based on the DemoApplet example in democ- http://www. lasses.jar:% cvm sun.applet.AppletViewer person- geo.ed.ac.uk/~gisadmin/submission/msc0138/plan.ht al/DemoApplet.html ml 5.3.2 Running an Xlet (Personal Basis Profile and [4] Virrantaus, K., Markkula, J., Garmash, A., Ter- Personal Profile only) ziyan, V., The CDC Java runtime environment includes a sim- Veijalainen, J., Katanosov, A., Tirri, H., 2001, De- ple xlet manager named com.sun.xlet.XletRunner. veloping Xlets can be graphical, in which case the xlet manag- GIS-supported Location Based Services, Helsinki er displays each xlet in its own frame, or they can be University of Technology, University of Jyvaskyla, non-graphical. The basic command syntax to launch Finland, XletRunner is: Second International Conference on Web Information % cvm com.sun.xlet.XletRunner { Systems Engineering (WISE’01), Volume 2, Japan, http://www.cs.jyu.fi/ai/papers/WGIS-01.pdf

IJERTV2IS110753 www.ijert.org 2353 International Journal of Engineering Research & Technology (IJERT) ISSN: 2278-0181 Vol. 2 Issue 11, November - 2013

[5] Megler, V., 2002, i-mode:From bandwidth prob- AUTHORS lem into First Author- T GOPINATH Pursing Master of Com- Internetphenomenon, http://www-106.ibm.com/ puter Application in JNTU, ANTHAPUR. In Siddhartha developerworks/library/wi-imode/index.html Institute of Engineering and Technology College, [6] Keryer, P., Nara, T., 2001, i-mode: A Successful puttur, Andhra Pradesh, India. His field of interest is Lauch of java Technologies . The Mobile Internet Market, Alcatel Telecommuni- cations Review – First Quarter 2001, http://atr.alcatel.de/ hefte/01i_1/gb/pdf_gb/12keryergb.pdf [7] Developnet, Why is J2ME MIDP superior to WAP, http://www.developnet.co.uk/ wap.html [8] Dru, M-A, Saada, S., 2001, Location-Based Mo- bile Services: The Essentials, Alcatel Telecommuni- cations Review – First Quarter 2001, http://atr.alcatel.de/ Second Author –A SATISHKUMAR Pursing Master hefte/01i_1/gb/pdf_gb/14drugb.pdf of Computer Application in JNTU, ANATHAPUR. In [9] Goodman, D. J., 2000, The wireless Internet: Siddhartha Institute of Engineering and Technology Promises and Challenges, July 2000 IEEE Computer College, puttur, Andhra Pradesh, India. His field of magazine. interest is java Technologies . [10] Knudsen, J., 2002, What’s New in MIDP 2.0, http://wireless.java.sun.com/midp/articles/midp20/ [11] Laitinen, H., 2001, Sun’s 2001 Worldwide Java Developer Conference, Development Tools for the J2ME,http://www.forum.nokia.com/main/1,35452,1_ 0_75,00.html. [12] JBuilder MobileSet 3.01 Developer’s Guide, http://info.borland.com/techpubs/jbuilder/jbuilder8/m e/contents.html [13] Capone, J. M., 2001, Java 2ME Bridging wire- less Gap?, IJERTIJERT http://www.onjava.com/lpt/a/1068 Third Author –P RAJESH KUMAR Received the [14] Angelides, J., 2002, The right technology is vital MCA POST GRADUATE In computer applications for location based applications, Wireless Europe, in JNTU, Hyderabad. He is currently working as an Assistant Professor , in Siddhartha institute of Engi- neering and Technology College, putter, Andhra Pra- desh, India. His field of interest is java Technologies and data mining and data ware house

IJERTV2IS110753 www.ijert.org 2354