Deployment Guide

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using the Deployment APIs

AquaLogic Service Bus resources within a domain use Java Management Extensions (JMX) Managed Beans (MBeans) to expose their management functions. An MBean is a concrete Java class that is developed according to JMX specifications. It can provide getter and setter operations for each management attribute within a managed resource, along with additional management operations that the resource makes available.

You can use the AquaLogic Service Bus MBeans in Java programs and WLST scripts to automate promotion of AquaLogic Service Bus configurations from development environments through testing, staging, and finally to production environments. The AquaLogic Service Bus MBeans you can use to programmatically perform deployment operations are:

Notes: The DeploymentMBean (formerly available in the com.bea.wli.management package) is deprecated in AquaLogic Service Bus 2.5. The deployment operations formerly availble in the DeploymentMBean API are now available using the SessionManageentMBean and the ALSBConfigurationMBean. The latter MBeans are interfaces in the com.bea.wli.sb.management.configuration package .
Note: Access all AquaLogic Service Bus packages at http://download.oracle.com/docs/cd/E13171_01/alsb/docs25/javadoc

 


Managing Sessions Using Programs and Scripts

AquaLogic Service Bus sessions allow different users to update discrete parts of configuration data without interfering with each other. A session is essentially a named sandbox, in which your changes are abstracted from other users, as well as from the core data (the data on which AquaLogic Service Bus runs), until the changes are activated. In order to modify resources and AquaLogic Service Bus configurations, you must create a session and perform changes in that session. The changes are only reflected in the core data when you activate the session. You can create multiple sessions as long as no two sessions have the same name. A session can only be activated using the instance of the SessionManagementMBean that works on that session data.

Each MBean type, except for SessionManagementMBean, has one instance per session. When a session is created, a new set of MBean instances (one for each MBean Type) is created automatically. One instance of each MBean Type operates on the core data that is saved to the AquaLogic Service Bus data cache. MBean instances created for a session are destroyed when the session is discarded or activated. MBean instances that operate on core data, however, are never destroyed. MBean instances that work on core data d not support update operations.

Creating, Activating, Discarding, and Locating Sessions

AquaLogic Service Bus sessions are created using the AquaLogic Service Bus Console. The methods in the SessionManagementMBean interface directly parallel the interactive features provided in the AquaLogic Service Bus Console, and require execution in the same order as their GUI counterparts. The following table lists the methods available in the SessionManagementMBean interface and the tasks they perform.

Table A-1 Session Management Methods
To...
Use...
  1. Activate a session
activateSession(String session, String description)
  1. Create a new session with a user-specified name.
createSession(String session)
  1. Delete the session without activating changes
discardSession(String session)
  1. Return true if a session with the given session name exists
sessionExists(String session)

For reference material on the SessionManagementMBean interface and Java usage examples, as well as sample code describing how to use MBeans from a Java client and in a script, see the SessionManagementMBean Interface in the com.bea.wli.sb.management.configuration package in the ALSB javadoc, which is available at the following URL: http://download.oracle.com/docs/cd/E13171_01/alsb/docs25/javadoc/

 


Managing Configuration Tasks Using Programs and Scripts

The AquaLogic Service Bus ALSBConfigurationMBean allows you to programmatically query, export and import resources, obtain validation errors, get and set environment values, and in general manage resource configuration in an AquaLogic Service Bus domain. AquaLogic Service Bus configurations are packaged as simple JARs containing AquaLogic Service Bus resources such as proxy services, WSDLs, and business services. These resources can span multiple projects, or contain only partial configuration information. For example, you can export only a subset of a project, a whole project, or subsets of resources from many projects.

The following sections describe how to use the ALSBConfigurationMBean to perform these deployment activities from a Java client:

For reference material on the ALSBConfigurationMBean interface, see the ALSBConfigurationMBean Interface in the com.bea.wli.sb.management.configuration package in the ALSB javadoc, which is available at the following URL: http://download.oracle.com/docs/cd/E13171_01/alsb/docs25/javadoc/

Importing, Exporting, and Querying Configurations

AquaLogic Service Bus configurations are created using the AquaLogic Service Bus Console, and are stored through export in .jar files. After a configuration .jar file has been exported, you can promote the configuration by importing it into a different AquaLogic Service Bus domain and changing the environment-specific values in the configuration to match those of the new environment.

The methods in the ALSBConfigurationMBean require execution in the same order as their GUI counterparts provided in the AquaLogic Service Bus Console. The following table lists the required steps and the methods available in the ALSBConfigurationMBean interface to perform them.

Table A-2 Methods for Importing, Exporting, and Querying Configurations
To...
Use...
  1. Return the name of the session that this mbean operates on
getSession()
  1. Obtain configuration data from a configuration jar file and locally (temporarily) stage it on the server.
uploadJarFile(byte[] data)
  1. Import selected resources/projects/folders from the previously uploaded jar file into the session.
importUploaded(Collection<Ref> refs, boolean includeDependencies, boolean preserveExistingEnvValues, String passphrase)
  1. Search for a particular resource type based on the given resource query and return references to resources that satisfy the search criteria.
getRefs(ResourceQuery query)
  1. Return all the resources, folders or projects that are under the given root. The root can be a domain, project, or folder.
getRefs(Ref root)
  1. Obtain diagnostics information about specific resources
getDiagnostics(Collection<Ref> refs)
  1. Export a specific collection of references, and return bytes that make up the export data.
export(Collection<Ref> refsToExport, boolean includeDependencies, String passphrase)

Updating Environment-Specific Information

The following table lists methods available in ALSBConfigurationMBean that enable you to update environment-specific information. These include the value of endpoints in proxy and business service configurations, and directory elements in File, E-mail, and FTP transport configurations.

Table A-3 Methods for Updating Environment-Specific Values
To...
Use...
  1. Directly set environment value(s).
assignEnvValues(Collection<QualifiedEnvValue> envValues)
  1. Search for environment-specific values specified in a query.
findEnvValues(EnvValueQuery query)
  1. Find environment values specified in a query (as returned by EnvValueQuery.getSearchString() ), and replace all occurrences of the environment value pattern with the given parameter.
replaceEnvValues(EnvValueQuery query, String replacement)

You must update your security configuration and all other environment-specific settings interactively using the AquaLogic Service Bus Console. For information on configuring security, see Securing Inbound and Outbound Messages in the BEA AquaLogic Service Bus Console Online Help. For information on configuring other environment-specific settings, see Step 4. Deploy an AquaLogic Service Bus Configuration.

 


Sample Code

For more information and sample code that illustrates how to use the APIs in Java client programs and WLST scripts, refer to the javadoc information in Table A-4. The MBeans are interfaces in the com.bea.wli.sb.management.configuration package.

You can access Javadoc for these packages at http://download.oracle.com/docs/cd/E13171_01/alsb/docs25/javadoc/

Table A-4 Code Examples using Session and Configuration Management MBeans
For sample code that shows...
See...
How to obtain SessionManagementMBean and ALSBConfigurationMBean.
How to create a session
How to import and export AquaLogic Service Bus configurations.
How to change environment values
How to query resources.


  Back to Top       Previous  Next