javablogspot

Just another WordPress.com weblog

Java RTS NetBeans Module 1.0 Getting Started Guide

Posted by damuchinni on February 24, 2009

This document provides the minimum information required for installing and using the Sun JavaTM Real-Time System (Java RTS) NetBeansTM module.

Important Note: This a preliminary version of the module.

The document contains the following sections:

Introduction to Sun Java RTS This section presents an overview of Java RTS.
The Java RTS NetBeans Module This section presents the features provided by the Java RTS NetBeans module.
Installation This section explains the installation of the Java RTS NetBeans module.
Usage This section describes how to use the Java RTS NetBeans module.
Known Limitations This section points out the known limitations of this distribution.
Introduction to Sun Java RTS
The Sun Java Real-Time System is the first commercial implementation by Sun Microsystems of JSR-1, the Real-Time Specification for Java (RTSJ), which combines industrial-strength real-time functionality with the usability, abstraction, and standards-based advantages of Java technology. Java RTS supports hard real-time, soft real-time, and non-real-time functionality concurrently within a single Java Virtual Machine (JVMTM).

Java RTS Features and Benefits
New Real-Time Threads, Scheduling, and Synchronization
The RTSJ introduces the concept of two new threads: real-time threads and no-heap real-time threads. (A no-heap real-time thread cannot be interrupted by garbage collection.) These threads offer more precise scheduling than standard Java threads. They have 28 levels of priority and, unlike standard Java threads, their priority is strictly enforced.

Real-time threads are synchronized and are not subject to so-called priority inversion situations, where a lower priority thread has a block on a resource needed by a higher priority thread and thus prevents the higher priority thread from running.

New Memory Management Schemes
The RTSJ defines two new types of memory areas that allow real-time applications to avoid unpredictable delays commonly caused by traditional garbage collectors:

Immortal memory holds objects without destroying them, except when the program ends. This means that objects created in immortal memory must be carefully allocated and managed.
Scoped memory is used only while a process works within a particular section, or scope, of the program, such as in a method. Objects are automatically destroyed when the process leaves the scope. This is a useful feature akin to garbage collection in that discrete creation and deletion is not required as in the immortal memory case. However, the process must exit the scope to ensure that the memory is reclaimed.
Immortal memory and scoped memory are not garbage collected, so using them avoids problems of garbage collection (GC) interference.

Asynchronous Events Handling & Asynchronous Transfer of Control
The RTSJ provides two mechanisms for asynchronous communication: asynchronous event handling, and asynchronous transfer of control.

Asynchronous event handlers deal with external events (known as “happenings”) which can occur outside the JVM. The RTSJ is unique in that it allows developers to schedule the response to asynchronous events in order to avoid disrupting the temporal integrity of the rest of the real-time application.

Asynchronous Transfer of Control (ATC) provides a carefully controlled way for one thread to interrupt another thread in a safe manner.

Time & Timers
The RTSJ specifies several ways to specify high-resolution (nanosecond accuracy) time, including absolute time and relative time.

Direct Access to Physical Memory
While maintaining security protections, the RTSJ allows direct access to physical memory. This means that device drivers can be created that are written entirely in the Java language. Previously, Java applications had to link to native code to communicate directly with the hardware.

The Sun Java RTS product is available through Sun OEM Sales. Contact them at: OEM_Technology_telesales@sun.com or by telephone at +1-800-786-0404, Prompt 1, Prompt 3.

The Java RTS NetBeans Module
The Java RTS NetBeans module adds real-time application development support for the NetBeans 5.0 release. The only difference in the development process of an application with the Java RTS NetBeans module compared to a regular NetBeans 5.0 environment is the cross-platform development, namely the remote deployment and remote execution on a target where the Sun Java Real-Time System has been installed.

Unchanged Features in the NetBeans Module
The basic features in the NetBeans integrated development environment (IDE) remain unchanged. For example, the following features remain identical to a standard Java SE application:

Code editing and completion: While editing the code, in the middle of typing a Java RTS API class or method name, the developer can ask the system to provide a list of names to complete the word being typed. The developer can then choose a possible completion from this list, and the corresponding output from the JavadocTM tool is displayed in HTML format.
Build and runtime process: There is no change in this process compared with the standard Java SE application development.
Additional Features in the NetBeans Module
To support the development of a Java RTS application on a remote target, the following features have been added to the environment:

Creation of a new project category called Java Real-Time project in addition to the standard list. The developer chooses this project in order to develop a Java RTS application. This feature is provided in the New Project wizard.
Cross-platform development features. The Java Platform Manager wizard GUI has been enriched with a new platform category called Real Time Java, which allows the developer to specify remote deployment and execution parameters. See the Usage section below for more information.
Application deployment and execution profiles. The user can record, save, import from the filesystem, and export to the filesystem various remote deployment and execution parameters, for example, the Java RTS remote target on which the application should run. See the Usage section below for more information.
Installation
The Java RTS NetBeans module is actually a suite of three modules, each of which supports a dedicated set of features.

