JBoss.orgCommunity Documentation

Chapter 9. Building JAIN SLEE Resource Adaptors

9.1. Creating a JAIN SLEE Resource Adaptor
9.2. Editing a JAIN SLEE Resource Adaptor
9.2.1. Edit RA Identity
9.2.2. Edit RA Resource Adaptor Types
9.2.3. Edit RA Config Properties
9.3. Deleting a JAIN SLEE Resource Adaptor

EclipSLEE provides means to create, edit and delete JAIN SLEE Resource Adaptors.

To create a component it may be easier (but not mandatory) to first create a package to contain it. This package should be created as a child of the <ra-module>/src/main/java folder. To do this right-click on the src folder and select NewPackage. Give the new package a name using the popup dialog (shown below).

Figure 9.1. Creating a new Package in Eclipse


In case a new package is not created at this point, it can still be created in the Component wizard, but no validation is performed at that time, regarding the package naming conventions.

To create a new JAIN SLEE Resource Adaptor, right-click on the created package (or the module entry if the package is not yet created) and choose NewOther ... as shown below.

Figure 9.2. Creating a new JAIN SLEE Component in EclipSLEE


A dialog should appear. Expand the JAIN SLEE item and choose JAIN SLEE Resource Adaptor. The dialog should now look like the following:

Figure 9.3. Creating a new JAIN SLEE Resource Adaptor in EclipSLEE


Click Next to get the following dialog:

Figure 9.4. Selecting the package and name for a new JAIN SLEE Resource Adaptor in EclipSLEE


The source folder and package dialogs will be completed if NewOther ... has been selected from right-clicking on a package. Otherwise it may need to be chosen by selecting Browse... and selecting the desired locations or typing it's name in the appropriate field and it will be created in the end.

Name the Resource Adaptor; the name must end with "ResourceAdaptor.java". Then click Next to go to the component identity dialog, pictured below:

Figure 9.5. JAIN SLEE Component Identity dialog in EclipSLEE


The Name, Vendor and Version fields are mandatory and are used by the SLEE to identify the Resource Adaptor. The description field is optional, but strongly recommended to be completed to allow easy identification of the Resource Adaptor in future.

After completing these fields click Next to specify the Resource Adaptor Libraries.

Figure 9.6. JAIN SLEE Resource Adaptor Libraries dialog in EclipSLEE


This dialog allows to select which JAIN SLEE Libraries this Resource Adaptor should reference in it's descriptor. Select them from the top list (Available Libraries) by clicking Select Library. To remove them, select them from the bottom list (Selected Libraries) and click Deselect Library.

When done, click Next to specify the RA Types the Resource Adaptor implements.

Figure 9.7. JAIN SLEE Resource Adaptor RA Types selection in EclipSLEE


This dialog allows you to specify which RA Types this Resource Adaptor will implement. Select them from the top list (Available RA Types) by clicking Select RA Type. To remove them, select them from the bottom list (Selected RA Types) and click Deselect RA Type. When done, click Next to edit the Resource Adaptor Config Properties.

Available Components Missing?

At the moment, in order for the available components to be listed in the wizard, they need to be part of the classpath. For instance if you want to use the SIP11 Resource Adaptor Type for your project, you will need to add it as a Maven Dependency and be part of classpath first. Refer to Section 3.3.1, “Adding a New Maven Dependency” on how to do it.

Figure 9.8. JAIN SLEE Resource Adaptor Config Properties definition in EclipSLEE


Here, the Resource Adaptor's Config Properties can be set. Add a Config Property field by clicking on Add and writing it's name on the Name column, selecting the appropriate Java Type in the Type column and, this is optional, type a default value (if no value is to be set, delete the default ? which is inserted) in the Default Value column.

In this same wizard page, it is possible to define whether this Resource Adaptor supports reconfiguration when in ACTIVE state by checking or leaving unchecked the This Resource Adaptor supports active reconfiguration checkbox.

Once finished, click Finish to create the Resource Adaptor Type.

Skipping optional steps

Finish can be clicked at any point after setting the Resource Adaptor's identity if a skeleton Resource Adaptor is required. It is not necessary to complete each wizard page first.

The Resource Adaptor Java file, MobicentsDemoResourceAdaptor.java (plus the remaining interfaces and classes which were selected at the wizard) is created in the specified package and opened for editing in the workspace. The ra-jar.xml deployment descriptor is updated to reflect the new ratype or created if not already present. The resulting workspace can be seen below.

Figure 9.9. JAIN SLEE Resource Adaptor created in workspace using EclipSLEE


It is possible with EclipSLEE to edit existing components. When right-clicking in one of the JAIN SLEE Resource Adaptor classes a similar menu should be shown:

Figure 9.10. Editing a JAIN SLEE Resource Adaptor through class file


It is also possible to edit by right-clicking on the resource-adaptor-jar.xml descriptor. In that case a sub-menu allowing to pick which Resource Adaptor to edit is shown:

Figure 9.11. Editing JAIN SLEE Resource Adaptors through XML descriptor


After selecting the desired Resource Adaptor, the menu shown should be similar to the one presented when using the class file to edit.

The following actions are available for a JAIN SLEE Resource Adaptor:

This operation can be accessed by selecting Identity.... With this operation it is possible to change the JAIN SLEE Resource Adaptor identity (name, vendor, version) and it's description. The following dialog is presented:

Figure 9.12. Editing JAIN SLEE Resource Adaptor Identity


Other components are not updated!

EclipSLEE does not automatically update other component descriptors in order to reflect such identity change, so it should be made manually.

It is possible with EclipSLEE to delete existing components. Right-clicking in one of the JAIN SLEE Resource Adaptor classes or XML descriptor file (see Section 9.2, “Editing a JAIN SLEE Resource Adaptor”) and selecting the Delete option.

A confirmation dialog similar to the following should be presented:

Figure 9.15. Deleting a JAIN SLEE Resource Adaptor confirmation dialog


Impossible to undo this operation!

Deleting a component is an irreversible operation, so it should be used carefully.