JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Management and Monitoring APIs     Java CAPS Documentation
search filter icon
search icon

Document Information

Java CAPS Management and Monitoring APIs

Java CAPS Management Client

JavaDocs

Targets

Getting Started Using APIs

To Start Using APIs to Create Applications

Connecting to the Server Through APIs

Connection Type Definition

CAPSManagementClientFactory Definition

The Alert Management API

Support for Databases

AlertConfigurationService

AlertNotificationService

Services -- JavaCAPSManagementAPI

Administration Service

Runtime Management Service

Configuration Service

Deployment Service

Installation Service

Performance Measurement Service

Alert Management Service

Alert Administration Service

Alert Notification Service

Alert Configuration Service

JMS Management Service

Log Management Service

BPEL Management Service

Master Data Management (MDM) Service

Java CAPS Adapters Management Service

Target Option Behavior for the Management Client

Writing Java Code to Access APIs Using Java Code Samples

Setting Up Databases

To Set Up a Database Using Enterprise Manager

To Set Up a Database Using a Scripting Utility

Using Oracle and Other Databases for Alert Persistence

To Set Up an Oracle Database for Alert Persistence

Oracle Script Examples

Setting Up Scripting Engines

Downloading, Installing, and Setting Up A Scripting Environment

Setting Up a Scripting Environment to Invoke Java CAPS Management and Monitoring APIs

To Modify the Environment Variables in env.bat

Using a Scripting Language to Exercise the Java CAPS Management and Monitoring APIs

Exercising the Administration Service

Exercising the Administration Service in Groovy

Exercising the Configuration Service

Exercising the Configuration Service in Groovy

Exercising the Deployment Service

Exercising the Deployment Service in Groovy

Exercising the Installation Service

Exercising the Installation Service in Groovy

Exercising the Runtime Management Service

Exercising the Runtime Management Service in Groovy

Exercising the JMS Management Service

Exercising the JMS Management Service in Groovy

Exercising the BPEL Management Service

Exercising the BPEL Management Service in Groovy

Exercising the HTTP Administration Service

Exercising the HTTP Administration Service in Groovy

Exercising the Notification Service

Exercising the Notification Service in Groovy

JRuby Integrated into NetBeans IDE

To Create a JRuby Project

Setting Up Scripting Engines

The Java CAPS Management and Monitoring API should be callable from any JSR-223 Scripting Environment. This section documents how to set up these scripting engines like Groovy, JRuby, Jython (Java Python), JACL (Java TCL) or one of the 25 other JSR-223 scripting engines capable of calling the Java CAPS Management and Monitoring APIs that are currently available . You can use these instructions to setup your own environment to invoke these APIs from the JSR-223 Scripting Environment of your choice.

Downloading, Installing, and Setting Up A Scripting Environment

For the purposes of this topic, we will focus on four scripting engines:


Note - The sample files for the services (for example: AdministrationServiceSample.groovy) and the Target option behavior are zipped, and are included with the Java CAPS 6 delivery.


Setting Up a Scripting Environment to Invoke Java CAPS Management and Monitoring APIs

There are two files that are necessary before you set up your scripting environment to invoke Java CAPS Management and Monitoring APIs:


Note - These files are included with the Java CAPS delivery.


After downloading env.bat and caps.management.client.jar, modify the environment variables in env.bat.

To modify environment variables, click To Modify the Environment Variables in env.bat.

To Modify the Environment Variables in env.bat

  1. Set the JAVA_HOME variable to the JDK/JRE Home folder where your JDK or JRE is installed.

    For example: set JAVA_HOME=C:\java\jdk1.6.0.

  2. Set the SJSAS_HOME variable to the SJSAS Home folder where your GlassFish Application Server is installed.

    For example: set SJSAS_HOME=C:\CAPS6\SJSAS.

  3. Set the CAPS_MANAGEMENT_HOME variable to the folder where you saved the Java CAPS Management and Monitoring API Java archive file locally.

    For example: set CAPS_MANAGEMENT_HOME=C:\scripting\engines\common.

  4. Set the ENGINE_HOME variable to your Scripting Engine Home folder where your scripting engine is installed.

    For example: set ENGINE_HOME=C:\scripting\engines\groovy\groovy-1.1-beta-2.


    Note - You are now ready to run the scripting samples.


Using a Scripting Language to Exercise the Java CAPS Management and Monitoring APIs

Before running the scripting samples, it is assumed that you installed one of the scripting engines.

It is also assumed that the GlassFish Application Server is running with the following settings:

