Before you can use the JBI tasks in an Ant build file, you must add the tasks using a taskdef element as shown in Example 5.6.
Example 5.6. Adding the JBI Tasks to an Ant Build File
... <property name="fuseesb.install_dir" value="/home/fuse_esb"/><taskdef file="${fuseesb.install_dir}/ant/servicemix_ant_taskdef.properties">
<classpath id="fuseesb.classpath">
<fileset dir="${fuseesb.install_dir}"> <include name="*.jar"/> </fileset> <fileset dir="${fuseesb.install_dir}/lib"> <include name="*.jar"/> </fileset> </classpath> </taskdef> ...
The build file fragment in Example 5.6 does the following:
The Ant task used to install a JBI component is jbi-install-component. Its attributes are listed in Table 5.8.
Table 5.8. Attributes for Installing a JBI Component Using an Ant Task
Example 5.7 shows an Ant target that installs the drools component.
Example 5.7. Ant Target that Installs a JBI Component
...
<target name="installDrools" description="Installs the drools engine.">
<jbi-install-component port="1099"
file="servicemix-drools-3.3.0.6-fuse-installer.zip" />
</target>
...The Ant task used to remove a JBI component is jbi-uninstall-component. Its attributes are listed in Table 5.9.
Table 5.9. Attributes for Removing a JBI Component Using an Ant Task
Example 5.8 shows an Ant target that removes the drools component.
Example 5.8. Ant Target that Removes a JBI Component
...
<target name="removeDrools" description="Removes the drools engine.">
<jbi-uninstall-component port="1099"
name="servicemix-drools" />
</target>
...The Ant task used to start a JBI component is jbi-start-component. Its attributes are listed in Table 5.10.
Table 5.10. Attributes for Starting a JBI Component Using an Ant Task
Example 5.9 shows an Ant target that starts the drools component.
Example 5.9. Ant Target that Starts a JBI Component
... <target name="startDrools" description="Starts the drools engine."> <jbi-start-component port="1099" name="servicemix-drools" /> </target> ...
The Ant task used to stop a JBI component is jbi-start-component. Its attributes are listed in Table 5.11.
Table 5.11. Attributes for Stopping a JBI Component Using an Ant Task
Example 5.10 shows an Ant target that stops the drools component.
Example 5.10. Ant Target that Stops a JBI Component
... <target name="stopDrools" description="Stops the drools engine."> <jbi-stop-component port="1099" name="servicemix-drools" /> </target> ...
The Ant task used to shut down a JBI component is jbi-shut-down-component. Its attributes are listed in Table 5.12.
Table 5.12. Attributes for Shutting Down a JBI Component Using an Ant Task
Example 5.11 shows an Ant target that shuts down the drools component.
Example 5.11. Ant Target that Shuts Down a JBI Component
... <target name="shutdownDrools" description="Stops the drools engine."> <jbi-shut-down-component port="1099" name="servicemix-drools" /> </target> ...
The Ant task used to install a shared library is jbi-install-shared-library. Its attributes are listed in Table 5.13.
Table 5.13. Attributes for Installing a Shared Library Using an Ant Task
The Ant task used to remove a shared library is jbi-uninstall-shared-library. Its attributes are listed in Table 5.14.
Table 5.14. Attributes for Removing a Shared Library Using an Ant Task