View Source

{section}
{column}

h1. Introduction

The Petals ESB "Autoloader" is a *post*-extension providing (un)installation/(un)deployment service copying or removing files from the filesystem.

To install/deploy a JBI artifact, just copy the JBI archive into the installation/deployment directory, and remove the file associated to a JBI archive from the uninstallation/undeployment directory to uninstall/undeploy it.

Supoorted JBI artifact to be deployed are:
* shared libraries,
* components: binding components and service engines,
* service assemblies,
* deployable service units.

{column}
{column:width=35%}
{panel:title=Table of contents}{toc:outline=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list|showAnonymous=true|showCount=true|showLastTime=true}{panel}
{column}
{section}

h1. Installation of the extension

This extension is embedded into the ZIP archive and automatically install when installing Petals ESB using this archive.

This extension is also available as a Debian package, see "[Installing Petals ESB using the Debian packages]" to install the package "{{petals-esb-autoloader}}".

h1. Using the Petals ESB Autoloader

h2. Installling/Deploying with the Petals ESB Autoloader

To install/deploy a JBI artifact, just put its associated archive in the installation/deployment directory (identified by the property {{[petals.autoloader.path.install|#RuntimeParams]}}). It will be automatically installed/deployed after a delay lower than the value of {{petals.autoloader.scan.period}}, and moved in the uninstallation/undeployment directory.

+Note 1:+ If a JBI artifact is installed/deployed by another process, using the JMX API for example, the autoloader is notified and the associated JBI archive is put in the uninstallation/undeployment directory, so it will be possible to use the Petals ESB autoloader to uninstall/undeploy the JBI artifact.

+Note 2:+ A service assembly is automatically generated during the deployment process of a deployable service unit. So to undeploy such a service unit, you *MUST* undeploy the generated service assembly identified by:
* its JBI identifier defined as the service unit identifier,
* its filename defined as {{sa-<su-jbi-identifier>-<uid>.zip}}, where {{su-jbi-identifier}} is the service unit identifier and {{<uid>}} is an UID.

+Note 3:+ If Petals ESB was installed on a Debian-based operating system from Debian packages, the filesystem operations must be done with the right system user: {{petals}}
{code}
sudo -u petals cp /tmp/petals-bc-soap-4.3.0.zip /var/lib/petals-esb/sample0/install
{code}

h2. Uninstallling/Undeploying with the Petals ESB Autoloader

To uninstall/undeploy a JBI artifact, just remove its associated archive from the uninstallation/undeployment directory (identified by the property {{[petals.autoloader.path.installed|#RuntimeParams]}}). It will be automatically uninstalled/undeployed after a delay lower than the value of {{petals.autoloader.scan.period}}.
If a JBI artifact is uninstalled/undeployed through the Petals ESB autoloader and has another JBI artifacts depending on it, they will be automatically uninstalled/undeployed.

+Note 4:+ If a JBI artifact is uninstalled/undeployed by another process, using the JMX API for example, the autoloader is notified and the associated JBI archive is automatically removed from the uninstallation/undeployment directory, without trigering another uninstallation/undeployment;).

+Note 5:+ If Petals ESB was installed on a Debian-based operating system from Debian packages, the filesystem operations must be done with the right system user: {{petals}}
{code}
sudo -u petals rm /var/lib/petals-esb/sample0/installed/petals-bc-soap-4.3.0.zip
{code}

{anchor:Configuration}
h1. Configuration

{anchor:RuntimeParams}
h2. Runtime configuration parameters

Configuration parameters of the Petals ESB Autoloader are available into the container local configuration (ie. into the file {{server.properties}}:
|| Parameter/Property name || Default value || Description ||
| {{petals.autoloader}} | {{true}} | Flag enabling/disabling the autoloader |
| {{petals.autoloader.scan.period}} | {{4000}} | Delay, in milliseconds, between two directory scans |
| {{petals.autoloader.path.install}} | {{$\{[petals.data.basedir|Container Configuration#ContainerConfigRef]}/install}} | Directory to install/deploy JBI artifacts |
| {{petals.autoloader.path.installed}} | {{$\{[petals.data.basedir|Container Configuration#ContainerConfigRef]}/installed}} | Directory to uninstall/undeploy JBI artifacts |

h2. Logging configuration parameters

The Petals ESB Autoloader uses the following logger to trace its execution: {{Petals.Extensions.AutoLoaderService}}.

As the Petals ESB Autoloder is provided into the ZIP Archive of Petals ESB, its logging configuration is already configured. If you install this extension through Debian or RPM package, just add something like the following lines to your {{loggers.properties}}:
{code}
Petals.Extensions.AutoLoaderService.level=FINEST
{code}