Access Keys:
Skip to content (Access Key - 0)









Ant Management Tasks

Print this page

Description

Ant management tasks to automate provisioning of SLEE components in Rhino

How do I get it ...

Please register/login to download from DevPortal
( Log in | Sign up )

Ant Introduction

  • What is ant?
    • Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles.
    • The configuration files are XML-based, calling out a target tree where various tasks get executed
    • Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Each task is run by an object that implements a particular Task interface
  • Ant build files are written in XML
  • Each build file contains one project and at least one (default) target
  • Targets contain task elements
  • Each task element of the buildfile can have an id attribute and can later be referred to by the value supplied to this. The value has to be unique
  • A project can have a set of properties. These might be set in the buildfile by the property task, or might be set outside Ant

More information on Ant can found on the Ant project page.

OC Ant Tasks

OpenCloud have developed custom Ant Tasks which can be used in Ant build scripts to deploy and configure SLEE components.

These Tasks include:

  • Packaging Tasks
  • Deployment Tasks
  • Service Tasks
  • Resource adaptors Tasks
  • Profile Tasks

Getting started

It is generally easier to write Ant build files by starting from a working example.

The example applications bundled with Rhino use Ant management scripts, and are good examples of how to automate the compilation and deployment steps.
See examples/sip/build.xml in your Rhino installation for an example.
You also have the Rhino Ant Management API available.

There are two tools which can help us create the build.xml file:

  • The Eclipse plugin creates a build.xml file that help in building and creating components and deployable unit jar files
  • The rhino-export tool creates a build.xml file, which is used to redeploy in any Rhino instance all the components currently deployed
This feature of the rhino-export tool is very useful during the development phase.
A typical approach is to manually install and configure a number of SLEE components, then use rhino-export to create a build.xml file, which can then be used to automate the provisioning steps.
The rhino-export tool is documented in the Rhino administration guide.

Example tasks

Install task

'install' is a Rhino management sub task for installing Deployable Units

It takes the following Ant Parameters:

  • failonerror attribute:
    • Flag to control failure behaviour. If 'true', the sub task will throw a BuildException when an error is encountered. If 'false', the sub task will throw a NonFatalBuildException instead of a BuildException under specific circumstances
    • Required: No. default value is taken from the Rhino management parent task
  • url attribute:
    • URL deployable unit to install
    • Not required if srcfile is specified.
  • srcfile attribute:
    • Path to deployable unit to install
    • Not required if url is specified

For example, to install a deployable unit with a SIP Resource Adaptor, the build.xml file would contain:

<target name="install-ocjainsip-1.2-ra-du" depends="login">
  <slee-management>
    <install srcfile="units/ocjainsip-1.2-ra.jar"
             url="file:lib/ocjainsip-1.2-ra.jar"/>
  </slee-management>
</target>

CreateRAEntity Task

'createraentity' is a Rhino management sub task for creating Resource Adaptor Entities

It takes the following ant Parameters:

  • failonerror attribute:
    • Flag to control failure behaviour. If 'true', the sub task will throw a BuildException when an error is encountered. If 'false', the sub task will throw a NonFatalBuildException instead of a BuildException under specific circumstances
    • Required: No. default value is taken from the Rhino management parent task
  • entityname attribute:
    • Name of the resource adaptor entity to create, this name must be unique within the SLEE
    • Required: Yes
  • resourceadaptorid attribute:
    • Canonical name of the resource adaptor component from which the entity should be created
    • Only required/allowed if the component nested element is not present
  • properties attribute:
    • Properties to be set on the resource adaptor
    • Required: No

There parameters available as nested elements:

  • component element:
    • Identifies the resource adaptor component from which the resource adaptor entity should be created. See SleeComponentElement
    • Only required/allowed if the resourceadaptorid attribute is not present

For example, to create a SIP Resource Adaptor Entity, the build.xml file would contain:

<target name="create-ra-entity-sipra" depends="install-ocjainsip-1.2-ra-du">
  <slee-management>
    <createraentity entityname="sipra"
                    properties="ListeningPoints=0.0.0.0:5060/udp;0.0.0.0:5060/tcp,ExtensionMethods=,OutboundProxy=,
                                UDPThreads=1,TCPThreads=1,OffsetPorts=False,PortOffset=101,RetransmissionFilter=False,
                                AutomaticDialogSupport=False,Keystore=sip-ra-ssl.keystore,KeystoreType=jks,KeystorePassword=,
                                Truststore=sip-ra-ssl.truststore,TruststoreType=jks,TruststorePassword=,CRLURL=,CRLRefreshTimeout=86400,
                                CRLLoadFailureRetryTimeout=900,CRLNoCRLLoadFailureRetryTimeout=60,ClientAuthentication=NEED,
                                MaxContentLength=131072">
      <component name="OCSIP" vendor="Open Cloud" version="1.2"/>
    </createraentity>
    <bindralinkname entityname="sipra" linkname="OCSIP"/>
  </slee-management>
</target>

ActivateService Task

'activateservice' is a Rhino management sub task for activating Services

It takes the following Ant Parameters:

  • failonerror attribute:
    • Flag to control failure behaviour. If 'true', the sub task will throw a BuildException when an error is encountered. If 'false', the sub task will throw a NonFatalBuildException instead of a BuildException under specific circumstances
    • Required: No. default value is taken from the Rhino management parent task
  • serviceid atribute:
    • Canonical name of the service to activate
    • Only required/allowed if the component nested element is not present.

There parameters available as nested elements

  • component element:
    • Identifies the service to activate. See SleeComponentElement
    • Only required/allowed if the serviceid attribute is not present.

For example, to install 3 services based on the SIP protocol, the build.xml file would contain:

<target name="activate-services" depends="install-sip-ac-location-service-du,install-sip-registrar-service-du,install-sip-proxy-service-du">
  <slee-management>
    <activateservice>
      <component name="SIP AC Location Service" vendor="Open Cloud" version="1.5"/>
    </activateservice>
    <activateservice>
      <component name="SIP Registrar Service" vendor="Open Cloud" version="1.5"/>
    </activateservice>
    <activateservice>
      <component name="SIP Proxy Service" vendor="Open Cloud" version="1.5"/>
    </activateservice>
  </slee-management>
</target>

Complete listing of OC Ant management tasks

The Rhino documentation includes the updated list of all the OpenCloud Rhino management tasks. For the complete list, refer to the page All Rhino Ant Tasks.

Adaptavist Theme Builder Powered by Atlassian Confluence