what's new in jbi ant tasks in OpenESB 2.0 Beta
JBI 1.0 Specification (
jsr
208, section 6.10 ) defines set of Ant tasks that can be used to
manage JBI runtime from Apache Ant
scripting environment. In addition to implementing all the JBI Ant
tasks and their attributes
defined in the JBI 1.0 specification, OpenESB 2.0 has added few
new features to the JBI Ant tasks for managing
the JBI
artifacts in a multi-instance or clustered environment. The Beta
branch builds of the GlassFish V2 with the OpenESB 2.0 Beta are
available at
https://glassfish.dev.java.net/public/downloadsindex.html#GlassFish_v2_Beta_branch
.
The documenation on JBI Ant tasks in OpenESB 2.0 is available online at
http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=JBIAntTaskReference
The following are the new features or modified functionality that has
been added to the JBI Ant tasks in OpenESB in Glassfish V2. Note that
these new features have default settings so that any Ant script that
use just the JBI Ant tasks and their attributes defined in JBI 1.0
specification will work without modification.
1. "target" attribute
Since OpenESB in GlassFish V2 supports multi-instance or
clustered environment where a OpenESB runtime will be started in each
standalone instance or clustered instances of the
appserver, a new
attribute "target" has been added to all the JBI Ant tasks to manage
JBI management operations targeted per instance or cluster.
2. "force" attribute
"force" attribute that has been added tells the OpenESB runtime to
perform the
management
task forcefully under normal or error conditions. The following
are
the Ant
tasks that have been modified for this feature.
jbi-shut-down-component
- forcefully shuts down the component when
force=true
jbi-uninstall-component
- forcefully uninstalls the component
when
force=true
jbi-shut-down-service-assembly
- forcefully shuts down the service
assembly when
force=true
jbi-undeploy-service-assembly
- forcefully undeploys service
assembly when
force=true
3. "name" attribute on install/deploy tasks ( install/deploy
from
repository )
When dealing with multi-instance and multi cluster scenarios, you
may want to reconfigure your multi-instance OpenESB runtime to
add/remove components or service assemblies to/from a particular
instance or cluster. In this case, when you already have
component/service-assembly installed/deployed to "domain", you can
install/deploy that component/service-assembly using it's name to other
instances or clusters in the system without again passing the
component/service-assembly archive file.
"name" attribute that has been added on the
install/deploy tasks can be used to install/deploy
component/service-assembly from the domain repository to other
instances or clusters in the system. The tasks that have been modified
for this feature are
jbi-install-shared-library
jbi-install-component
jbi-deploy-service-assembly
4. "keepArchive" attribute
"keepArchive" attribute has been added to uninstall/undeploy tasks to
tell the OpenESB runtime to keep the component/service-assembly in the
domain repository even when the component/service-assembly is
uninstalled/undeployed from all the instances and clusters in the
system. Keeping the component/service-assembly in the domain
repository will be useful when you want to install/deploy the
component/service-assembly to old/new instances or clusters just
by
name ( install/deploy from repository ). By default, OpenESB
runtime
removes the component/service-assembly from the system including from
the repository when component/service-assembly is
uninstalled/undeployed from all the instances and clusters in the
system. The tasks that have been modified for this
feature are
jbi-uninstall-shared-library
jbi-uninstall-component
jbi-undeploy-service-assembly
5. JMX Connection settings on the JBI Ant tasks
Since we have tightly integrated the OpenESB into GlassFish V2, the
JBI Ant tasks now support jmx over HTTP/HTTPS ( proprietary
implementation of JSR 160 over HTTP/S in GlassFish ) in addition to
supporting
the JMX over RMI/JRMP. The HTTP/S port used for the jmx
connection is
same as the GlassFish administrative port. So, now you can use same
port for OpenESB administration and GlassFish administration from the
Ant environment.
5.1 "secure" attribute
the value of the secure attribute tell the JBI Ant task to get the jmx
connection over HTTP/HTTPS. If the GlassFish uses HTTPS port for
its
administration, then use that port along with setting the "secure"
attribute to "true" in order to connect the jmx server over
HTTPS. If
the secure attribute is not set (default), JBI Ant tasks try to acquire
a jmx
connection over HTTP, HTTPS or RMI/JRMP in that order.
5.2 "passwordfile" attribute
Now you can also set the JMX connection password of the JBI Ant
tasks
using
a password file. The file should be of the Java Properties file format
and should contains the property "AS_ADMIN_PASSWORD", the value of
which is set as a password for the JMX connection for the JBI Ant tasks.
6. ASANT setup for OpenESB in GlassFish V2
Asant is a wrapper to the Apache Ant installed in GlassFish. It sets up
the
classpath and the other environment variables required to run the
appserver Ant tasks in Ant environment. This setup has been modified in
two places to run
the Ant
scripts that use JBI Ant tasks using Asant.
6.1. JBI Ant tasks classpath setup
Ant environment classpath set in the Asant wrapper has been modified to
include the JBI Ant tasks implementation jar files in
the classpath so that the JBI Ant tasks implementation is directly
available to the Ant scripts
executed using Asant.
6.2. JBI Ant task definitions setup
JBI Ant task definitions are included in the default Ant task
definitions under Asant setup to make the jbi ant tasks available as
default Ant tasks in an ant environment. With this, Ant scripts that
run
under Asant environment need not include the jbi ant task definitions
in order to use the jbi ant tasks.
7. jbi_admin.xml - a custom Ant script
jbi_admin.xml is a custom Ant script that defines a set of targets
that perform the JBI management tasks using the JBI Ant tasks.
Users
can directly use this Ant script and call appropriate Ant target to
perform the JBI administration after setting the required Ant
properties
via -D option or by -propertyfile option. jbi_admin.xml is located
at $AS_INSTALL/JBI/bin where $AS_INSTALL is the glassfish install
root.
Example usage of this script to install a component is ( assuming
default jmx connection settings )
$AS_INSTALL/bin/asant -f $AS_INSTALL/jbi/bin/jbi_admin.xml
-Djbi.install.file=/my/dir/my-component.zip
install-component
Documentation and other information
The JBI Ant tasks documentation is available under glassfish
installation at $AS_INSTALL/jbi/doc/antdoc in the following two zip
files
jbi-ant-tasks-reference.zip
jbi-ant-targets-reference.zip
You can also browse the documentation online at JBI Wiki
http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=JBIAntTaskReference
http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=JBIAdminAntTargetReference
For more information on OpenESB in GlassFish V2 visit
JBI Wiki (
http://www.glassfishwiki.org/jbiwiki/Wiki.jsp?page=GlassfishJbiIntegration
)
OpenESB project at Java.net (
https://open-esb.dev.java.net/
)