Host
HTTP Administration Port
Admin UserName
Admin Password
localhost
4848
admin
adminadmin

Tip - If your environment is different, change the following steps or the scripts according to your environment or installation. Previously, adminadmin was the default password; now it is defined during installation. You will likely need to modify the password in the scripts.


Currently Oracle supports these services:

Additional services will be supported in the future.

Exercising the Administration Service

Before you can exercise the Administration Service, you must have the following installed, and/or deployed, in your environment:

Exercising the Administration Service in Groovy

The Groovy script for executing the Administration Service is attached in AdministrationServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\AdministrationServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the Configuration Service

Before you can exercise the Configuration Service, you must have the following installed in your environment:

Exercising the Configuration Service in Groovy

The Groovy script for executing the Configuration Service is attached in AdministrationServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\ConfigurationServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the Deployment Service

The deployment service tries to deploy a Service Assembly named SynchronousSampleApplication. Before you run the Deployment Service scripts, from NetBeans you must first create a SynchronousSampleApplication, deploy it, and start it. Change the script as you see fit to run in your environment.

Exercising the Deployment Service in Groovy

The Groovy script for executing the Deployment Service is attached in DeploymentServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\DeploymentServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the Installation Service

Before you can exercise the Installation Service, you must have aspectserviceengine.jar installed in your environment.


Caution

Caution - Read the following carefully.


  1. A service engine named sun-aspect-engine attempts to stop, shutdown, and uninstall itself.

  2. The service engine then attempts to install sun-aspect-engine from the attached aspectserviceengine.jar.

  3. Before you run the Installation Service sample scripts, install aspectserviceengine.jar in your environment and start it.

  4. Change the script as you see fit to run in your environment.

Exercising the Installation Service in Groovy

The Groovy script for executing the Installation Service is attached in InstallationServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\InstallationServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the Runtime Management Service

Before you can exercise the Runtime Management Service, you must have the following installed and deployed in your environment:

Exercising the Runtime Management Service in Groovy

The Groovy script for executing the Runtime Management Service is attached in RuntimeManagmentServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\RuntimeManagementServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the JMS Management Service

Before you can exercise the JMS Management Service, you must have first installed the Java CAPS JMS IQ Manager from the Java CAPS Installer and deployed it in your environment:


Note - The Java CAPS Installer, by default, allows you to install Java CAPS JMS IQ Manager during the installation process. However, you can install Java CAPS JMS IQ Manager at any time after you have installed Java CAPS 6.


Exercising the JMS Management Service in Groovy

The Groovy script for executing the JMS Management Service is attached in JMSManagmentServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\JMSManagementServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the BPEL Management Service

Before you can exercise the BPEL Management Service, you must ensure:

Exercising the BPEL Management Service in Groovy

The Groovy script for executing the BPEL Management Service is attached in BPELManagmentServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\BPELManagementServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the HTTP Administration Service

Before you can exercise the HTTP Administration Service, you must have the following installed and deployed in your environment:

Exercising the HTTP Administration Service in Groovy

The Groovy script for executing the HTTP Administration Service is attached in HTTPAdiministrationServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\HTTPAdministrationServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

Exercising the Notification Service

For Notification Service test, there are no prerequisites except that the AppServer is up and running. When any lifecycle changes happen in the JBI runtime, the Notification Service sends these notifications to all subscribed clients.


Note - Change the script as you see fit to run in your environment.


Exercising the Notification Service in Groovy

The Groovy script for executing the Notification Service is attached in NotificationServiceTest.groovy. Modify the script to suit your needs before executing it in your environment/installation.

cd C:\JavaCAPS6\managementapienv.batcd scripting\groovy\scripts\groovy ServiceTest\NotificationServiceTest.groovy

If you are comfortable with the Swing-based groovyConsole, use it to load and execute the script file.

cd C:\scripting\groovy\scripts\env.batgroovyConsole

JRuby Integrated into NetBeans IDE

If you have the latest version of NetBeans IDE 6.0, you can create your own JRuby Project, and execute the JRuby samples (they have “rb” extensions) from within the NetBeans IDE.


Note - Java CAPS 6 delivered with NetBeans IDE 6.1 ML.


To Create a JRuby Project

  1. Create a new JRuby project.
  2. Copy the JRuby scripting files into the project.
  3. Right-click and open the Project Properties tab and provide the appropriate jar files for the project to use.
  4. Start the GlassFish Application Server.
  5. Open a script file in NetBeans, right-click on the source, and then click Run File to run the script.