JBoss.orgCommunity Documentation

Chapter 6. Building JAIN SLEE Service Building Block (SBBs)

6.1. Creating a JAIN SLEE Service Building Block (SBB)
6.2. Editing a JAIN SLEE Service Building Block (SBB)
6.2.1. Edit SBB Identity
6.2.2. Edit SBB Classes
6.2.3. Edit SBB CMP Fields
6.2.4. Edit SBB Usage Parameters
6.2.5. Edit SBB Events
6.2.6. Edit SBB Profile Specifications
6.2.7. Edit SBB Child Relations
6.2.8. Edit SBB Resource Adaptor Type Bindings
6.2.9. Edit SBB Environment Entries
6.3. Deleting a JAIN SLEE Service Building Block (SBB)

EclipSLEE provides means to create, edit and delete JAIN SLEE Service Building Blocks.

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

Figure 6.2. Creating a new JAIN SLEE Component in EclipSLEE


A dialog should appear. Expand the JAIN SLEE item and choose JAIN SLEE Service Building Block (SBB). The dialog should now look like the following:

Figure 6.3. Creating a new JAIN SLEE SBB in EclipSLEE


Click Next to get the following dialog:

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

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

After completing these fields click Next to specify the SBB's Libraries.

Figure 6.6. JAIN SLEE SBB Libraries dialog in EclipSLEE


This dialog allows to select which JAIN SLEE Libraries this SBB 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 SBB's class files.

Figure 6.7. JAIN SLEE SBB companion interfaces selection in EclipSLEE


This dialog allows you to specify that a custom SBB Local Object and/or Activity Context Interface is required for this SBB. Select the required interfaces, then click Next to edit the SBB's CMP fields.

Figure 6.8. JAIN SLEE SBB CMP Fields definition in EclipSLEE


Here, the SBB's CMP fields can be set. Add a CMP field by clicking on Add. A field can be removed by selecting it in the table and clicking Remove. To modify a CMP field, click on the Modify button next to it in the table.

Figure 6.9. JAIN SLEE SBB CMP Field configuration in EclipSLEE


Name the CMP field in the Name text field. A CMP field can either be a standard Java object, primitive or an SbbLocalObject. Select the statement that represents the data type to be stored in the field.

A standard Java object or primitive type requires the fully qualified type name to be entered into the Type text field. For example, java.lang.String.

A CMP field that stores an SbbLocalObject may only store SBBs of a specific identity. The drop down SBB box will contain all the SBBs that the EclipSLEE plugin was able to find. Choose the one that should be stored in the CMP field, and give it a Scoped Name. This is a variable name and should be a valid Java variable name, and should begin with a lowercase letter.

If an SBB needs to store an SBB of its own type in a CMP field, then the SBB must be created without that CMP field, and the CMP field added later.

Once the CMP field is correct click OK and the wizard CMP page will be updated with the new data.

Repeat until all CMP fields are created, then click Next to edit the SBB's usage parameters:

Figure 6.10. JAIN SLEE SBB Usage Parameters definition in EclipSLEE


Check Create SBB usage interface if you require the SBB usage interface. Then add usage parameters by clicking Add and modifying the values in the table. Two types of parameter are available: increment and sample.

Click Next to move to the event selection dialog, shown below:

Figure 6.11. JAIN SLEE SBB Events selection in EclipSLEE


The event selection dialog contains a list of all the events the plugin could find in your project. This includes any events that were installed as external components.

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 SIP11 Events 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.

For each event that you would like your SBB to fire or receive:

  1. Select the event in the available events table.

  2. Click Select Event; the event will move to the selected events table.

  3. Click Modify... for that event in the selected events table. This will create the following dialog.

    Figure 6.12. JAIN SLEE SBB Event configuration in EclipSLEE


  4. Review the Scoped Name and change it if desired.

  5. Set the event direction.

  6. If the event direction is Receive or FireAndReceive check This is an initial event if it should be an initial event for a service.

  7. If this is an initial event, choose one or more initial event selectors.

  8. Click OK

When all events have been configured the dialog may look something like this:

Figure 6.13. JAIN SLEE SBB Events configured in EclipSLEE


Click Next to define the SBB's profile specifications.

