Mobicents SLEE Container User Guide
Mobicents SLEE Container User Guide
Mobicents SLEE Container User Guide
iii
Mobicents JAIN SLEE User Guide
iv
Preface
1. Document Conventions
This manual uses several conventions to highlight certain words and phrases and draw attention
to specific pieces of information.
In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts [https://
fedorahosted.org/liberation-fonts/] set. The Liberation Fonts set is also used in HTML editions if
the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note:
Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default.
Mono-spaced Bold
Used to highlight system input, including shell commands, file names and paths. Also used to
highlight key caps and key-combinations. For example:
The above includes a file name, a shell command and a key cap, all presented in Mono-spaced
Bold and all distinguishable thanks to context.
Key-combinations can be distinguished from key caps by the hyphen connecting each part of a
key-combination. For example:
The first sentence highlights the particular key cap to press. The second highlights two sets of
three key caps, each set pressed simultaneously.
If source code is discussed, class names, methods, functions, variable names and returned values
mentioned within a paragraph will be presented as above, in Mono-spaced Bold. For example:
File-related classes include filesystem for file systems, file for files, and dir
for directories. Each class has its own associated set of permissions.
Proportional Bold
This denotes words or phrases encountered on a system, including application names; dialogue
box text; labelled buttons; check-box and radio button labels; menu titles and sub-menu titles.
For example:
v
Preface
Choose System > Preferences > Mouse from the main menu bar to launch
Mouse Preferences. In the Buttons tab, click the Left-handed mouse check
box and click Close to switch the primary mouse button from the left to the right
(making the mouse suitable for use in the left hand).
The above text includes application names; system-wide menu names and items; application-
specific menu names; and buttons and text found within a GUI interface, all presented in
Proportional Bold and all distinguishable by context.
Note the > shorthand used to indicate traversal through a menu and its sub-menus. This is to
avoid the difficult-to-follow 'Select Mouse from the Preferences sub-menu in the System menu
of the main menu bar' approach.
Whether Mono-spaced Bold or Proportional Bold, the addition of Italics indicates replaceable or
variable text. Italics denotes text you do not input literally or displayed text that changes depending
on circumstance. For example:
To see the version of a currently installed package, use the rpm -q package
command. It will return a result as follows: package-version-release.
Note the words in bold italics above username, domain.name, file-system, package, version and
release. Each word is a placeholder, either for text you enter when issuing a command or for text
displayed by the system.
Aside from standard usage for presenting the title of a work, italics denotes the first use of a new
and important term. For example:
When the Apache HTTP Server accepts requests, it dispatches child processes
or threads to handle them. This group of child processes or threads is known as
vi
Pull-quote Conventions
a server-pool. Under Apache HTTP Server 2.0, the responsibility for creating and
maintaining these server-pools has been abstracted to a group of modules called
Multi-Processing Modules (MPMs). Unlike other modules, only one module from
the MPM group can be loaded by the Apache HTTP Server.
Source-code listings are also set in Mono-spaced Roman but are presented and highlighted as
follows:
package org.jboss.book.jca.ex1;
import javax.naming.InitialContext;
System.out.println("Created Echo");
vii
Preface
Note
Important
Important boxes detail things that are easily missed: configuration changes that
only apply to the current session, or services that need restarting before an update
will apply. Ignoring Important boxes won't cause data loss but may cause irritation
and frustration.
Warning
A Warning should not be ignored. Ignoring warnings will most likely cause data
loss.
If you have a suggestion for improving the documentation, try to be as specific as possible when
describing it. If you have found an error, please include the section number and some of the
surrounding text so we can find it easily.
viii
Chapter 1.
In addition to the service component model, the SLEE also defines management interfaces used
to administer the container and the service components executing within, and a set of standard
facilities, which provide common features, such as timers, traces and alarms, to JAIN SLEE
components.
Mobicents JAIN SLEE is the first and only open source platform certified for JAIN SLEE 1.1
compliance, providing a highly scalable, event-driven application server with a robust component
model and a fault tolerant execution environment.
Mobicents JAIN SLEE is built on top of the open source award winning JBoss Application Server,
which means that Mobicents JAIN SLEE complements JAIN SLEE with Java Enterprise (JEE) 5
1
Chapter 1. Introduction to Mo...
container features, allowing strong convergence of different application models, for even feature
richer communication services, for instance, the Web and SIP can be combined to achieve a more
sophisticated and natural user experience. Mobicents JAIN SLEE inherits quality management
features and tools from JBoss Application Server, such as the JMX Console, Jopr Plugins and
SNMP Adaptor.
Mobicents JAIN SLEE can also be complemented with Mobicents SIP Servlets and Mobicents
Media Server, providing unique value and integration features not found elsewhere.
2
Chapter 2.
JDK 6
A working installation of the Java Development Kit (JDK) version 6 is required in order to run
the Mobicents JAIN SLEE. Note that the JBoss Application Server is a runtime dependency,
but comes bundled with the binary distribution.
For instructions on how to install the JDK, refer to Appendix A, Java Development Kit (JDK):
Installing, Configuring and Running.
Binary Release
The binary release is a zip file containing an already built binary release of Mobicents JAIN
SLEE
3
Chapter 2. Installing Mobicen...
In this form of installation, simply unzip the downloaded zip file to the directory of your choice on
any operating system that supports the zip format.
Unzip the file to extract the archive contents into the location of your choice. You can do
this using the JDK jar tool (or any other ZIP extraction tool). In the example below we are
assuming you downloaded the zip file was named mobicents-jainslee-2.3.0.FINAL.zip to the /
mobicents directory.
[usr]$ cd /mobicents
[usr]$ jar -xvf mobicents-jainslee-2.3.0.FINAL.zip
You should now have a directory called mobicents-jainslee-2.3.0.FINAL. Next you need to
set your JBOSS_HOME environment variables. This is discussed in Appendix B, Setting the
JBOSS_HOME Environment Variable.
Important
Subversion is used to manage its source code. Instructions for using
Suversion, including install, can be found at http://svnbook.red-bean.com
Use SVN to checkout the specific release source, the base URL is http://
mobicents.googlecode.com/svn/tags/servers/jain-slee/2.x.y/core/ , then add the specific
release version, lets consider 2.3.0.FINAL.
4
Trunk Source Building
Important
Apache Ant 1.6 (or higher) and Maven 2.0.9 (or higher) is used to build the
release. Instructions for using Ant and Maven2, including install, can be found
at http://ant.apache.org and http://maven.apache.org
[usr]$ cd mobicents-slee-core-2.3.0.FINAL/release
[usr]$ ant
5
6
Chapter 3.
Default Profile
The default profile is proper for standalone or pure high availability. It provides the best
performance per cluster node, with linear scaling, but there is no state replication in the cluster,
which means that there is no support for failover, neither there is any kind of state gravitation
(one node sending state so another node continues its work.
All Profile
The all profile is proper for more flexible high availability and failover support. Performance
per node decreases but the cluster does state replication or gravitation.
Profiles can be selected when starting the server, see Section 3.2, “Running Mobicents JAIN
SLEE” for detailed instructions.
3.2.1. Starting
Once installed, you can run server(s) by executing the run.sh (Unix) or run.bat (Microsoft Windows)
startup scripts in the <install_directory>/bin directory (on Unix or Windows).
Server Profile
To specify the server profile use -c profile_name, for instance, to use the all profile then
start the server with -c all
Important
7
Chapter 3. Configuring and Ru...
IP / Host
To specify the IP/Host which the server binds, use -b IP, for instance, to use the 192.168.0.1
IP then start the server with -b 192.168.0.1
Important
3.2.2. Stopping
You can shut down the server(s) you can run server(s) by executing the shutdown.sh -s (Unix)
or shutdown.bat -s (Microsoft Windows) scripts in the <install_directory>/bin directory (on
Unix or Windows). Note that if you properly stop the server, you will see the following three lines
as the last output in the Unix terminal or Command Prompt:
Warning
The Event Router is also able to account performance and load statistics, indicating the number of
activities being assigned or several timings regarding event routing, globally or for each individual
executor/thread. Statistics are turned on by default and may be retrieved through the JMX MBean
org.mobicents.slee:name=EventRouterStatistics.
An important sub-module of the Event Router is the Executor Mapper, which is responsible
for assigning activities to the available executors. JAIN SLEE includes two different Executor
8
Event Router Statistics and Configuration
Mappers. The default one takes into account the hashcode of the activity handle when distributing,
while the alternative uses a round robin algorithm.
Note
The whole Event Router is a critical component with respect to the container's performance. Its
configuration can be tuned, through an XML file and a JMX MBean.
Configuration is done through an XML descriptor for each Section 3.1, “Server Profiles”. The XML
file is named jboss-beans.xml and is located at $JBOSS_HOME/server/profile_name/deploy/
mobicents-slee/META-INF, where profile_name is the server profile name.
<bean name="Mobicents.JAINSLEE.EventRouterConfiguration"
class="org.mobicents.slee.container.management.jmx.EventRouterConfiguration">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=
"org.mobicents.slee:name=EventRouterConfiguration", exposedInterface=
org.mobicents.slee.container.management.jmx.EventRouterConfigurationMBean.class,
registerDirectly=true)</annotation>
<property name="eventRouterThreads">8</property>
<property name="collectStats">true</property>
<property name="executorMapperClassName">
org.mobicents.slee.runtime.eventrouter.mapping.ActivityHashingEventRouterExecutorMapper
</property>
</bean>
9
Chapter 3. Configuring and Ru...
Through JMX, the Event Router module configuration can be changed while the container is
running. These configuration changes are not persisted.
The JMX MBean that can be used to change the Event Router configuration is named
org.mobicents.slee:name=EventRouterConfiguration, and provides getters and setters to
change each property defined in the persistent configuration. See Section 4.4.1, “JMX Console”
for how the JMX Console can be used to use this MBean.
The Timer Facility configuration can be changed through an XML file and a JMX MBean.
Configuration is done through an XML descriptor for each Mobicents Cluster. The XML file is
named jboss-beans.xml and is located at {JBOSS_HOME}/server/{profile_name}/deploy/
mobicents-slee/META-INF
10
Configuring JAIN SLEE Profiles
<bean name="Mobicents.JAINSLEE.TimerFacilityConfiguration"
class="org.mobicents.slee.container.management.jmx.TimerFacilityConfiguration">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=
"org.mobicents.slee:name=TimerFacilityConfiguration",exposedInterface=
org.mobicents.slee.container.management.jmx.TimerFacilityConfigurationMBean.class,
registerDirectly=true)</annotation>
<property name="timerThreads">4</property>
</bean>
The JMX MBean which can be used to change the Timer Facility configuration is named
org.mobicents.slee:name=TimerFacilityConfiguration, and provides getters and setters to
change each property defined in the persistent configuration. The JMX Console can be used to
use this MBean, see Section 4.4.1, “JMX Console”.
There are two configurations for JAIN SLEE Profiles provided as JBoss Microcontainer Beans:
<bean name="Mobicents.JAINSLEE.Profiles.JPA.HSQLDBConfig"
class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
<property name="persistProfiles">true</property>
<property name="clusteredProfiles">false</property>
<property name="hibernateDatasource">java:/DefaultDS</property>
<property name="hibernateDialect">org.hibernate.dialect.HSQLDialect</property>
<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
11
Chapter 3. Configuring and Ru...
</bean>
<bean name="Mobicents.JAINSLEE.Profiles.JPA.PostgreSQLConfig"
class="org.mobicents.slee.container.deployment.profile.jpa.Configuration">
<property name="persistProfiles">true</property>
<property name="clusteredProfiles">true</property>
<property name="hibernateDatasource">java:/PostgresDS</property>
<property name="hibernateDialect">org.hibernate.dialect.PostgreSQLDialect</property>
</bean>
Important
Configurations can be changed, or new ones can be added. For new ones, ensure
that the name attribute of the bean element is unique.
To switch the active configuration simply change the parameter injected in the bean named
Mobicents.JAINSLEE.Container.
12
Other Configurations
<bean name="Mobicents.JAINSLEE.UsageMbeans.Config"
class="org.mobicents.slee.runtime.usage.UsageMBeansConfiguration">
<property name="clusteredUsageMBeans">false</property>
</bean>
There is a single property to configure, named clusteredUsageMBeans, with a boolean value. Set
this property to true if the usage param values should be shared by all cluster nodes. This option
means a significant performance penalty, but makes it possible to learn the current values for the
whole cluster by checking a single node. Use this only if there is no other solution, such as a
management client, that gets the value of each node and then does the appropriate calculations.
<bean name="Mobicents.JAINSLEE.MobicentsManagement"
class="org.mobicents.slee.container.management.jmx.MobicentsManagement">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(
name="org.mobicents.slee:service=MobicentsManagement",
exposedInterface=org.mobicents.slee.container.management.
jmx.MobicentsManagementMBean.class,
registerDirectly=true)</annotation>
<property name="entitiesRemovalDelay">1</property>
<property name="timerThreads">8</property>
<property name="loadClassesFirstFromAS">true</property>
</bean>
13
Chapter 3. Configuring and Ru...
This configuration can be changed with the container running with JMX. Note that such
configuration changes are not persisted.
14
Chapter 4.
Important
The operations done through the JMX Agent are not kept once the server is
shutdown. For instance, if a deployable unit is installed through JMX, and the
server is shutdown, once the server is started again the deployable unit will not
be installed.
Important
By default, the JMX Agent listens to port 1099, and is only available at the host/
ip which the server is bound.
Important
TODO
• Handles the creation, removal, activation, deactivation, link binding and link unbinding of all
Resource Adapter Entities.
15
Chapter 4. Managing Mobicents...
All operations are persistent, which means that unlike management done through JMX, these
survive server shutdowns.
Service (De)Activation
All services contained in the deployable unit jar are activated after the install, and deactivated
prior to uninstall, or server shutdown.
Dependencies Management
The deployer puts the installation process on hold until all of the component's dependencies
are installed and activated. When uninstalling, it waits for all of the components which depend
on components inside the deployable unit to be uninstalled. After an install or uninstall, the
deployer evaluates all operations on hold.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
16
Persistent Deployable Unit Management
<xs:element name="deploy-config">
<xs:complexType>
<xs:sequence>
<xs:element ref="ra-entity" maxOccurs="unbounded" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="property">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="type" type="xs:string" use="required" />
<xs:attribute name="value" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="properties">
<xs:complexType>
<xs:sequence>
<xs:element ref="property" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="file" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="ra-entity">
<xs:complexType>
<xs:sequence>
<xs:element ref="properties" maxOccurs="1" minOccurs="0"/>
<xs:element ref="ra-link" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="resource-adaptor-id" type="xs:string" use="required" />
<xs:attribute name="entity-name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="ra-link">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>
17
Chapter 4. Managing Mobicents...
<ra-entity
resource-adaptor-
id="ResourceAdaptorID[name=JainSipResourceAdaptor,vendor=net.java.slee.sip,version=1.2]"
entity-name="SipRA">
<properties>
<property name="javax.sip.PORT" type="java.lang.Integer" value="5060" />
</properties>
<ra-link name="SipRA" />
</ra-entity>
The deploy-config.xml example above defines a resource adaptor entity named SipRa, to be
created for the resource adaptor with id ResourceAdaptorID[name=JainSipResourceAdaptor,
vendor=net.java.slee.sip, version=1.2], and with a single config property named
javax.sip.PORT of type java.lang.Integer and with value 5060. Additionally, a resource
adaptor link named SipRa should be bound to the resource adaptor entity.
After the deployable unit is installed, the resource adaptor entity is created, activated and the
resource adaptor link is bound. Before the deployable unit is uninstalled, or the server is shutdown,
the link is unbound, then the resource adaptor entity is deactivated, and finally the same resource
adaptor entity is removed.
JAIN SLEE includes some tasks for Apache Ant, which can be used for common management
tasks done through JMX, when the container is running. The tasks come bundled in $JBOSS_HOME/
server/default/deploy/mobicents-slee/lib/ant-tasks.jar. To use these, the Ant script
must include the following code:
<path id="project.classpath">
<fileset dir="${jboss.deploy}/mobicents-slee/lib">
<include name="*.jar" />
</fileset>
<fileset dir="${system.JBOSS_HOME}/client">
18
Ant Tasks
<taskdef name="slee-management"
classname="org.mobicents.ant.MobicentsManagementAntTask"
classpath="${project.classpath}" />
node
This property defines the server configuration profile to be used, for further information about
those refer to Section 3.1, “Server Profiles”.
jnpHost
The host/ip which Mobicents JAIN SLEE is bound.
jnpPort
The port which the JMX Agent is listening.
Important
The property values can be overridden when invoking the Ant script. To do this, use
the parameter -DpropertyName=propertyValue. For example, the server profile
can be changed from default to all using -Dnode=all.
The slee-management task allows a script to manage JAIN SLEE deployable units, services and
resource adapters. The operations, or sub-tasks, are done through JMX.
19
Chapter 4. Managing Mobicents...
The attributes have the same meaning as the properties Section 4.3.2, “Ant Tasks” in the script
code to import the tasks.
The install sub-task installs JAIN SLEE the deployable unit jar pointed by the value of attribute
url. Example of usage:
The uninstall sub-task uninstalls JAIN SLEE the deployable unit jar which was installed from
the value of attribute url. Example of usage:
The activateservice sub-task activates an already installed JAIN SLEE service, with the id
specified by the value of attribute componentid. Example of usage:
The deactivateservice sub-task deactivates an already installed JAIN SLEE service, with the
id specified by the value of attribute componentid. Example of usage:
20
Ant Tasks
The createraentity sub-task creates the resource adaptor entity with the name specified by the
value of attribute entityname, for an already installed JAIN SLEE resource adaptor, with the id
specified by the value of attribute componentid. Example of usage:
The removeraentity sub-task removes the resource adaptor entity with the name specified by
the value of attribute entityname. Example of usage:
The activateraentity sub-task activates the resource adaptor entity with the name specified
by the value of attribute entityname. Example of usage:
21
Chapter 4. Managing Mobicents...
</slee-management>
The deactivateraentity sub-task deactivates the resource adaptor entity with the name
specified by the value of attribute entityname. Example of usage:
The bindralinkname sub-task binds the resource adaptor link with the name specified by the
value of attribute linkname, for an already active JAIN SLEE resource adaptor entity, with the
name specified by the value of attribute entityname. Example of usage:
The unbindralinkname sub-task unbinds the resource adaptor link with the name specified by
the value of attribute linkname. Example of usage:
22
Management Consoles
To access the JMX console once the server is running, point a web browser to http://ip:8080/
jmx-console, where ip is the IP/Host the container is bound. Unless set during start up, the IP/
Host will be 127.0.0.1/localhost by default.
MBeans in the domain javax.slee are all standard JAIN SLEE 1.1 MBeans, while the ones in
the domain org.mobicents.slee are proprietary to Mobicents JAIN SLEE. The following ones
are of particular interest:
org.mobicents.slee:service=MobicentsManagement
the MBean which can be used to make non persistent changes to the server configuration, in
runtime. The operation dumpContainerState displays a textual snapshot of the server's state,
which can be used to quickly look for memory leaks or other debug/profiling related tasks.
org.mobicents.slee:name=DeployerMBean
the MBean allows interaction with the persistent deployable unit deployer. The operation
showStatus displays a textual snapshot of the deployers's state, which can be used to quickly
find out if there is any deployable unit deployment pending, for instance, due to missing
dependencies.
org.mobicents.slee:name=CongestionControlConfiguration
the MBean allows changing or retrieving the Congestion Control feature, with the container
running. Details are provided in section Section 9.2.1, “Congestion Control Configuration”.
Important
For further information about JAIN SLEE 1.1 MBeans and their operations refer to
the JAIN SLEE 1.1 Specification, all are covered with great detail.
23
Chapter 4. Managing Mobicents...
Mobicents JAIN SLEE binary release includes a TWIDDLE CLI in tools/twiddle, with standalone
documentation.
24
Chapter 5.
There are 6 basic log levels used: TRACE, DEBUG, INFO, WARN, ERROR and FATAL.
Logging is organized in categories and appenders. Appenders control destination of log entries.
Different appenders differ in configuration, however each supports threshold. Threshold filters log
entries based on their level. Threshold set to WARN will allow log entry to pass into appender if its
level is WARN, ERROR or FATAL, other entries will be discarded. For more details on appender
configuration please refer to its documentation or java doc.
The logging threshold on the console is INFO, by default. In contrast, there is no threshold set for
the server.log file, so all generated logging messages are logged there.
Categories control level for loggers and its children, for details please refer to log4j manual.
By default Mobicents JAIN SLEE inherits level of INFO from root logger. To make platform add
more detailed logs, file conf/jboss-log4j.xml has to be altered. Explicit category definition for
Mobicents JAIN SLEE looks like:
<category name="org.mobicents.slee">
<priority value="INFO"/>
</category>
This limits the level of logging to INFO for all Mobicents JAIN SLEE classes. It is possible to
declare more categories with different level, to provide logs with greater detail.
For instance, to provide detailed information on Mobicents JAIN SLEE transaction engine in
separate log file(txmanager.log), file conf/jboss-log4j.xml should contain entries as follows:
25
Chapter 5. Logging, Traces an...
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.home.dir}/log/txmanager.log"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="500KB"/>
<param name="MaxBackupIndex" value="1"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
</layout>
</appender>
<category name="org.mobicents.slee.runtime.transaction">
<priority value="DEBUG" />
<appender-ref ref="TXMANAGER"/>
</category>
This creates a new file appender and specifies that it should be used by the logger (or category)
for the package org.mobicents.slee.runtime.transaction.
The file appender is set up to produce a new log file every day rather than producing a new
one every time you restart the server or writing to a single file indefinitely. The current log file is
txmanager.log. Older files have the date they were written added to their filenames.
Level
• DEBUG: More verbose logging, mostly using DEBUG/TRACE level, displaying message
of interest for developers;
• PRODUCTION: Low verbosity and async logging, mostly in WARN level, for systems in
production so that logging does impact performance.
JMX Operation
26
Alarm Facility
Custom presets can be easily deployed in the application server too. Simply name the
configuration file as jboss-log4j.xml.PRESET_NAME, where PRESET_NAME should be unique
preset name, and copy it to directory $JBOSS_HOME/server/profile_name/deploy/mobicents-
slee/log4j-templates, where profile_name is the server profile name.
Note
These procedures changes the whole JBoss Application Server Platform logging
configuration, so it will affect also logging for other running applications besides
the JAIN SLEE container.
Alarm notifications are intended for consumption by management clients external to the SLEE.
The management client is responsible for registering to receive alarm notifications generated
by the Alarm Facility through the external management interface of the Alarm Facility. The
management client may optionally provide notification filters so that only the alarm notifications
that the management client would like to receive are transmitted to the management client.
For further information on how to use JAIN SLEE Alarm Facility and receive JMX notifications
refer to the JAIN SLEE 1.1 Specification.
Within the SLEE, notification sources use a tracer to emit trace messages. A tracer is a named
entity. Tracer names are case-sensitive and follow the Java hierarchical naming conventions. A
tracer is considered to be an ancestor of another tracer if its name followed by a dot is a prefix
of the descendant tracer’s name. A tracer is considered to be a parent of a tracer if there are no
ancestors between itself and the descendant tracer. For example, the tracer named com is the
parent tracer of the tracer named com.foo and an ancestor of the tracer named com.foo.bar.
27
Chapter 5. Logging, Traces an...
All tracers are implicitly associated with a notification source, which identifies the object in the
SLEE that is emitting the trace message and is included in trace notifications generated by the
Trace MBean on behalf of the tracer. For instance, an SBB notification source is composed by
the SBB id and the Service id.
Important
Multiple notification sources may have tracers with same name in SLEE.
Comparing with common logging frameworks, this would mean that the notification
source would be part of the log category or name.
For further information on how to use JAIN SLEE Trace Facility and receive JMX notifications
refer to the JAIN SLEE 1.1 Specification.
Mobicents JAIN SLEE Tracers additionally log messages to Apache Log4j, being the log4j
category, for notification source X, defined as javax.slee. concatenated with the X.toString().
For instance, the full log4j logger name for tracer named GoogleTalkBotSbb, of sbb
notification source with SbbID[name=GoogleTalkBotSbb,vendor=mobicents,version=1.0]
and ServiceID[name=GoogleTalkBotService,vendor=mobicents,version=1.0], would be
javax.slee.SbbNotification[service=ServiceID[name=GoogleTalkBotService,
vendor=mobicents,version=0.1],
sbb=SbbID[name=GoogleTalkBotSbb,vendor=mobicents,
version=0.1]].GoogleTalkBotSbb (without the spaces or breaks), which means a log4j
category defining its level as DEBUG could be:
<category
name="javax.slee.SbbNotification[service=ServiceID[name=GoogleTalkBotService,
vendor=mobicents,version=0.1],sbb=SbbID[name=GoogleTalkBotSbb,
vendor=mobicents,version=0.1]]">
<priority value="DEBUG" />
</category>
The relation of JAIN SLEE tracers and log4j loggers goes beyond log4j showing tracer's
messages, changing the tracer's log4j logger effective level changes the tracer level in SLEE,
and vice-versa. Since JAIN SLEE tracer levels differ from log4j logger levels a mapping is needed:
28
JAIN SLEE Tracers and Log4j
Table 5.1. Mapping JAIN SLEE Tracer Levels with Apache Log4j Logger
Levels
29
30
Chapter 6.
default
This configuration provides no state replication. It is best used for pure high availability cluster
setups.
all
This configuration provides state replication, and is useful for fault tolerance cluster setups.
All activity context and SBB entity data is replicated across the cluster.
Timers are failed over. All timers running in a node that leaves the cluster, or fails, are
recreated in another node.
Events are not failed over due to performance restraints. This means that an event fired will
be lost if its cluster node fails before it is routed.
Important
JAIN SLEE reuses the JBoss Application Server clustering framework, and if all
nodes of a cluster are in the same network then the underlying JBoss Application
Server clustering will automatically handle the discovery of new cluster nodes
and join these to the cluster. For more complicated setups, refer to the JBoss
Application Server clustering documentation.
Service Activation
JAIN SLEE Service started events are only fired on the first cluster node started.
Service Deactivation
Only the last node will force the removal of the service's SBB entities.
31
Chapter 6. High Availability ...
The JAIN SLEE 1.1 RA API is a major milestone, standardizing RA and JSLEE contract.
Unfortunately it is not enough, it misses an API for clustering, and that is critical for a RA working
with a clustered JAIN SLEE. Contarct does not define any fault tolerant data source nor callbacks
to inform on cluster state.
The Fault Tolerant RA API extends the JAIN SLEE 1.1 RA API, providing missing features related
to clustering, and it does it in a very familiar way, anyone who develops a JAIN SLEE 1.1 RA
easily uses our proprietary API.
The FaultTolerant interface provides three new callback methods used by the container:
setFaultTolerantResourceAdaptorContext(FaultTolerantResourceAdaptorContext
context)
This method provides the RA with the
org.mobicents.slee.resource.cluster.FaultTolerantResourceAdaptorContext
object, which gives access to facilities related with the cluster. This method is invoked by SLEE
right after invoking setResourceAdaptorContext( ResourceAdaptorContext context)
from JAIN SLEE 1.1 specs.
unsetFaultTolerantResourceAdaptorContext()
This method indicates that the RA should remove any references it has to the
FaultTolerantResourceAdaptorContext, as it is not valid anymore. The method is invoked by
SLEE before invoking unsetResourceAdaptorContext() from JAIN SLEE 1.1 specs.
failOver(K key)
Callback from SLEE when the local RA was selected to recover the state for a replicated data
key, which was owned by a cluster member that failed. The RA may then restore any runtime
resources associated with such data.
32
The Fault Tolerant Resource Adaptor Context And Replicated Data Sources
dataRemoved(K key)
Optional callback from SLEE when the replicated data key was removed from the cluster, this
may be helpful when the local RA maintains local state.
ReplicatedData
A container for serializable data, which is replicated in the SLEE cluster, but don't require any
failover.
ReplicatedDataWithFailover
A ReplicatedData which requires fail over callbacks, this means, that for all data stored
here, when a cluster member goes down, the SLEE in another cluster member will invoke the
failOver(Key k) callback in the Fault Tolerant RA object.
When retrieved from the context through a boolean parameter, both types of ReplicatedData
can activate the callback on the FaultTolerantResourceAdaptor which indicates that a specific
data was removed from the cluster remotely.
Note
The activity replication doesn't mean that the activity object is replicated by any
means, only the related Activity Handle. The Resource Adaptor must use the Fault
33
Chapter 6. High Availability ...
Tolerant RA API or its own means to replicate any additional data to support that
presence of the activity in all nodes of the cluster. Usage of the Fault Tolerant RA
API is recommended since it reuses the clustering setup of the container.
34
Chapter 7.
JAIN SLEE provides two different implementations of the API, one for access in the same JVM,
another for remote access. Both implementations expose the SLEE Connection Factory in the
local JNDI tree, thus the same code is used by the application independently of the implementation
used.
JAIN SLEE container instances always expose the local SLEE Connection Factory in its JVM,
which means that an external application running in the same JVM doesn't need any additional
tools or setup to use it.
JAIN SLEE includes a tool, named Remote SLEE Connection Tool, which is a JCA connector
that can be deployed in any Java EE application server. Once deployed this connector installs the
factory into JNDI, which communicates with the remote SLEE container through RMI.
Mobicents Remote SLEE Connection Tool is bundled in all Mobicents JAIN SLEE releases, in the
tools/remote-slee-connection directory, including its own documentation.
Below is example code which retrieves the SLEE Connection Factory and uses it to fire an event
into the JAIN SLEE container. The code is the same whether the SLEE container is in the same
JVM or not.
35
Chapter 7. Firing Events from...
// creates the activity handle which will be used to fire the event
ExternalActivityHandle handle = connection.createActivityHandle();
36
Chapter 8.
The extensions were discussed among multiple JAIN SLEE vendors, and should become part of
the standard in next revision, but there is no guarantee that portability won't be lost when using
those.
Java archives (JARs) with compiled classes, javadocs and sources are available in
the JBoss Maven Repository at http://repository.jboss.org/nexus/content/groups/public/org/
mobicents/servers/jainslee/api/jain-slee-11-ext/1.0.0.BETA1/
package org.mobicents.slee;
import javax.slee.ActivityContextInterface;
import javax.slee.Sbb;
import javax.slee.SbbContext;
import javax.slee.facilities.ActivityContextNamingFacility;
import javax.slee.facilities.AlarmFacility;
import javax.slee.facilities.TimerFacility;
import javax.slee.nullactivity.NullActivityContextInterfaceFactory;
import javax.slee.nullactivity.NullActivityFactory;
import javax.slee.profile.ProfileFacility;
import javax.slee.profile.ProfileTableActivityContextInterfaceFactory;
import javax.slee.resource.ResourceAdaptorTypeID;
import javax.slee.serviceactivity.ServiceActivityContextInterfaceFactory;
import javax.slee.serviceactivity.ServiceActivityFactory;
37
Chapter 8. JAIN SLEE 1.1 Exte...
38
ProfileContext Extension
package org.mobicents.slee;
import javax.slee.facilities.AlarmFacility;
import javax.slee.profile.Profile;
import javax.slee.profile.ProfileContext;
39
Chapter 8. JAIN SLEE 1.1 Exte...
package org.mobicents.slee;
import javax.slee.ActivityContextInterface;
import javax.slee.facilities.TimerID;
The usage of the standard Library component is very limited, each Library can only refer other
Library components. Due to this limitation a developer may not be able to include classes in a
Library that depend, just as example, on Resource Adaptor Type interfaces, unless of course
those interfaces are in a Library too.
This extension allows libraries to reference other component types, which the developer should
use when the classes in the Library need to use classes from that component, by simply extending
the JAIN SLEE 1.1 Library Jar XML descriptor.
<!--
The library element defines a library. It contains an optional description
about the library, the name, vendor, and version of the library being defined,
zero or more references to any other components that this library
40
Extended Library Jar XML Descriptor DTD
depends on, and information about zero or more jar files that contain
prepackaged classes and resources to be included with the library.
The classes and resources for a library are the sum total of the classes and
resources contained in:
- the library component jar itself (if any)
- the library jars specified by the jar elements (if any)
<!--
The event-type-ref element identifies an event type that the library classes depend.
It contains the name, vendor,and version of the event type.
<!--
The event-type-name element contains the name of an event type referred by
the library.
Example:
<event-type-name>
javax.csapi.cc.jcc.JccCallEvent.CALL_CREATED
</event-type-name>
-->
<!ELEMENT event-type-name (#PCDATA)>
<!--
The event-type-vendor element contains the vendor of an event type referred by
the library
41
Chapter 8. JAIN SLEE 1.1 Exte...
Example:
<event-type-vendor>javax.csapi.cc.jcc</event-type-vendor>
-->
<!ELEMENT event-type-vendor (#PCDATA)>
<!--
The event-type-version element contains the version of an event type referred by
the library
Example:
<event-type-version>1.1</event-type-version>
-->
<!ELEMENT event-type-version (#PCDATA)>
<!--
The profile-spec-ref element identifies an profile specification that the library
classes depend. It contains an optional description about the reference, and the
name, vendor, and version of the referenced profile specification.
<!--
The profile-spec-name element contains the name of a profile specification
component.
Example:
<profile-spec-name>AddressProfileSpec</profile-spec-name>
-->
<!ELEMENT profile-spec-name (#PCDATA)>
<!--
The profile-spec-vendor element contains the vendor of a profile specification
component.
Example:
42
Extended Library Jar XML Descriptor DTD
<profile-spec-name>javax.slee</profile-spec-name>
-->
<!ELEMENT profile-spec-vendor (#PCDATA)>
<!--
The profile-spec-version element contains the version of a profile
specification component.
Example:
<profile-spec-version>1.0</profile-spec-version>
-->
<!ELEMENT profile-spec-version (#PCDATA)>
<!--
The resource-adaptor-type-ref element identifies an resource adaptor type that the
library classes depend. It contains the name, vendor,and version of the RA type.
<!--
The resource-adaptor-type-name element contains the name of a resource
adaptor type component referred by the library.
Example:
<resource-adaptor-type-name>JCC</resource-adaptor-type-name>
-->
<!ELEMENT resource-adaptor-type-name (#PCDATA)>
<!--
The resource-adaptor-type-vendor element contains the vendor of a resource
adaptor type component referred by the library.
Example:
<resource-adaptor-type-vendor>
javax.csapi.cc.jcc
43
Chapter 8. JAIN SLEE 1.1 Exte...
</resource-adaptor-type-vendor>
-->
<!ELEMENT resource-adaptor-type-vendor (#PCDATA)>
<!--
The resource-adaptor-type-version element contains the version of a resource
adaptor type component referred by the library.
Example:
<resource-adaptor-type-version>1.1</resource-adaptor-type-version>
-->
<!ELEMENT resource-adaptor-type-version (#PCDATA)>
<!--
The sbb-ref element identifies an SBB that the library classes depend.
It contains the name, vendor,and version of the SBB.
<!--
The sbb-name element contains the name of a SBB component referred
by the library.
Example:
<sbb-name>MySbb</sbb-name>
-->
<!ELEMENT sbb-name (#PCDATA)>
<!--
The sbb-vendor element contains the vendor of a SBB component referred
by the library.
Example:
<sbb-vendor>My Company, Inc.</sbb-vendor>
44
Extended Library Jar XML Descriptor DTD
-->
<!ELEMENT sbb-vendor (#PCDATA)>
<!--
The sbb-version element contains the version of a SBB component referred
by the library.
Example:
<sbb-version>1.0</sbb-version>
-->
<!ELEMENT sbb-version (#PCDATA)>
<!--
The ID mechanism is to allow tools that produce additional deployment
information (ie. information beyond that contained by the standard SLEE
deployment descriptors) to store the non-standard information in a separate
file, and easily refer from those tools-specific files to the information in
the standard deployment descriptor. The SLEE architecture does not allow the
tools to add the non-standard information into the SLEE-defined deployment
descriptors.
-->
<!ATTLIST library-jar id ID #IMPLIED>
<!ATTLIST description id ID #IMPLIED>
<!ATTLIST library id ID #IMPLIED>
<!ATTLIST library-name id ID #IMPLIED>
<!ATTLIST library-vendor id ID #IMPLIED>
<!ATTLIST library-version id ID #IMPLIED>
<!ATTLIST event-type-ref id ID #IMPLIED>
<!ATTLIST event-type-name id ID #IMPLIED>
<!ATTLIST event-type-vendor id ID #IMPLIED>
<!ATTLIST event-type-version id ID #IMPLIED>
<!ATTLIST library-ref id ID #IMPLIED>
<!ATTLIST profile-spec-ref id ID #IMPLIED>
<!ATTLIST profile-spec-name id ID #IMPLIED>
<!ATTLIST profile-spec-vendor id ID #IMPLIED>
<!ATTLIST profile-spec-version id ID #IMPLIED>
<!ATTLIST resource-adaptor-type-ref id ID #IMPLIED>
<!ATTLIST resource-adaptor-type-name id ID #IMPLIED>
<!ATTLIST resource-adaptor-type-vendor id ID #IMPLIED>
<!ATTLIST resource-adaptor-type-version id ID #IMPLIED>
<!ATTLIST sbb-ref id ID #IMPLIED>
<!ATTLIST sbb-name id ID #IMPLIED>
45
Chapter 8. JAIN SLEE 1.1 Exte...
<library-jar>
<library>
<library-name>extended-library-example</library-name>
<library-vendor>com.redhat</library-vendor>
<library-version>1.0</library-version>
<event-type-ref>
<event-type-name>ExampleX</event-type-name>
<event-type-vendor>com.redhat</event-type-vendor>
<event-type-version>1.0</event-type-version>
</event-type-ref>
<library-ref>
<library-name>LibraryX</library-name>
<library-vendor>com.redhat</library-vendor>
<library-version>1.0</library-version>
</library-ref>
<profile-spec-ref>
<profile-spec-name>ProfileX</profile-spec-name>
<profile-spec-vendor>com.redhat</profile-spec-vendor>
<profile-spec-version>1.0</profile-spec-version>
46
Extended Library Jar XML Descriptor Example
</profile-spec-ref>
<resource-adaptor-type-ref>
<resource-adaptor-type-name>ResourceAdaptorTypeX</resource-adaptor-type-name>
<resource-adaptor-type-vendor>com.redhat</resource-adaptor-type-vendor>
<resource-adaptor-type-version>1.0</resource-adaptor-type-version>
</resource-adaptor-type-ref>
<sbb-ref>
<sbb-name>SbbX</sbb-name>
<sbb-vendor>com.redhat</sbb-vendor>
<sbb-version>1.0</sbb-version>
</sbb-ref>
</library>
</library-jar>
Important
Note how the DOCTYPE element is set to the extended DTD instead of the
standard one.
47
48
Chapter 9.
Advanced Topics
9.1. Class Loading
Each JAIN SLEE Component has its own classloader (ComponentClassLoader) in the
package named org.mobicents.slee.container.component.deployment.classloading.
This classloader sees the component classes contained in the component jar
(URLClassLoaderDomain) by declaring it as the parent classloader, and adding the classes seen
by each component it refers. It does not see classes from a component that it does not depend on.
JAIN SLEE defines a class loading domain with the APIs required in the JAIN SLEE 1.1
container (for example, JAIN SLEE, JBDC and JMX). This domain (JBoss Microcontainer
ClassLoadingDomain) imports all classes shared in the JBoss Application Server, and acts like
the parent domain for all URLClassLoaderDomains, which means that a class imported by a SLEE
classloading domain will always be used first.
• The SIP INVITE Event component refers to the JAIN SIP Library in its XML descriptor, and
its classloader domain depends on the classloader domain of the JAIN SIP Library.
49
Chapter 9. Advanced Topics
• The SIP RA Type component refers to all Events in the SIP RA Event jar in its XML descriptor,
and its classloader domain depends on the classloader domain of the SIP Event JAR and
inherits its dependencies, including the JAIN SIP library classloading domain.
• The SIP RA component refers to the SIP RA Type component in its XML descriptor, and its
classloader domain depends on the classloader domain of the SIP RA Type Component jar,
and inherits its dependencies. This includes the SIP Event jar and JAIN SIP library classloading
domains.
• The SBB component refers to the SIP RA Type component and SIP INVITE Event in its
XML descriptor. Its classloader domain depends on the class loader domain of the SIP RA
Type Component jar, and inherits its dependencies; the SIP Event jar and the JAIN SIP library
classloading domains. It also depends on the classloader domain of the SIP Event jar.
Important
JBoss Application Server does not see the classes of deployed JAIN SLEE
components. This means that if it exports its classes for components that are
complemented with Java EE components, the common classes must be deployed
on JBoss Application Server, either directly or included in the Java EE component.
50
Congestion Control Configuration
<bean name="Mobicents.JAINSLEE.CongestionControlConfiguration"
class="org.mobicents.slee.container.management.jmx.CongestionControlConfiguration">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=
"org.mobicents.slee:name=CongestionControlConfiguration",exposedInterface=
org.mobicents.slee.container.management.jmx.CongestionControlConfigurationMBean.class,
registerDirectly=true)</annotation>
<property name="periodBetweenChecks">0</property>
<property name="minFreeMemoryToTurnOn">10</property>
<property name="minFreeMemoryToTurnOff">20</property>
<property name="refuseStartActivity">true</property>
<property name="refuseFireEvent">false</property>
</bean>
51
Chapter 9. Advanced Topics
The JMX MBean which can be used to change the Congestion Control configuration is
named org.mobicents.slee:name=CongestionControlConfiguration, and provides getters
and setters to change each property defined in the persistent configuration. The JMX Console can
be used to use this MBean, see Section 4.4.1, “JMX Console”.
This table has a primary key composed by the profile name and profile table name, and a column
for each attribute of the Profile Specification CMP, except for those of array type. Those columns
are named C, concatenated with the cmp attribute name.
For each Profile CMP attribute of array type, a join table is created, and is named
SLEE_PEAAV_ concatenated with the Profile CMP interface simple name (obtained as
52
Profile Specification JPA Datasource
SERIALIZABLE
Used to store the value if its type does not allow it to be converted to a String.
STRING
Used when the CMP attribute type can be converted to a java.lang.String, for instance
an Integer.
1. Checkout and build the container source code as explained in Chapter 2, Installing Mobicents
JAIN SLEE.
cd tck/jain-slee-1.1
mvn install
unzip testsuite.zip
cd testsuite
ant
Important
53
Chapter 9. Advanced Topics
1. In the checked out directory of the project, and with Eclipse IDE closed, open a terminal.
]mvn mobicents:eclipse
mvn -Declipse.workspace=YOUR_RELATIVE_PATH_TO_ECLIPSE_WORKSPACE
eclipse:add-maven-repo
• Install the M2Eclipse plugin and use "Import..." and subselect the "Maven Projects" feature.
Important
54
Appendix A. Java Development Kit
(JDK): Installing, Configuring and
Running
The Mobicents Platform is written in Java; therefore, before running any Mobicents server, you
must have a working Java Runtime Environment (JRE) or Java Development Kit (JDK) installed
on your system. In addition, the JRE or JDK you are using to run Mobicents must be version
1
5 or higher .
Should I Install the JRE or JDK? Although you can run Mobicents servers using the Java
Runtime Environment, we assume that most users are developers interested in developing Java-
based, Mobicents-driven solutions. Therefore, in this guide we take the tact of showing how to
install the full Java Development Kit.
Should I Install the 32-Bit or the 64-Bit JDK, and Does It Matter? Briefly stated: if you are
running on a 64-Bit Linux or Windows platform, you should consider installing and running the 64-
bit JDK over the 32-bit one. Here are some heuristics for determining whether you would rather
run the 64-bit Java Virtual Machine (JVM) over its 32-bit cousin for your application:
• Wider datapath: the pipe between RAM and CPU is doubled, which improves the performance
of memory-bound applications when using a 64-bit JVM.
• 64-bit memory addressing gives virtually unlimited (1 exabyte) heap allocation. However large
heaps affect garbage collection.
• Applications that run with more than 1.5 GB of RAM (including free space for garbage collection
optimization) should utilize the 64-bit JVM.
• Applications that run on a 32-bit JVM and do not require more than minimal heap sizes will gain
nothing from a 64-bit JVM. Barring memory issues, 64-bit hardware with the same relative clock
speed and architecture is not likely to run Java applications faster than their 32-bit cousin.
Note that the following instructions detail how to download and install the 32-bit JDK, although the
steps are nearly identical for installing the 64-bit version.
Downloading. You can download the Sun JDK 5.0 (Java 2 Development Kit) from Sun's
website: http://java.sun.com/javase/downloads/index_jdk5.jsp. Click on the Download link next
to "JDK 5.0 Update <x>" (where <x> is the latest minor version release number). On the next
page, select your language and platform (both architecture—whether 32- or 64-bit—and operating
1
At this point in time, it is possible to run most Mobicents servers, such as the JAIN SLEE, using a Java 6 JRE or JDK.
Be aware, however, that presently the XML Document Management Server does not run on Java 6. We suggest checking
the Mobicents web site, forums or discussion pages if you need to inquire about the status of running the XML Document
Management Server with Java 6.
55
Appendix A. Java Development ...
system), read and agree to the Java Development Kit 5.0 License Agreement, and proceed
to the download page.
The Sun website will present two download alternatives to you: one is an RPM inside a self-
extracting file (for example, jdk-1_5_0_16-linux-i586-rpm.bin), and the other is merely a self-
extracting file (e.g. jdk-1_5_0_16-linux-i586.bin). If you are installing the JDK on Red Hat
Enterprise Linux, Fedora, or another RPM-based Linux system, we suggest that you download
the self-extracting file containing the RPM package, which will set up and use the SysV service
scripts in addition to installing the JDK. We also suggest installing the self-extracting RPM file if
you will be running Mobicents in a production environment.
Installing. The following procedures detail how to install the Java Development Kit on both
Linux and Windows.
• Regardless of which file you downloaded, you can install it on Linux by simply making sure
the file is executable and then running it:
Important
You do not need to install a -compat package in addition to the JDK if you installed
the self-extracting RPM file! The -compat package merely performs the same SysV
service script set up that the RPM version of the JDK installer does.
• Using Explorer, simply double-click the downloaded self-extracting installer and follow the
instructions to install the JDK.
56
Configuring. Configuring your system for the JDK consists in two tasks: setting the JAVA_HOME
environment variable, and ensuring that the system is using the proper JDK (or JRE) using the
alternatives command. Setting JAVA_HOME usually overrides the values for java, javac and
java_sdk_1.5.0 in alternatives, but we will set them all just to be safe and consistent.
Setting the JAVA_HOME Environment Variable on Linux. You can determine whether
JAVA_HOME is set on your system by echoing it on the command line:
If JAVA_HOME is not set already, then you must set its value to the location of the JDK installation
on your system. You can do this by adding two lines to your personal ~/.bashrc configuration
file. Open ~/.bashrc (or create it if it doesn't exist) and add a line similar to the following one
anywhere inside the file:
export JAVA_HOME="/usr/lib/jvm/jdk1.5.0_<version>"
You should also set this environment variable for any other users who will be running
Mobicents (any environment variables exported from ~/.bashrc files are local to that user).
As the root user, call /usr/sbin/alternatives with the --config java option to select
between JDKs and JREs installed on your system:
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
2 /usr/lib/jvm/jre-1.6.0-sun/bin/java
*+ 3 /usr/lib/jvm/jre-1.5.0-sun/bin/java
57
Appendix A. Java Development ...
In our case, we want to use the Sun JDK, version 5, that we downloaded and installed, to
run the java executable. In the alternatives information printout above, a plus (+) next to a
number indicates the one currently being used. As per alternatives' instructions, pressing
Enter will simply keep the current JVM, or you can enter the number corresponding to the
JVM you would prefer to use.
Repeat the procedure above for the javac command and the java_sdk_1.5.0 environment
variable, as the root user:
Testing. Finally, to make sure that you are using the correct JDK or Java version (5 or higher),
and that the java executable is in your PATH, run the java -version command in the terminal
from your home directory:
Uninstalling. There is usually no reason (other than space concerns) to remove a particular
JDK from your system, given that you can switch between JDKs and JREs easily using
alternatives, and/or by setting JAVA_HOME.
Uninstalling the JDK on Linux. On RPM-based systems, you can uninstall the JDK using the
yum remove <jdk_rpm_name> command.
Uninstalling the JDK on Windows. On Windows systems, check the JDK entry in the Start
menu for an uninstall command, or use Add/Remove Programs.
58
Appendix B. Setting the
JBOSS_HOME Environment Variable
The Mobicents Platform (Mobicents) is built on top of the JBoss Application Server. You
do not need to set the JBOSS_HOME environment variable to run any of the Mobicents Platform
servers unless JBOSS_HOME is already set.
The best way to know for sure whether JBOSS_HOME was set previously or not is to perform a
simple check which may save you time and frustration.
Checking to See If JBOSS_HOME is Set on Unix. At the command line, echo $JBOSS_HOME
to see if it is currently defined in your environment:
The Mobicents Platform and most Mobicents servers are built on top of the JBoss Application
Server (JBoss Application Server). When the Mobicents Platform or Mobicents servers are
built from source, then JBOSS_HOME must be set, because the Mobicents files are installed into (or
“over top of” if you prefer) a clean JBoss Application Server installation, and the build process
assumes that the location pointed to by the JBOSS_HOME environment variable at the time of
building is the JBoss Application Server installation into which you want it to install the Mobicents
files.
This guide does not detail building the Mobicents Platform or any Mobicents servers from source.
It is nevertheless useful to understand the role played by JBoss AS and JBOSS_HOME in the
Mobicents ecosystem.
The immediately-following section considers whether you need to set JBOSS_HOME at all and, if
so, when. The subsequent sections detail how to set JBOSS_HOME on Unix and Windows
Important
Even if you fall into the category below of not needing to set JBOSS_HOME, you may
want to for various reasons anyway. Also, even if you are instructed that you do
not need to set JBOSS_HOME, it is good practice nonetheless to check and make
sure that JBOSS_HOME actually isn't set or defined on your system for some reason.
This can save you both time and frustration.
59
Appendix B. Setting the JBOSS...
• ...you have installed a Mobicents server binary distribution which bundles JBoss Application
Server.
• ...you are installing the Mobicents Platform or any of the Mobicents servers from source.
• ...you are installing the Mobicents Platform binary distribution, or one of the Mobicents server
binary distributions, which do not bundle JBoss Application Server.
Naturally, if you installed the Mobicents Platform or one of the Mobicents server binary releases
which do not bundle JBoss Application Server, yet requires it to run, then you should install
before setting JBOSS_HOME or proceeding with anything else.
Setting JBOSS_HOME in your personal ~/.bashrc startup script carries the advantage of retaining
effect over reboots. Each time you log in, the environment variable is sure to be set for you, as a
user. On Unix, it is possible to set JBOSS_HOME as a system-wide environment variable, by defining
it in /etc/bashrc, but this method is neither recommended nor detailed in these instructions.
1. Open the ~/.bashrc startup script, which is a hidden file in your home directory, in a text
editor, and insert the following line on its own line while substituting for the actual install
location on your system:
export JBOSS_HOME="/home/<username>/<path>/<to>/<install_directory>"
3. You should source the .bashrc script to force your change to take effect, so that JBOSS_HOME
1
becomes set for the current session .
4. Finally, ensure that JBOSS_HOME is set in the current session, and actually points to the correct
location:
1
Note that any other terminals which were opened prior to your having altered .bashrc will need to source
~/.bashrc as well should they require access to JBOSS_HOME.
60
You MUST set JBOSS_HOME if...
Note
For information on how to set environment variables in recent versions of Windows, refer to http://
support.microsoft.com/kb/931715.
61
62
Appendix C. Revision History
Revision History
Revision 1.0 Tue Dec 22 2009 EduardoMartins
Creation of the Mobicents JAIN SLEE 2.x User Guide.
63
64
Index
F
feedback, viii
65
66