LocalRTSJStubs: This is a bridge module that encapsulates the necessary data for code editing, completion, build time (jar and javadoc files), and also for deployment and runtime (script files).
MackinacPlatform: This module contains all the additions and changes to the NetBeans platform application framework to support real-time development (new wizards, new project categories, and so forth).
Projects: This module contains the Java RTS project templates and additional code to support the new wizards.
To install the module suite, download and unzip the modules from this location. Then choose Tools | Update Center, select Install Manually Downloaded Modules, and click Next. Specify the location of the modules and complete the wizard. Important Note: You must install all three modules to get a complete and functional Java RTS NetBeans module installation.

Requirements
The module has been tested on the Solaris 10 Operating System, and on the Windows XP Professional SP2 and Linux platforms. Note that MacOS is not supported at this point. The system requirements to install and run the module are as follows:

NetBeans 5.0
JDK 5.0
8 MB of available space to install the modules
Usage
The development process for a Java RTS application is the same as for a Java SE application. It is performed with the following steps:

Create a Java RTS project using the modified New Project wizard.
Specify remote deployment and execution through the modified Java Platform Manager wizard.
Build and execute.
Stop the application.
Creating a Java RTS Project
The modified New Project wizard has a new Real Time Java Projects folder in the Categories panel. When this is selected, the list of available projects in the right panel provides a Real Time Java Project item. Select this subcategory of project.

When the Real Time Java Project item has been selected, click the Next button and follow the remaining standard procedure for a NetBeans project in order to create the Java RTS project.

Specifying Remote Deployment and Execution
You need to choose Tools | Java Platform Manager, to invoke the Java Platform Manager wizard, which has been enhanced to support remote deployment and execution of a built Java RTS application. The wizard provides a new Real Time Java 1.0 folder in the platform panel that the Java RTS developer selects. The developer specifies the deployment execution process parameters through the profile. Multiple profiles can be created and used at any time. The deployment and execution protocols used are rcp and rsh, respectively.

Below are the items that the user specifies:

Host Name: The remote machine on which Java RTS is installed (or the IP address of your remote target).
User Name: The user login name (configure the correct user rights for the Java RTS installation on the remote target).
Remote JDK Location: The location of the Java RTS installation on the remote target (for example, /opt/SUNWrtjv).
Remote JAR Location: The location on the remote machine where the Java RTS application JAR file is to be copied (for example, /tmp)
JVM Arguments: A text field to specify Java VM arguments to be used at runtime.
When all these parameters have been specified, click the Close button at the bottom right of the wizard.

Profiles: The Java Platform Manager wizard supports the notion of profiles. A profile records a set of deployment and execution parameters for future reuse. The developer can use the Profile combobox and the Add, Remove, Import, and Export buttons to save and manage various deployment and execution profiles.

Building and Executing
Build time: Use the standard contextual menu items named Build Project, Clean and Build Project, and Clean Project. They work in the same way as for a Java SE application.
Run time: Use the standard contextual menu item named Run Project to deploy and run your Java RTS application remotely. Remote deployment is done first, followed by remote execution. The parameters used are those specified through the modified Java Platform Manager wizard.
Stopping the Application
This preliminary release of the module version does not yet integrate a proper way of stopping the application on the remote target. If the application does not terminate by itself, you have to log onto the remote target and stop the application by killing the corresponding VM process. Note that it may then take a few seconds for your NetBeans project to be stopped.

There is however a work-around for stopping the application which may be used when there is only one instance of a Java VM running on the remote target: add the following Ant target to the build.xml file of your Java RTS project and add a target shortcut to your NetBeans environment (use the Create Shortcut contextual menu on this stop Ant target).

Known Limitations
The current version of the Java RTS module has the following known limitations:

The “Java Real Time Class Library” project subcategory in the New Project wizard is not yet supported.
Local deployment and execution is not yet supported.
Debugging or profiling the application is not yet supported.
Support for stopping the application running on a remote target is not yet properly integrated in the IDE.
Deployment and execution protocols are not yet customizable.
On Windows XP, in the argument list passed to the remote Java RTS VM, that is, in the “JVM Arguments” text field of the Java Platform Manager wizard, any ‘=’ character must be prefixed by the string “##”. In other words, “=” string must be specified as “##=”. For example, “-DMyProperty=foo” in the VM argument line would be expressed as “-DMyProperty##=foo”.

Advertisements

One Response to “Java RTS NetBeans Module 1.0 Getting Started Guide”

  1. […] Scoped memory is used only while a process works within a particular section, or scope , of the program, such as in a method. Objects are automatically destroyed when the process leaves the scope . This is a useful feature akin to garbage …Page 2 […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: