Below are brief introductions to Rhino SIP Servlet’s command-line, Ant, and MBean management interfaces.

(Sections further in this document explain in more detail how they are used for particular tasks.)

Command-line console

The sipservlet-console command is an extension to Rhino’s rhino-console. When you run sipservlet-console, all Rhino management commands are available, plus several SIP Servlet-specific commands. The help command shows the available command categories, including SIP Servlet. For help on a particular category or command, help <category> or help <command>.

Tip For more detail on the SIP Servlet commands, please see the SIP Servlet Console Reference.

Setting CLIENT_HOME

The sipservlet-console script uses the CLIENT_HOME environment variable to locate the Rhino client directory and the rhino-console command. If Rhino SIP Servlet was extracted in the Rhino base directory as recommended, it’s not necessary to set CLIENT_HOME. Otherwise, you must set CLIENT_HOME in the shell to point to the correct location; for example:

$ export CLIENT_HOME=/home/user/rhino/client
$ ./sipservlet-console

RA entity parameter

All Rhino SIP Servlet console commands specify the RA entity name of the SIP Servlet RA entity being managed.

Note The examples throughout this guide assume the RA entity name "ss" (unless noted otherwise).

Ant tasks

Rhino SIP Servlet provides a set of Ant tasks for configuring the SIP Servlet RA and deploying SIP Servlet applications. The complete set of available tasks is described in the Ant.

Below are instructions for:

Enabling SIP Servlet tasks in your Ant build file

To make use of these tasks, an Ant build file must import Rhino SIP Servlet’s common.xml build file, and also declare a namespace prefix for these tasks using their antlib URI, antlib:com.opencloud.sipservlet.ant. For example:

<project name="my-project" xmlns:sipservlet="antlib:com.opencloud.sipservlet.ant">
  <import file="${user.home}/rhino/sipservlet/common.xml"/>

  <target name="deploy-servlet">
    <sipservlet:connect raentity="ss"/>
    <sipservlet:install srcfile="${jars}/my-servlet.sar"/>
    <sipservlet:activate appname="my-servlet"/>
  </target>
  ...
</project>

Here the namespace prefix sipservlet is used, so the tasks are invoked as <sipservlet:connect>, <sipservlet:install>, and so on. The prefix was declared by the xmlns:sipservlet attribute in the root element. The prefix can be anything, as long as it doesn’t conflict with other namespace prefixes declared in the build file.

Note The examples throughout this guide use the sipservlet prefix.

Connecting to an RA entity

The first SIP Servlet task to run in an Ant build must be the task. This establishes the management connection to a SIP Servlet RA entity, which will automatically be used by subsequent SIP Servlet Ant tasks running in the same build. A simple way to do this is to have an initialization target that calls , and ensure that other targets depend on the initialization target.

It’s also possible to have connections to multiple SIP Servlet RA entities in the same build. Here, the script connects to entities "foo" and "bar", and subsequent tasks can select a connection using the optional connectionrefid attribute:

<sipservlet:connect raentity="foo" id="ra1"/>
<sipservlet:connect raentity="bar" id="ra2"/>
...
<sipservlet:install connectionrefid="ra1" srcfile="${jars}/my-servlet.sar"/>
<sipservlet:install connectionrefid="ra2" srcfile="${jars}/my-servlet.sar"/>

All Rhino SIP Servlet Ant tasks support the connectionrefid attribute. If ommitted, the connection from the most recent is used automatically.

Setting Ant properties for installed applications

The optionally sets Ant project properties that can be used to refer to the application’s name and ServiceID in deployment scripts. This is useful because the script may not know these values in advance.

To set these properties when installing, use the optional prefix attribute on the task. For example:

<sipservlet:install srcfile="myservlet.sar" prefix="myservlet"/>

If installation is successful, the following project properties are automatically set:

Property Name Description
prefix.app.name

The deployed servlet application name.

prefix.service.name

deployed service’s ServiceID name.

prefix.service.vendor

deployed service’s ServiceID vendor.

prefix.service.version

deployed service’s ServiceID version.

Now a script can easily install and activate a servlet application, without knowing the ServiceID or application name in advance:

<sipservlet:install srcfile="myservlet.sar" prefix="myservlet"/>
<!-- successful install sets myservlet.app.name property. -->
<sipservlet:activate appname="${myservlet.app.name}"/>

Resolving previously installed applications

Sometimes the method above will not be suitable because it relies on the task running earlier in the script, which will not be the case when applications were already installed before the script was running. In these cases, scripts can use the task. This task looks up applications that are already installed and sets the Ant properties as above. Scripts just need to supply the installed application’s Deployable Unit URL:

<sipservlet:resolve url="file:/path/to/myservlet.sar" prefix="myservlet"/>
<sipservlet:deactivate appname="${myservlet.app.name}"/>

The task uses the url attribute to find an installed SAR deployable unit, and sets the Ant properties based on the servlet application found. If the DU cannot be found, or does not contain a servlet application, then the task will not set any properties, but allows the build to continue.

MBeans

All SIP Servlet management operations are accessible via JMX MBeans, so custom applications may also be used to manage Rhino SIP Servlet. The MBeans are registered with Rhino’s MBean server.

Tip The Javadoc for the Rhino SIP Servlet MBeans is available at docs/api/sipservlet-management/index.html.
Previous page Next page