corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

Java RTS NetBeans Module 1.0 Getting Started Guide

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

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: 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:

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:

Installation

The Java RTS NetBeans module is actually a suite of three modules, each of which supports a dedicated set of features.

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:

  1. Create a Java RTS project using the modified New Project wizard.
  2. Specify remote deployment and execution through the modified Java Platform Manager wizard.
  3. Build and execute.
  4. 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:

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

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).

<target name="stop" depends="init">
<exec executable="/usr/bin/rsh">
<arg line="your-remote-target-ipaddress -l root /usr/bin/pkill java"/>
</exec>
</target>

Known Limitations

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

Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems