Skip Navigation Links | |
Exit Print View | |
Oracle Java CAPS Management and Monitoring APIs Java CAPS Documentation |
Java CAPS Management and Monitoring APIs
To Start Using APIs to Create Applications
Connecting to the Server Through APIs
CAPSManagementClientFactory Definition
Services -- JavaCAPSManagementAPI
Performance Measurement 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
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
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
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.
For the purposes of this topic, we will focus on four scripting engines:
Groovy: The Java CAPS Management and Monitoring API has been tested and works with Groovy 1.0, Groovy 1.1 beta 1, and with the latest Groovy 1.1 beta 2. Use the installation instructions that are available to install the engine, and ensure that it runs properly. Download Groovy from http://groovy.codehaus.org/.
JRuby: The Java CAPS Management and Monitoring API has been tested and works with JRuby 1.0 and with the latest JRuby 1.0.1. Use the installation instructions that are available to install the engine, and ensure that it runs properly. Download JRuby from http://jruby.codehaus.org/.
Jython (Java Python): The Java CAPS Management and Monitoring API has been tested and works with Jython 2.2 RC1 and with the latest Jython 2.2. Use the installation instructions that are available to install the engine, and ensure that it runs properly. Download Jython from http://www.jython.org/Project/index.html.
JACL (Java TCL): The Java CAPS Management and Monitoring API has been tested and works with the latest JACL 1.4.0. Use the installation instructions that are available to install the engine, and ensure that it runs properly. You may have to modify jaclsh.bat in the bin folder as described in the readme.txt file that is included with the download. My bin/jaclsh.bat looks like this after modification. Download JACL from http://tcljava.sourceforge.net/docs/website/index.html.
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.
There are two files that are necessary before you set up your scripting environment to invoke Java CAPS Management and Monitoring APIs:
env.bat
caps.management.client.jar
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.
For example: set JAVA_HOME=C:\java\jdk1.6.0.
For example: set SJSAS_HOME=C:\CAPS6\SJSAS.
For example: set CAPS_MANAGEMENT_HOME=C:\scripting\engines\common.
For example: set ENGINE_HOME=C:\scripting\engines\groovy\groovy-1.1-beta-2.
Note - You are now ready to run the scripting samples.
Before running the scripting samples, it is assumed that you installed one of the scripting engines.
Groovy (located at C:\scripting\engines\groovy\groovy-1.1-beta-2)
JRuby (located at C:\scripting\engines\jruby\jruby-1.0.1)
Jython (located at C:\scripting\engines\jython\jython2.2)
JACL (located at C:\scripting\engines\jacl\jacl140)
It is also assumed that the GlassFish Application Server is running with the following settings:
|
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:
Administration Service
Configuration Service
Deployment Service
Installation Service
Runtime Management Service
Additional services will be supported in the future.
Before you can exercise the Administration Service, you must have the following installed, and/or deployed, in your environment:
A binding component named sun-http-binding
A shared library named sun-wsdl-library
A service assembly named SynchronousSampleApplication, which contains a service unit named SynchronousSampleApplication-SynchronousSample
Tip - You must create the SynchronousSampleApplication from NetBeans, deploy it, and start it before you run the Administration Service scripts.
Note - Change the script as you see fit to run in your environment.
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
Before you can exercise the Configuration Service, you must have the following installed in your environment:
A binding component named sun-http-binding
A service engine named sun-bpel-engine
Note - Change the script as you see fit to run in your environment.
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
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.
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
Before you can exercise the Installation Service, you must have aspectserviceengine.jar installed in your environment.
Caution - Read the following carefully. |
A service engine named sun-aspect-engine attempts to stop, shutdown, and uninstall itself.
The service engine then attempts to install sun-aspect-engine from the attached aspectserviceengine.jar.
Before you run the Installation Service sample scripts, install aspectserviceengine.jar in your environment and start it.
Change the script as you see fit to run in your environment.
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
Before you can exercise the Runtime Management Service, you must have the following installed and deployed in your environment:
A service engine named sun-bpel-engine
A service assembly named SynchronousSampleApplication, which you created from NetBeans.
Note - Change the script as you see fit to run in your environment.
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
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.
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
Before you can exercise the BPEL Management Service, you must ensure:
That monitoring is enabled for your BPEL Service Engine
That a service engine named sun-bpel-engine has been installed and deployed in your environment
Note - Change the script as you see fit to run in your environment.
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
Before you can exercise the HTTP Administration Service, you must have the following installed and deployed in your environment:
A binding component named sun-http-binding
A Service Assembly with some HTTP consuming endpoint(s)
Note - Change the script as you see fit to run in your environment.
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
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.
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
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.