Figure 6.14. JAIN SLEE SBB Profile Specifications selection in EclipSLEE


The profile selection dialog contains a list of all the profiles the plugin could find in your project. This includes any profiles that were installed as external components. If your custom profiles are not listed, verify that they have been compiled and the "jars" folder refreshed.

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 other component profiles specification in 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.

For each profile specification the SBB should reference:

  1. Highlight the profile specification in the available profiles table.

  2. Click Select Profile

  3. Review the Scoped Name and change if required.

  4. If your SBB should contain an Address Profile Specification select it from the drop down list.

Click Next to proceed to the child SBB's dialog.

Figure 6.15. JAIN SLEE SBB Child SBBs selection in EclipSLEE


The child selection dialog contains a list of all the SBBs the plugin could find in your project. This includes any SBBs that were installed as external components. If your custom SBBs are not listed, verify that they have been compiled and the "jars" folder refreshed.

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 HSS Client Enabler in 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.

For each child SBB the SBB should reference:

  1. Highlight the child SBB in the available SBBs table.

  2. Click Select SBB

  3. Review the Scoped Name and change if required.

  4. Set the default priority of the child SBB.

Click Next to proceed to the resource adaptor types dialog.

Figure 6.16. JAIN SLEE SBB Resource Adaptor Type Bindings in EclipSLEE


The Resource Adaptor Type Bindings dialog contains a list of all the resource adaptor types the plugin could find in your project. This includes any resource adaptor types that were installed as external components.

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.

For each resource adaptor type the SBB should reference:

  1. Highlight the resource adaptor type in the available resource adaptor types table.

  2. Click Select RA Type

  3. Optionally, specify the Activity Context Interface Factory Name.

  4. If the RA Type should have resource adaptor entity bindings, click Edit Bindings....

    Figure 6.17. JAIN SLEE SBB Resource Adaptor Type Bindings edit in EclipSLEE


  5. For each binding:

    1. Click Add to create a new binding.

    2. Specify the bindings JNDI object name.

    3. Optionally, specify the resource adaptor entity link name.

  6. Click OK to apply these bindings to the resource adaptor type.

Click Next to edit the SBB's environment entries.

Figure 6.18. JAIN SLEE SBB Environment Entries definition in EclipSLEE


Add an environment entry with the "Add" button. Set its name, type, value, and optionally, description in the table. Do this for each environment entry.

Then click Finish to create the SBB.

Skipping optional steps

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

The SBB Java file, MobicentsDemoSbb.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 sbb-jar.xml deployment descriptor is updated to reflect the new sbb or created if not already present. The resulting workspace can be seen below.

Figure 6.19. JAIN SLEE SBB created in workspace using EclipSLEE


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

Figure 6.20. Editing a JAIN SLEE Service Building Block through class file


It is also possible to edit by right-clicking on the sbb-jar.xml descriptor. In that case a sub-menu allowing to pick which Service Building Block to edit is shown:

Figure 6.21. Editing JAIN SLEE Service Building Blocks through XML descriptor


After selecting the desired Service Building Block, 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 Service Building Block:

This operation can be accessed by selecting Identity... and allows to change the JAIN SLEE Service Building Block identity (name, vendor, version) and it's description. The following dialog is presented:

Figure 6.22. Editing JAIN SLEE Service Building Block 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.

This operation can be accessed by selecting Classes... and allows to change which companion classes for the SBB should exist. The following dialog is presented:

Figure 6.23. Editing JAIN SLEE Service Building Block Classes


Impossible to undo delete operations!

Unchecking an option will delete the corresponding class, an irreversible operation, so it should be used carefully.

This operation can be accessed by selecting Usage Parameters... and allows to change whether an Usage interface should be created and to Add or Remove SBB Usage Parameters. The following dialog is presented:

Figure 6.25. Editing JAIN SLEE Service Building Block Usage Parameters


Impossible to undo delete operations!

Unchecking an option will delete the corresponding class, an irreversible operation, so it should be used carefully.

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

A confirmation dialog similar to the following should be presented:

Figure 6.31. Deleting a JAIN SLEE Service Building Block confirmation dialog


Impossible to undo this operation!

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