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. Editing Existing Modules
3.2.3. 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. It is possible to select from pre-defined High Level component types, with proper component enabled and selected, or to use a custom configuration to freely select the components. The proper Maven modules will be created according to the selection, as well as the Deployable Unit descriptor. You can also opt for using the Mobicents JAIN SLEE 1.1 specific extensions. You can find more information about these extensions on the Mobicents JAIN SLEE User Guide.

Figure 3.4. Selecting Modules for 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, modify 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.

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

Figure 3.8. Selecting "Edit Module" in EclipSLEE


This will present a dialog similar to the New Module dialog. From this dialog it's possible to modify from which other existing modules this one will depend on (Dependency) and which ones will depend on this 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.

Figure 3.9. Editing a JAIN SLEE Module


When done with the desired changes, click on Finish and the affected modules will be updated.

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.10. 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.11. 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. After these dependencies are added, the classpath is updated by running the Maven mobicents:eclipse target.

The entries in the classpath are not only used for the usual project classpath but also for allowing the plugin to find available JAIN SLEE Components for the wizards, to be used in the project, such as Events, RA Types and SBBs relative to the platform Resource Adaptors and Enablers.

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.12. 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

Under Eclipse preferences, go to JavaBuild PathClasspath Variables. Click on New... and fill the values: Name as M2_REPO and Path indicating the path to your Maven local repository (usually located under <user-home>/.m2/repository). Click OK to save and close the dialog, and OK again to close the preferences window.

Figure 3.13. Defining a new Maven dependency in EclipSLEE


You can also use the Component drop-down menu to pick the component Group Id, Artifact and Version from the provided templates. By default it contains the components shipped with the latest Mobicents JAIN SLEE release but it can be customized in the Plugin preferences. See Section 11.2, “Component Templates Configuration” for more information.

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.14. Selecting "Remove Maven Dependency..." in EclipSLEE


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

Figure 3.15. 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.