Extend the JBoss AS plugin

You can extend the JBoss Application Server plugin using the XL Deploy plugin API type system. And because the JBoss plugin is built on the XL Deploy Generic plugin, you can also add support for new types using the Generic plugin patterns.

Change the visibility or default value of an existing property

You can make the restartRequired property visible and give the targetDirectory property a default value of /home/deployer/install-files for jbossas.EarModule.

The following synthetic.xml snippet shows how to do this:

	<type-modification type="jbossas.EarModule">
      <!-- make it visible so that I can control whether to restart a Server or not from UI-->
	  <property name="restartRequired" kind="boolean" default="true" hidden="false"/>

	  <!-- custom deploy directory for my jboss applications -->
	  <property name="targetDirectory" default="/home/deployer/install-files" hidden="true"/>
	</type-modification>

Add a new property to a deployed or deployable

You can add a new blocking-timeout-millis property to jbossas.TransactionalDatasource as shown in following synthetic.xml snippet:

	<type-modification type="jbossas.TransactionalDatasource">
        <!-- adding new property -->
        <property name="blockingTimeoutMillis" kind="integer" default="3000" description="maximum time in milliseconds to block
        while waiting for a connection before throwing an exception"/>
	</type-modification>

Important: When you add a new property to the JBoss Application Server plugin, the configuration property must be specified in lower camel-case with the hyphens removed from it. For example, the property blocking-timeout-millis must be specified as blockingTimeoutMillis. Similarly, idle-timeout-minutes becomes idleTimeoutMinutes in synthetic.xml.

Add a new type

You can add new types to the JBoss Application Server plugin using the Generic Plugin patterns. For example, the following synthetic.xml snippet defines a new type, jbossas.EjbJarModule:

	<type type="jbossas.EjbJarModule" extends="generic.CopiedArtifact" deployable-type="jee.EjbJar" container-type="jbossas.BaseServer">
		<generate-deployable type="jbossas.EjbJar" extends="jee.EjbJar"/>
		<property name="targetDirectory" default="${deployed.container.home}/server/${deployed.container.serverName}/deploy" hidden="true"/>
		<property name="targetFile" default="${deployed.deployable.name}.jar" hidden="true"/>
		<property name="createOrder" kind="integer" default="50" hidden="true"/>
		<property name="destroyOrder" kind="integer" default="40" hidden="true"/>
		<property name="restartRequired" kind="boolean" default="true" hidden="true"/>
	</type>
	```