Entering content frame

Process documentation Starting, Monitoring and Stopping a Java Instance Locate the document in its SAP Library structure

Purpose

With the Java startup and control framework you can start, monitor, and stop a Java instance. This means you can:

·        Restart processes that have crashed

·        Send request to shut instance down

·        Terminate hanging processes

The program Jcontrol is part of the standard delivery.

Process Flow

The following graphic shows the flow of the actions that the Java startup and control framework executes.

This graphic is explained in the accompanying text

 

Starting the Java Instance

The following steps are involved in starting the Java instance:

·        JControl is started (in Windows by the SAP start service; on UNIX platforms by the startsap script).

·        JControl initializes the SAP signal handling to be able to handle signals received.

·        JControl starts JLaunch with the bootstrap.propertiesfile (1). This executes the following steps:

¡        The first argument of JLaunch is the PID of the parent process (JControl). JLaunch starts a thread, which ends the JLaunch process, if the parent process, JControl, fails.

¡        Creates JVM arguments and initializes hosting of the VM.

¡        Loads the VM into its own process, initializes the VM and starts the bootstrap program.

¡        The bootstrap program synchronizes the binary data of the Java database with the local file system (2).

¡        The bootstrap program reads the Java instance description from the Java database and writes the file instance.property (3). The file instance.property contains the description and the arguments of the J2EE cluster elements that are to be started. 

·        JControl reads and creates a list of the Java cluster elements to be started (4).

·        JControl starts a JLaunch process for each cluster element (5). This executes the following steps:

¡        The first argument of JLaunch is the PID of the parent process (JControl). JLaunch starts a thread, which ends the JLaunch process, if the parent process, JControl, fails.

¡        Creates JVM arguments and initializes hosting of the VM.

¡        Loads the VM into its own process, initializes the VM and starts the Java cluster element. This executes the following steps:

§         Starts the “ offline“ configuration manager to read the properties for the Java Enterprise runtime from the database and to save them in various hash tables (6).

§         Stops the “offline“ configuration manager and starts the Enterprise Java runtime with the saved properties.

§         Starts the service framework and the services.

 

See also:

J2EE Engine System Architecture

 

Monitoring the Java Instance

The JControl process monitors the Java instance. It continuously checks the status of the cluster elements of the instance and restarts terminated processes.

Stopping the Java Instance

Signals and named pipes trigger a Java instance to stop. The process ensures that following a shutdown time interval all cluster elements of the instance are exited.

The graphic below shows the communication.

This graphic is explained in the accompanying text

An instance is stopped as follows:

·        The SAP start/stop environment (start script or SAP Start Service on Windows), which started the JControl process, sends a SIGINT to the JControl process (1).

·        JControl sets the status of the Java instance to STOPPING in its list and sends a notification using a named pipe to all of the running cluster elements (2).

·        The JLaunch process of the Java cluster element must respond to the notification within a defined time interval. (If this soft shutdown does not work, the JLaunch process is completely terminated by JControl.) It triggers the shutdown of the Java cluster element in the JVM and waits for its own VM to terminate (3).

·        JControl exits.

 

 

Leaving content frame