Petals ANT Tasks 2.4.0+

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (5)

View Page History

Petals ESB provides support for managing the system using the scripting language [Apache Ant 1.5 (or newer)|http://ant.apache.org/]. This section details the mapping of the management functions provided through JMX management beans to Ant tasks.

Ant scripts are written using XML. Each task is defined syntactically as named XML attributes and XML elements. Each task defines an element; nested elements are contained within the task element.

Writers of Ant scripts should promote portability of such scripts by supplying necessary Ant task parameters explicitly, rather than depend on implementation-specific default values. Parameterization of scripts, using Ant properties, is a good practice.

This documentation is a part of the JBI specifications.

value is false, the task will never fail even if an error occurs during the Ant task execution.

{anchor:xmlOutput}
h2. Attribute {{xmlOutput}}

If the {{xmlOutput}} attribute is specified, the task must produce an XML document conforming to the following XML schema:
{code}
default namespace = "http://java.sun.com/xml/ns/jbi/component-info-list"
start = element component-info-list {
# version = "1.0" in this revision
attribute version { xsd:decimal },
component-info*
}

component-info =
element component-info {
attribute type { "service-engine" | "binding-component" | "shared-library" },
attribute name { text },
attribute state { "Shutdown" | "Started" | "Stopped" | "Unknown" },
element description { text },
element* -this:* { text }*
}
{code}

If {{xmlOutput}} is not specified, an implementation-defined text format MUST be output. An example of such an output is below:
{code}
-----------------------------------------
------------ Service Engines ------------
-----------------------------------------
Name: Test_engine1
State: Started
Description: Test engine with shared library.

Name: ant_test_engine2
State: Shutdown
Description: Yet another test engine.
{code}

An Ant script to produce equivalent XML output, and the output itself is show in the next two listings.
{code}
<jbi-list-service-engines xmlOutput="jbi.output"/>
<!-- The value of the property ${jbi.output} contains the XML output of the task. -->
<!-- The user can acccess the XML text using the property value. For instance: -->
<echo message="${jbi.output}"/>
{code}
{code}
<?xml version="1.0" encoding="utf-8"?>
<component-info-list xmlns="http://java.sun.com/xml/ns/jbi/component-info-list" version="1.0">
<component-info type="service-engine" name="Test_engine1" state="Started">
<description>Test engine with shared library.</description>
</component-info>
<component-info type="service-engine" name="ant_test_engine2" state="Shutdown">
<description>Yet another test engine.</description>
</component-info>
</component-info-list>
{code}

The schema is used as follows:
* *component-info* contains information about a single component. It contains:
** *type*. This indicates the component type.
** *name*. The unique component name, as supplied by its installation descriptor.
** *state*. The execution state of the component. Note that extension states are substates of the “Started” state, and that if the component is in an extended state it will show as “started” in this attribute.
** *description*. The description of the component, as supplied by its installation descriptor.
** *optional extension elements*. This area allows the implementation to provide extra, implementation-specific component information.

h1. Petals ESB Ant tasks

| name | Name of the JBI component in the Petals ESB container to shutdown. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-deploy-service-assembly}}

This task deploys a service assembly into a Petals ESB container.

|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| file | Fully qualified service assembly file path. The file should be packaged according to the JBI service assembly packaging. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-undeploy-service-assembly}}

This task undeploys a previously deployed service assembly from a Petals ESB container.

|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| name | Name of the service assembly that is in the Petals ESB container. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-start-service-assembly}}

This task starts a particular service assembly in a Petals ESB container. The attributes for this task are listed below:
|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| name | Name of the service assembly that is in the Petals ESB container. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-stop-service-assembly}}

This task stops a particular service assembly in a Petals ESB container. The attributes for this task are listed below:
|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| name | Name of the service assembly that is in the Petals ESB container. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-shut-down-service-assembly}}

This task shuts down a particular service assembly in a Petals ESB container. The attributes for this task are listed below:
|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| name | Name of the service assembly that is in the Petals ESB container. | | Yes |
| failOnError | Signal task failure to Ant. | {{true}} | No |

h2. Task {{jbi-list-service-engines}}

This task prints information about all of the Service Engines in a Petals ESB container. The attributes for this task
are listed below:
|| Attribute || Description || Default ||Required ? ||
| host | Target Petals ESB container. | {{localhost}} | No |
| port | JMX Remote port on the target server. | {{7700}} | No |
| username | User name for security. | "" | No |
| password | Password for security. | "" | No |
| state | Lists the Engines that are in the specified state. Without this parameter, list engines with all states. Valid states are: “shutdown”, “started”, “stopped” (not case sensitive) | | No |
| sharedLibraryName | List the Engines that are dependent on the specified shared library Without this parameter, no shared library dependency is verified. | | No |
| serviceAssemblyName | List the Engines that have Service Units deployed to them as part of the Service Assembly deployed in the Petals ESB contaienr. Without this parameter, no Service Assembly dependency is verified. | | No |
| serviceEngineName | If supplied, only the named service engine is reported. If the engine doesn’t exist, an empty component-list report is given. | | No |
| failOnError | Signal task failure to Ant. | {{true}} | No |
| xmlOutput | If supplied, set the given Ant property name value to the XML version of this listing task. See [Attribute {{xmlOutput}}| #xmlOutput | | No |