Deploy Swiftlet
Overview
The Deploy Swiftlet is responsible for the 'hot deployment'. It observes so-called deploy spaces and generates events if it detects changes there. The events are consumed by other Swiftlets which have registered listeners on that space.
Deploy Spaces
A deploy space is an entity consisting of a directory path and a check interval. There can be unlimited deploy spaces defined where each deploy space is independent of the other.
The actual deployment within a deploy space is called a bundle. A bundle is a sub-directory below the deploy space directory path. It must contain a deployment descriptor called config.xml
and at least 1 jar file. The content of the file config.xml is component-specific.
The deploy space registers a timer on the defined check interval which observes the content of the deploy space' directory path of changes which are reported as events to the resp. listener.
Directory Structure
The following example shows the structure of the deploy space extension-swiftlets
with 1 deployed bundle, the Portmapper Swiftlet:
data/deploy/ <-- deploy path
xt$portmapper/ <-- bundle directory
config.xml <-- deployment decriptor
xt$portmapper.jar <-- a jar file
_deployed_1034610346186/ <-- actual deployment, don't change the content!
config.xml
xt$portmapper.jar
To redeploy (Bundle Changed event) a component, you can change the config.xml or the jar files directly below the bundle directory. Don't change the actual deployment directory because it is under the control of the Deploy Swiftlet.
Example: How To Deploy Swiftlets
The Swiftlet deployment is very simple. The distribution of the Swiftlets contains a directory deploy
where another directory with the Swiftlet name is situated. This is e.g. xt$jmsbridge
to the JMS bridge. Please copy this directory (xt$jmsbridge) into the router deploy directory (e.g. data/deploy). The Swiftlet is now automatically installed.
If you wish to install a new version of a Swiftlet (in case an installation already exists), please copy the contents out of the directory with the name of the Swiftlet (e.g. xt$jmsbridge) into the directory of the same name of the router deployment directories (e.g. data/deploy/xt$bridge). Hereupon, the old version is uninstalled and the new version is installed.
If you wish to uninstall an installed Swiftlet please delete the content of the respective deployment directory of the Swiftlet. The Swiftlet is now uninstalled.
The deployment bundle of a Swiftlet consists of a file named config.xml
and of at least one jar file. The file config.xml
contains meta definitions of the Swiftlet configuration as well as CLI commands which are processed during the installation as well as during the de-installation. Thus, every Swiftlet defines its own resources, e.g. queues, thread pools, etc. which are deleted again during a de-installation.
During the deployment, a copy of config.xml
and of the jar files is being made and copied into a separate subdirectory, which contains a timestamp. These directories are administrated by the Deploy Swiftlet. They represent the deployment in fact. Please do not delete those. Directories that are no longer used contain a file .deleted
and they are purged with the next startup.
Configuration
The configuration of the Deploy Swiftlet is defined within the element
<swiftlet name="sys$deploy" .../>
of the router's configuration file.
Element List "deploy-spaces", Parent Element: "swiftlet"
Deploy Spaces. This element list contains zero or more "deploy-space" elements with this template definition:
Definition
Attribute | Type | Mandatory | Description |
---|---|---|---|
name | java.lang.String | Yes | Name of this Deploy Space |
path | java.lang.String | Yes | Path Name |
check-interval | java.lang.Long | Yes | Check Interval for Deployment Changes |
Values
Attribute | Values |
---|---|
path | |
check-interval | Default: 60000 |
Element List "usage", Parent Element: "swiftlet"
Active Deployments. This element list contains zero or more "deploy-space" elements with this template definition:
Definition
Attribute | Type | Mandatory | Description |
---|---|---|---|
name | java.lang.String | Yes | Name of this Deploy Space |
Element List "deployments", Parent Element: "deploy-space"
Active Deployments. This element list contains zero or more "deployment" elements with this template definition:
Definition
Attribute | Type | Mandatory | Description |
---|---|---|---|
name | java.lang.String | Yes | Name of this Deployment |
deploytime | java.lang.String | No | Deploy Time |
directory | java.lang.String | No | Actual Deployment Directory |
Values
Attribute | Values |
---|---|
deploytime | |
directory |