B Using the Oracle Service Bus Deployment APIs

You can use the Service Bus MBeans in Java programs and WLST scripts to automate promotion of Service Bus configurations from development environments through testing, staging, and finally to production environments.

This appendix includes the following sections:

Tip:

Service Bus APIs are documented in Java API Reference for Oracle Service Bus.

B.1 Deployment MBean Overview

These MBeans provide deployment functions to help you manage sessions and configurations in you Service Bus systems.

  • SessionManagementMBean: Use this MBean to create, activate and discard a session, or to return the name of an existing session

  • ALSBConfigurationMBean: Use this MBean to import and export Service Bus configurations, update environment-specific information (endpoint URIs, and so on), query Service Bus configurations and resources.

    Numerous customization options can be applied during deployment. An extended list of environment variables allows you to preserve or tailor settings when moving from one environment to another.

These are interfaces in the com.bea.wli.sb.management.configuration package.

B.2 Managing Sessions Using Programs and Scripts

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 Service Bus runs), until the changes are activated. In order to modify resources and 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.

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 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 do not support update operations.

B.2.1 Creating, Activating, Discarding, and Locating Sessions

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

Table B-1 Session Management Methods

To... Use...

Create a new session with a user-specified name.

createSession(String session)

Activate a session.

activateSession(String session, String description)

Delete the session without activating changes.

discardSession(String session)

Check whether a session with a specific session name exists. This method return true if the session does exist.

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 com.bea.wli.sb.management.configuration.SessionManagementMBean documentation in the Java API Reference for Oracle Service Bus. This documentation also includes example code illustrating how to create a session, how to obtain SessionManagementMBean for creating a session, and ALSBConfigurationMBean for operating on the session that is created and on core data, and so on.

B.3 Managing Configuration Tasks Using Programs and Scripts

The ALSBConfigurationMBean interface allows you to programmatically query, export and import resources, obtain validation errors, get and set environment values, and in general manage resource configuration in a Service Bus domain.

Service Bus configurations are packaged as simple JARs containing Service Bus resources such as proxy services, WSDL files, 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.

For reference material on the ALSBConfigurationMBean interface, see the com.bea.wli.sb.management.configuration.ALSBConfigurationMBean documentation in the Java API Reference for Oracle Service Bus.

B.3.1 Importing, Exporting, and Querying Configurations

Service Bus configurations are created using the Oracle Service Bus Console, JDeveloper, or Fusion Middleware Control. They 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 Service Bus domain and changing the environment-specific values in the configuration to match those of the new environment.

The methods in the ALSBConfigurationMBean Interface allow you to manage resources in a Service Bus domain, including the following tasks:

  • Query, export, and import resources (includes importing resources from a ZIP file, and exporting resources at the project level)

  • Get and set environment values

  • Clone a project, folder, or resource with a new identity

  • Modify the existing references from all the resources in the given list to a new set of references

  • Customize multiple properties at once

  • Obtain validation errors

For information about the methods provided in the ALSBConfigurationMBean interface, see Java API Reference for Oracle Service Bus.

B.3.2 Updating Environment-Specific Information

The methods in ALSBConfigurationMBean and in the Customization class allow you to update environment specific information. This includes the following tasks:

  • Update the value of endpoints in proxy and business service configurations

  • Update the directory elements in File, email, and FTP transport configurations

  • Set environment values directly

  • Search for environment-specific values specified in a query

  • Find environment values specified in a query, and replace all occurrences of the environment value pattern with the given parameter

For information about the methods in ALSBConfigurationMBean and Customization, see Java API Reference for Oracle Service Bus. Import customizations are supported by the ALSBImportPlan class. This documentation also includes example code illustrating how to import and export Service Bus configurations, how to change environment values, how to query resources, and so on.

You must update your security configuration and all other environment-specific settings interactively using Fusion Middleware Control.