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>
.
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
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.
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
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"/>
Setting Ant properties for installed applications
The 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
<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 |
prefix.service.vendor |
deployed service’s |
prefix.service.version |
deployed service’s |
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
<sipservlet:resolve url="file:/path/to/myservlet.sar" prefix="myservlet"/>
<sipservlet:deactivate appname="${myservlet.app.name}"/>
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.
The Javadoc for the Rhino SIP Servlet MBeans is available at docs/api/sipservlet-management/index.html .
|