Table of Contents
The component can be installed using specific JBI tasks.
Include the following code into your
build.xml file to reference them :
<path id="jbitask.classpath"> <pathelement location="petals-ant.jar" /> </path> <!-- import taskdef of Petals ant tasks into this ant file--> <taskdef file="taskdef.properties"> <classpath refid="jbitask.classpath"/> </taskdef>
You need to copy in the same directory than your
build.xml file the following resources :
PETALS_HOME/ant/petals-ant.jar
PETALS_HOME/ant/taskdef.properties
To install your component on PEtALS, add the following task in a
target of your build.xml file :
<jbi-install-component file = "file:///home/.../component.zip">
Table 1.1. ANT component installation attributes
| Attribute | Description | Default | Required |
|---|---|---|---|
| host | Target server on which JBI Environment is running. | "localhost" | No |
| port | JMX Remote port on the target server. | "7700" | No |
| username | JMX User name for security. | "" | No |
| password | JMX Password for security. | "" | No |
| file | Fully qualified URL of the component archive location.
Valid URL for Unix-like is
file:///home/.... Valid URL for Windows
is file:///C:/directory/.... The archive
contains a component installation package, as described in the
JBI1.0 specification. | Yes | |
| failOnError | Signal task failure to Ant. true or false. | "true" | No |
| params | Location of a text file (e.g. configuration.properties) that contains name/value pairs corresponding to the configuration properties of the component. | No |
The component can be configured during the installation phase. Each component has its own installation parameters. See the various components guide for specific configuration.
Use the params element of the
jbi-install-component ANT task to configure your
component :
<jbi-install-component file = "file:///home/.../component.zip"/> <param name="attributeName1" value="attributeValue1"/> <param name="attributeName2" value="attributeValue2"/> </jbi-install-component>
Or using a separate property file :
<jbi-install-component file = "file:///home/.../component.zip" params="dir/params.properties"/> where params.properties contains: attributeName1=attributeValue1 attributeName2=attributeValue2
To start, stop or shurdown your component, add the following
task in a target of your build.xml file :
<jbi-start-component name="component-name"/>
<jbi-stop-component name="component-name"/>
<jbi-shut-down-component name="component-name"/>
Table 1.2. ANT component start, stop or shutdown attributes
| Attribute | Description | Default | Required |
|---|---|---|---|
| host | Target server on which JBI Environment is running. | "localhost" | No |
| port | JMX Remote port on the target server. | "7700" | No |
| username | JMX User name for security. | "" | No |
| password | JMX Password for security. | "" | No |
| name | Name of the JBI component in the JBI Environment to start. | Yes | |
| failOnError | Signal task failure to Ant. true or false. | "true" | No |
To uninstall your component from PEtALS, add the following task
in a target of your build.xml file :
<jbi-uninstall-component name="component-name">
Table 1.3. ANT component uninstallation
| Attribute | Description | Default | Required |
|---|---|---|---|
| host | Target server on which JBI Environment is running. | "localhost" | No |
| port | JMX Remote port on the target server. | "7700" | No |
| username | JMX User name for security. | "" | No |
| password | JMX Password for security. | "" | No |
| name | Name of the JBI component in the JBI Environment to start. | Yes | |
| failOnError | Signal task failure to Ant. true or false. | "true" | No |
The component can be automatically installed and started by
copying the archive file into the
$PETALS_HOME/install directory.
![]() | Caution |
|---|---|
The installation and the start of the component are sequentially performed. So you can not configure the component in this mode. To change the default configuration of the component, you need to edit and change the META-INF/jbi.xml file contained in the component archive, before installing it. |
The component can be managed using the JMX administration of PEtALS.
To connect to a PEtALS JMX server with RMI, use the following URI :
service:jmx:rmi:///jndi/rmi://<host>:<port>/management/rmi-jmx-connector
Table 1.4. JMX connection attributes
| Attribute | Description | Default | Required |
|---|---|---|---|
| host | Target server on which JBI Environment is running. | Ytes | |
| port | JMX Remote port on the target server. | Yes | |
| username | JMX User name for security. | "" | No |
| password | JMX Password for security. | "" | No |
The first task is to load the component Installer into the PEtALS environment, which correspond to the bootstrap phase.
Use the InstallationServiceMBean to load a new Installer instance for the component.
The name of the InstallationService MBean is :
Petals:name=Installation,type=service
The method to call is :
ObjectName = loadNewInstaller( componentArchiveURL )
The componentArchiveURI is the fully qualified URI
of the component archive location. Valid URL for Unix-like is
file:///home/.... Valid URL for Windows is
file:///C:/directory/.... The archive contains a
component installation package, as described in the JBI1.0
specification.
The method returns the name of a newly created MBean that represent the Installer of the component. This Installer MBean is specific to this component.
The component can be configured during the installation phase.
Each component has its own installation parameters. See the various
components guide for specific configuration. The component
configuration is managed by its
InstallerConfigurationMBean, which can be retrieved from
the component InstallerMBean.
Retrieve the InstallerConfigurationMBean from the
component InstallerMBean (returned by the
InstallationService loadNewInstaller() method):
InstallerMBeanname, typicallyorg.objectweb.petals:type=installer,name=componentName
The method to access the configuration MBean is :
ObjectName = getInstallerConfigurationMBean()
The method returns the name of the configuration MBean of the component.
![]() | Caution |
|---|---|
The InstallerConfigurationMBean can ony be accessed before the installation phase. |
Set the configuration parameters using this MBean.
The real installation of the component is done with the
component Installer install() method.
Use the InstallerMBean of the component:
InstallerMBeanname, typicallyorg.objectweb.petals:type=installer,name=componentName
The method to install the component is
ObjectName = install()
The method returns the name of a newly created MBean which
represent the lifecyle of the component, which is specific to the
component. The component is in a shutdown state.
The lifecycle of the component is managed thanks to its ComponentLifecycleMBean.
Use the ComponentLifecycleMBean of the component (returned by the Installer install() method) :
ComponentLifecycleMBeanname, typicallyorg.objectweb.petals:type=engine/binding,name=componentName
The methods to start, stop or shutdown the component are
start()stop()shutdown()
The uninstallation of the component is done with the component
Installer uninstall() method.
Use the InstallerMBean of the component:
InstallerMBeanname, typicallyorg.objectweb.petals:type=installer,name=componentName
(you can retrieve the MBean name of the Installer with the
loadInstaller(componentName) from the
InstallationService)
The method to uninstall the component is
uninstall()
![]() | Caution |
|---|---|
The component must be in the |


PEtALS 2.0 & pack (2007/09/28)

![[]](./resources/images/caution.png)

