Extend the XL Deploy JBoss Domain plugin

The plugin wraps the JBoss CLI with a Jython runtime environment, thus allowing extenders to interact with JBoss and XL Deploy from the script. The Jython script is executed on the XL Deploy server itself and has full access to the following XL Deploy objects:

deployed: The current deployed object on which the operation has been triggered.

step: The step object that the script is being executed from. Exposes an overthere remote connection for file manipulation and a method to execute JBoss CLI commands.

container: The container object to which the deployed is targeted to.

delta: The delta specification that lead to the script being executed.

deployedApplication: The entire deployed application.

The plugin associates Create, Modify, Destroy, Noop and Inspect operations received from XL Deploy with Jython scripts that need to be executed for the specific operation to be performed.

There also exists an advanced method to extend the plugin, but the implementation of this form of extension needs to be written in the Java programming language and consists of writing so-called Deployed contributors, PlanPreProcessors and Contributors.

Extend the plugin to support JDBC Driver deployment

In this example we will deploy a JDBC driver jar to a domain (jbossdm.Domain) or stand-alone server (jbossdm.StandaloneServer) as a module and register the driver with JBoss datasources subsystem.

Define the deployed and deployable to represent a JDBC Driver

The following synthetic.xml snippet shows the definition of the JDBC Driver deployed. The deployed will be targeted to a domain (jbossdm.Domain) or a stand-alone server (jbossdm.StandaloneServer). Please refer to the JBoss Application Server 7+ Plugin Reference to see the interfaces and class hierarchy of these types.

Extend the plugin with custom control task

The plugin has the capability to add control tasks to jbossdm.CliManagedDeployed or jbossdm.CliManagedContainer. The control task can be specified as a Jython script that will be executed on the XL Deploy Server or as an operating system shell script that will be run on the target host. The operating system shell script is first processed with FreeMarker before being executed.

Create a Jython-based control task to list JDBC drivers in a stand-alone server