JBoss.orgCommunity Documentation

Chapter 8. Building JAIN SLEE Resource Adaptor Types

8.1. Creating a JAIN SLEE Resource Adaptor Type
8.2. Editing a JAIN SLEE Resource Adaptor Type
8.2.1. Edit RA Type Identity
8.2.2. Edit RA Type Events
8.2.3. Edit RA Type Activity Types
8.3. Deleting a JAIN SLEE Resource Adaptor Type

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

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 <ratype-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 8.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 RA Type, right-click on the created package (or the module entry if the package is not yet created) and choose NewOther ... as shown below.

Figure 8.2. Creating a new JAIN SLEE Component in EclipSLEE


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

Figure 8.3. Creating a new JAIN SLEE RA Type in EclipSLEE


Click Next to get the following dialog:

Figure 8.4. Selecting the package and name for a new JAIN SLEE RA Type 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 RA Type; the name must end with "ActivityContextInterfaceFactory.java". Then click Next to go to the component identity dialog, pictured below:

Figure 8.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 RA Type. The description field is optional, but strongly recommended to be completed to allow easy identification of the RA Type in future.

After completing these fields click Next to specify the Events supported by this RA Type.

Figure 8.6. JAIN SLEE RA Type events selection in EclipSLEE


This dialog allows you to specify which events can be fired by the Resource Adaptor Type implementation, select them from the top list (Available Events) by clicking Select Event. To remove them, select them from the bottom list (Selected Events) and click Deselect Event. When done, click Next to edit the RA Type's Activity Objects.

Figure 8.7. JAIN SLEE RA Type Activity Objects definition in EclipSLEE


Here, the RA Type's Activity objects type can be set. Add an Activity object by clicking on Add and writing it's Java Type in the Activity Type column and selecting Create to have EclipSLEE creating the interface or not. An Activity type can be removed by selecting it in the table and clicking Remove. To modify any of the fields, click on it and it should be possible to edit/change the value.

In this same wizard page, it is possible to define whether to create or not a Resource Adaptor SBB Interface (Provider) by checking or leaving unchecked the Create Resource Adaptor Interface 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 Type's identity if a skeleton Resource Adaptor Type is required. It is not necessary to complete each wizard page first.

The Resource Adaptor Type Java file, MobicentsDemoActivityContextInterfaceFactory.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 ratype-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 8.8. JAIN SLEE Resource Adaptor Type 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 Type classes a similar menu should be shown:

Figure 8.9. Editing a JAIN SLEE Resource Adaptor Type through class file


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

Figure 8.10. Editing JAIN SLEE Resource Adaptor Types through XML descriptor


After selecting the desired Resource Adaptor Type, 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 Type:

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

Figure 8.11. Editing JAIN SLEE Resource Adaptor Type 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 Type classes or XML descriptor file (see Section 8.2, “Editing a JAIN SLEE Resource Adaptor Type”) and selecting the Delete option.

A confirmation dialog similar to the following should be presented:

Figure 8.14. Deleting a JAIN SLEE Resource Adaptor Type confirmation dialog


Impossible to undo this operation!

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