JBoss.orgCommunity Documentation

Chapter 3. Creating and Managing a JAIN SLEE Project

3.1. Creating a JAIN SLEE Project
3.2. Managing Project Modules
3.2.1. Adding New Modules
3.2.2. Removing Existing Modules
3.3. Managing Project Dependencies
3.3.1. Adding a New Maven Dependency
3.3.2. Removing a Maven Dependency

It is necessary to create a JAIN SLEE project before JAIN SLEE components may be created. This can be done from the workbench by selecting FileNewProject... as illustrated in the following figure.

Figure 3.1. Selecting "New Project..." in Eclipse


This will create a New Project dialog as shown below. From this dialog expand JAIN SLEE, then select the revealed JAIN SLEE Project. Click Next to proceed to chosing a name and location for the new project.

Figure 3.2. Choosing a JAIN SLEE Project


Give the project a name and if desired specify a non-default location. For the majority of people the default location will be fine; this is the current workspace. The following image shows a project with the name of 'MobicentsDemoProject' in the default location. Click Next to proceed to module selection or Finish to go with default (SBBs and Deployable Unit).

Figure 3.3. Choosing Name and Location of the JAIN SLEE Project


Choose the desired project modules to be created, from the list, as shown below. The correct Maven 2 modules will be created according to the selection, as well as the Deployable Unit descriptor.

Service Module

Do not select the "Service" Module as there's currently a problem with it and it will be automatically created even when unselected.

Figure 3.4. Choosing Name and Location of the JAIN SLEE Project


Click on Finish and the project with all the modules will be created in the selected location.

The following image depicts a workspace with a newly created JAIN SLEE project with the project folder, "MobicentsDemoProject", expanded.

Figure 3.5. Newly created project in workspace


It is possible to manage (ie, add and remove) modules once the project is created.

Adding a new module can be done from the workbench by right-clicking the Project element and selecting Add Module<desired module type> as illustrated in the following figure, for a Resource Adaptor Type.

Figure 3.6. Selecting "Add Module" in EclipSLEE


This will create a New Module dialog as shown below. From this dialog it's possible to name the new module and select from which other existing modules this one will depend on (Dependency) and which ones will depend on the new one (Dependant).

Deployable Unit as Dependant

The deployable unit (du) module must always be selected as dependant if the new module should be included in the maven generated Deployable Unit.

Module Name Suffix

The module name will always be suffixed with "-<component_type>" (eg: Using Name "custom" in example will result in "custom-ratype" module) so, avoid including it in the name.

Figure 3.7. Choosing a JAIN SLEE Project


Click on Finish and the new module will be created and dependencies in other modules will be updated to include it.

Removing an existing module can be done from the workbench by right-clicking the Project element and selecting Delete Module<desired module> as illustrated in the following figure, for a Resource Adaptor Type.

Figure 3.8. Selecting "Delete Module" in EclipSLEE


This will present a confirmation dialog to confirm the deletion of the module.

Impossible to undo this operation!

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

Figure 3.9. Module deletion confirmation Dialog


Click on Yes to delete the module and update references in other modules. Clicking No cancels the operation without performing any action.

Maven dependencies for each module can be added or removed using EclipSLEE, with no need to use third-party maven plugins.

Adding a new maven dependency can be done from the workbench by right-clicking the desired module pom file and selecting Add Maven Dependency as illustrated in the following figure.

Figure 3.10. Selecting "Add Maven Dependency" in EclipSLEE


This will create a New Maven Dependency dialog as shown below. From this dialog it's possible to define the dependency Group ID, Artifact ID and Version, as well as the scope with which the dependency should be added (defaulting to "compile"). The Add to classpath? option adds the new maven dependency to the project classpath, considering "M2_REPO" variable is set.

Defining M2_REPO variable in Eclipse

...

Figure 3.11. Defining a new Maven dependency in EclipSLEE


Click on Finish and the new dependency will be added to the module's pom file and, if selected, the classpath updated with the new entry.

Removing a Maven dependency can be done from the workbench by right-clicking the desired module pom file and selecting Remove Maven Dependency...<desired dependency> as illustrated in the following figure.

Figure 3.12. Selecting "Remove Maven Dependency..." in EclipSLEE


This will present a confirmation dialog to confirm the removal of the maven dependency.

Figure 3.13. Maven Dependency removal confirmation Dialog


Click on Yes to remove the maven dependency from the module and, if needed, update the classpath. Clicking No cancels the operation without performing any action.