9 6 11 Use the Java Service Manager

LANSA Composer

9.6.11 Use the Java Service Manager

The DXACTBAS1 ancestor class implements several methods specifically for loading and calling LANSA Integrator services. The methods provided wrap and simplify the calls to the Java Service Manager (JSM) and perform much of the necessary housekeeping, exception handling and logging.

These methods do, however, assume that you use a single connection to the JSM. If your Activity Processor needs to have multiple connections open, then you will have to write the code to manage the second and subsequent connections yourself.

Your Activity Processor does not have to use LANSA Integrator services. If it does not, you do not need to use these methods.

For more information about developing applications that use LANSA Integrator services, refer to the LANSA Integrator Guide.

ExecuteJSMOpen

Opens a connection to the Java Service Manager for executing LANSA Integrator services. The result is True if successful. Performs exception handling and logging as required. Sets the Activity return code to error if the open fails.

A successful call to ExecuteJSMOpen will usually be followed immediately by a call to the ExecuteJSMLoad method to load the required service.

ExecuteJSMLoad

Issues the SERVICE_LOAD service command to load the named JSM service, automatically enabling tracing according to the value specified in the System Settings, and performing exception handling and logging as required. Sets the Activity return code to error if the service load fails.

ExecuteJSMCommand

Executes a specified service command through the Java Service Manager. Performs exception handling and logging as required. By default, this sets the Activity return code to error if the command fails. However, if the iRecoverable parameter is set to True, the warning level will be set instead.

ExecuteJSMUnload

Issues the SERVICE_UNLOAD service command. Performs exception handling and logging as required. Sets the Activity return code to warning if the command fails.

ExecuteJSMClose

Closes the connection to the Java Service Manager, optionally unloading the currently loaded service first. Performs exception handling and logging as required.