JOnAS - About the Fractal deployment Framework

About the Fractal deployment Framework

The aim of the Fractal Deployment Framework (FDF) is to deploy software on distant machines. This means uploading binaries, unzipping them, modifying environment variables, executing the software, stopping the software, unsetting the variables (left as before), removing unzipped directories and zipped files. The FDF covers all the process of installation, starting, stopping and uninstalling of software on distant machines.

This process is described in the main ADL. ADL are component defining and binding scripts on a component based program. The main ADL (which can have an other name than main) is build in such a way that for each host, software or function there is a sub ADL, that may be called. This is done in the component definition of the main ADL. Then the components defined (by a sub ADL) must be binded to the FDF application in their executing order.

Among main components ADL definition, there is two parts. First the hosts definition with all the parameters defined for that host (OS, upload protocol ...) and the software and function definition. The second must be applied on a host or on a software that is applied on a host.

Table of contents

  1. Main ADLs
  2. Sub ADL (hosts - software and function)
  3. Full examples of a main ADL
  4. Insert FDF in an other application
  5. FDF-Library
  6. Conclusion

1. Main ADLs

Main ADLs are the structure of the deployment process. They are a comination of sub ADLs that concentrate on a particular piece of code. Main ADLs can have any type of name.

Main ADLs describes the components of FDF and binds them together in XML format. There are two parts the definition part and the binding part. Each component is defined by calling a sub ADL. The binding of the components defined previously sets their order in the FDF application. The binding is done with the FDF application component runner.

Main ADLs is structured as followed. The NameOfTheADL, the parts <!-- THIS IS THE COMPONENTS DEFINTION AREA --> and <!-- THIS IS THE COMPONENTS BINDING AREA--> must be modified and the rest must be copied as it is.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">
<definition name="NameOfTheADL">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>
  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>

  <!-- THIS IS THE COMPONENTS DEFINTION AREA -->

  <binding client="this.r" server="runner.r"/>

  <!-- THIS IS THE COMPONENTS BINDING  AREA-->

</definition>
 
	   

The components definition area

This area is dedicated to the definition of components. This means that we are going to build the components that we need with all their parameters in this section.

There are two types of components, the hosts components and the software and functions components. The hosts components define hosts and their parameters (upload protocol, shell (OS), distant protocol, host name, user (login and password), temporary directory of file uploading). The second components of software and function are deployed on a host component. They can be deployed on an other software however, because it is possible to deduct the host on which it is deployed.

The components are declared as followed :

<component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
  <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
  <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(localhost)"/>
  <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/var/www)"/>
  <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.HTTP"/>
  <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
  <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
</component>

<component name="java1" definition="org.objectweb.fractal.deployment.java.Java">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
</component>
		

In a component definition there are two parts. The sub ADL name and definition (here host1 and java1) and the parameters ADL definition (here user, hostname, tmpdir, upload, protocol and shell for host1). All components definitions follow this scheme.

The sub ADL definition has a name, here host1 and java1. These names can be chosen as wished but must be unique (all the links to that name must be the same). It has a ADL, here org.objectweb.fractal.deployment.hostserver.Host, it is a host ADL. And it has a number of parameters inside the <component> block.

The parameters ADLs have names that must not be modified. There have a ADL definition which must correspond with the parameter. For example the parameter upload may be HTTP (org.objectweb.fractal.deployment.hostserver.HTTP), FTP (org.objectweb.fractal.deployment.hostserver.FTP) or SCP (org.objectweb.fractal.deployment.hostserver.SCP). All other ADL are forbidden but one and only one must exist. Some parameter ADL may have arguments such as org.objectweb.fractal.deployment.hostserver.Hostname(localhost). This means that the host name is 'localhost'.

The parameters ADLs may have one or several arguments. They must all be placed between brackets and have a comma to separate them, no other character is needed (and must be avoided except spaces for empty arguments). For example : Destination(/home/goal/manley,jdk1.5.0_06). If you want to insert an empty argument insert a space org.objectweb.fractal.deployment.hostserver.Hostname( ).

The java component is a software component. The difference is that it must be deployed on a host. This host might be encapsulated in a other software, this is not the case here. The host is 'host1' and is defined by the line <component name="host" definition="./host1/host"/>. To change hosts you must change the host1 value such as definition="./XXX/host" stays the same only XXX changes. You can not change the value of name, you must keep name="host". This line actually means that the component host of java is the same as the component host defined higher in the main ADL.

For EJB being deployed on JOnAS you don't have a host but you declare the JOnAS software on which you deploy the EJB. This JOnAS software component has been deployed on a host before and gives this information to the EJB. The line seen on the upper paragraph becomes <component name="jonas" definition="./jonasName/jonas"/>. The jonasName stands for the name of the JOnAS component like host1 stands for the java1 host.

For software and functions the host or the host software is mandatory. It is excluded for host definitions.

The binding components area

The components that have just been declared must be binded with the FDF application. It allows us to control the order in which they will be deployed. This is important because you might wish to deploy Java before deploying JOnAS.

Here is an example of main binding components area :

  <binding client="runner.deployment-01" server="java.deployment"/>
  <binding client="runner.deployment-02" server="jonas1.deployment"/>
  <binding client="runner.deployment-03" server="eb.deployment"/>
  <binding client="runner.deployment-04" server="jonas_client1.deployment"/>
  <binding client="runner.deployment-05" server="jonas_client2.deployment"/>
	

We bind a client with a server. The client is the FDF application (component runner). The 'deployment' is the type of the client binding. The number after 'deployment' is the order in which to bind (and deploy) the component. On the server side the component has a name defined in the component definition area. That component is of type 'deployment' (after the dot).

The four phases

The Fractal Deployment Framework is divided into four phases : the install, the start, the stop and the uninstall phases. Each component of software or function has these four phases. It is possible to execute one phase from the command line. All sub ADLs are executed in their order. For example for install phase all components are installed from number one to number N. All phases are independent except for variables setting and unsetting. The value before setting is saved (normaly start) and is restored at the unsetting (normaly stop).

Install phase, uploads the binaries and unzips them. The start phase sets variables and starts the application. The stop phase stops the application and unsets the variables. The uninstall phase remove the unzipped directory and removes uploaded files.

To execute the FDF application

To execute the FDF application on a Linux machine, you can go in the FDF/bin home directory and execute:

>controlFDF launcher Main install		
		

The launcher means that you launch the application. Main is the name of the main ADL it can be any valid main ADL name. The last argument is the phase you want to execute here install (install - start - stop - uninstall).

You can execute several phases one after the other like :

>controlFDF launcher Main install start 		
		

Will execute install and start on the Main main ADL. You can do all the four phases like this but the order of the arguments phases (here install ans start) has no importance.

2. Sub ADL (hosts - software and function)

The sub ADL are composed of a name, of a definition ADL and of parameters ADLs. The name can be chosen as you wish (but must be unique) and all links to this component must be spelled the same way. The sub ADL definitions are listed bellow with their parameters.

The parameters ADLs are mandatory except if notified otherwise.

org.objectweb.fractal.deployment.hostserver.Host

This is the host definition. A host component is a reification of a host machine and contains its user parameters (login and password), its host name, its temporary directory where files are uploaded, its upload protocol and its shell.

parameters ADL(s) argument(s) comments
user - org.objectweb.fractal.deployment.hostserver.InsertUser
the login and password will the asked by a window

- org.objectweb.fractal.deployment.hostserver.DeclareUser
the login, password and private key will the passed by argument
- none for fist ADL

- login, password and private key for the second
user password and login

for the second ADL login is mandatory and one among password and private key is mandatory.
hostname org.objectweb.fractal.deployment.hostserver.Hostname host name host name
tmpdir org.objectweb.fractal.deployment.hostserver.TmpDir tmpDir temporary directory where the files are uploaded (see upload)
upload - org.objectweb.fractal.deployment.hostserver.HTTP (http)
- org.objectweb.fractal.deployment.hostserver.FTP (ftp)
- org.objectweb.fractal.deployment.hostserver.SCP (scp)
none upload protocol
protocol - org.objectweb.fractal.deployment.hostserver.SSH (ssh) none distant protocol
shell - org.objectweb.fractal.deployment.hostserver.SH (sh)
- org.objectweb.fractal.deployment.hostserver.CSH (csh)
none the shell of the host
<component name="host2"  definition="org.objectweb.fractal.deployment.hostserver.Host">
  <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
  <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(singha.lifl.fr)"/>
  <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
  <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
  <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
  <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.CSH"/>
</component>	   

<component name="host3"  definition="org.objectweb.fractal.deployment.hostserver.Host">
  <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.DeclareUser(manley,XXXXX, )"/>
  <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
  <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/var/www)"/>
  <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.HTTP"/>
  <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
  <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
</component>
	   

org.objectweb.fractal.deployment.java.Java

This component defines a java software. It copies binaries on the host, unzip them (install), modifies JAVA_HOME and PATH variables (start), resets the JAVA_HOME and PATH variables (stop) and removes the binaries and the unzipped directory (uninstall). After start java software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
<component name="java1" definition="org.objectweb.fractal.deployment.java.Java">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
</component>
	   

org.objectweb.fractal.deployment.java.Java_no_Install

This component defines a java software. It modifies JAVA_HOME and PATH variables (start), resets the JAVA_HOME and PATH variables (stop). After start java software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
These two arguments must correspond to where the software has been installed.
<component name="java1" definition="org.objectweb.fractal.deployment.java.Java_no_Install">
  <component name="host"        definition="./host1/host"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
</component>
	   

org.objectweb.fractal.deployment.ant.Ant

This component defines a ant software. It copies binaries on the host, unzip them (install), modifies ANT_HOME and PATH variables (start), resets the ANT_HOME and PATH variables (stop) and removes the binaries and the unzipped directory (uninstall). After start ant software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
<component name="ant" definition="org.objectweb.fractal.deployment.ant.Ant">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Ant)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(apache-ant-1.6.5-bin.tar.gz)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,apache-ant-1.6.5)"/>
</component>
	   

org.objectweb.fractal.deployment.ant.Ant_no_Install

This component defines a ant software. It modifies ANT_HOME and PATH variables (start), resets the ANT_HOME and PATH variables (stop). After start ant software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
These two arguments must correspond to where the software has been installed.
<component name="ant" definition="org.objectweb.fractal.deployment.ant.Ant_no_Install">
  <component name="host"        definition="./host1/host"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,apache-ant-1.6.5)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.HSQL

This component defines a HSQL database software that can be used for JOnAS. It copies binaries on the host, unzip them (install), modifies HSQL_ROOT and PATH variables (start), resets the HSQL_ROOT and PATH variables (stop) and removes the binaries and the unzipped directory (uninstall). After start HSQL software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
<component name="hsql" definition="org.objectweb.fractal.deployment.jonas.HSQL">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(hsqldb_1_8_0_4.tar)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,hsqldb)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.HSQL_no_Install

This component defines a HSQL database software that can be used for JOnAS. It modifies HSQL_ROOT and PATH variables (start), resets the HSQL_ROOT and PATH variables (stop). After start HSQL software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
These two arguments must correspond to where the software has been installed.
<component name="hsql" definition="org.objectweb.fractal.deployment.jonas.HSQL_no_Install">
  <component name="host"        definition="./host1/host"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,hsqldb)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.SetJonasbase

This component sets the JONAS_BASE variable on the host machine (start). It gets unset by stop.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
joansBase org.objectweb.fractal.deployment.jonas.JonasBase JOnAS base JOnAS base directory
<component name="jonas_base1" definition="org.objectweb.fractal.deployment.jonas.SetJonasbase"> 
  <component name="host"      definition="./host1/host"/>
  <component name="jonasbase" definition="org.objectweb.fractal.deployment.jonas.JonasBase(/home/goal/manley/JONAS_4_7_1)"/>   
</component>
	   

org.objectweb.fractal.deployment.jonas.Autoload

Copies a EJB client in the JOnAS autoload directory. In uninstall the uploaded binaries in temporary location are removed.

parameters ADL(s) argument(s) comments
jonas ./XXX/jonas none XXX is the JOnAS component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
<component name="autoload" definition="org.objectweb.fractal.deployment.jonas.Autoload">
  <component name="jonas"     definition="./jonas1/jonas"/>
  <component name="src"       definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"  definition="org.objectweb.fractal.deployment.jonas.Filename(eb.jar)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.Jonas

This component defines a JOnAS software. It copies binaries on the host, unzip them (install), modifies JONAS_ROOT and PATH variables, and start the application (start), stops the application, resets the JONAS_ROOT and PATH variables (stop) and removes the binaries and the unzipped directory (uninstall). After start JOnAS software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
name org.objectweb.fractal.deployment.jonas.Name JOnAS name The name of the JOnAS execution (optional)
domain org.objectweb.fractal.deployment.jonas.Domain JOnAS domain the domain of the JOnAS execution (optional)
<component name="jonas1" definition="org.objectweb.fractal.deployment.jonas.Jonas">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-tomcat5.5.12.tgz)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  <component name="name"        definition="org.objectweb.fractal.deployment.jonas.Name(name)"/>
  <component name="domain"      definition="org.objectweb.fractal.deployment.jonas.Domain(domain)"/>   
</component>
	   

org.objectweb.fractal.deployment.jonas.Jonas_no_Install

This component defines a JOnAS software. It copies binaries on the host, unzip them (install), modifies JONAS_ROOT and PATH variables, and start the application (start), stops the application, resets the JONAS_ROOT and PATH variables (stop) and removes the binaries and the unzipped directory (uninstall). After start JOnAS software is ready to be used.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
These two arguments must correspond to where the software has been installed.
name org.objectweb.fractal.deployment.jonas.Name JOnAS name The name of the JOnAS execution (optional)
domain org.objectweb.fractal.deployment.jonas.Domain JOnAS domain the domain of the JOnAS execution (optional)
<component name="jonas1" definition="org.objectweb.fractal.deployment.jonas.Jonas_no_Install">
  <component name="host"        definition="./host1/host"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  <component name="name"        definition="org.objectweb.fractal.deployment.jonas.Name(name)"/>
  <component name="domain"      definition="org.objectweb.fractal.deployment.jonas.Domain(domain)"/>   
</component>
	   

org.objectweb.fractal.deployment.jonas.Load_Client

This component defines a EJB on a JOnAS software. It copies binaries on the host, unzip them (install), executed the SQL script (start) and removes the binaries and the unzipped files (uninstall). After start the EJB and its HSQL database are ready.

parameters ADL(s) argument(s) comments
jonas ./XXX/jonas none XXX is the JOnAS component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
src2 org.objectweb.fractal.deployment.jonas.Src source directory source directory of the ejb
filename2 org.objectweb.fractal.deployment.jonas.Filename source file name source file name of the ejb
sqltool org.objectweb.fractal.deployment.jonas.SqlTool rc sql tool rc sql tool
sqlfile org.objectweb.fractal.deployment.jonas.SqlFile sql file to execute sql file to execute
<component name="eb" definition="org.objectweb.fractal.deployment.jonas.Load_Client"> 
  <component name="jonas"     definition="./jonas1/jonas"/>
  <component name="src"       definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"  definition="org.objectweb.fractal.deployment.jonas.Filename(Jonas.tar)"/>
  <component name="src2"      definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename2" definition="org.objectweb.fractal.deployment.jonas.Filename(eb.jar)"/>
  <component name="sqltool"   definition="org.objectweb.fractal.deployment.jonas.SqlTool(sqltool.rc)"/>
  <component name="sqlfile"   definition="org.objectweb.fractal.deployment.jonas.SqlFile(Accounthsqldb.sql)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.Jonas_jclient

Simulates a client call on the JOnAS software (start).

parameters ADL(s) argument(s) comments
jonas ./XXX/jonas none XXX is the JOnAS component on witch it is deployed.
execclient org.objectweb.fractal.deployment.jonas.ExecClient jclient command jclient command to be executed on JOnAS software. The jclient name must be excludes of the command.
<component name="jonas_client1" definition="org.objectweb.fractal.deployment.jonas.Jonas_jclient">
  <component name="jonas"      definition="./jonas1/jonas"/>
  <component name="execclient" definition="org.objectweb.fractal.deployment.jonas.ExecClient(eb.ClientAccount AccountImplHome)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.CopyNonZip

Copies a non zipped (doesn't unzip the file) file to a specific location at start. At stop the temporary file is removed.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
<component name="copy" definition="org.objectweb.fractal.deployment.jonas.CopyNonZip">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(hsqldb_1_8_0_4.tar)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal,manley)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.CopyZip

Copies a zipped file to a specific location and unzip it at start. At stop the temporary file is removed.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
src org.objectweb.fractal.deployment.jonas.Src source directory source directory
filename org.objectweb.fractal.deployment.jonas.Filename source file name source file name
destination org.objectweb.fractal.deployment.jonas.Destination (two) destination but last directory and the last directory destination directory.
The but last directory can be any valid directory. The last directory depends on the source binary (unzipping that binary creates a directory)
<component name="copy" definition="org.objectweb.fractal.deployment.jonas.CopyZip">
  <component name="host"        definition="./host1/host"/>
  <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
  <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(hsqldb_1_8_0_4.tar)"/>
  <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal,manley"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.Jonas_runner

At start time it starts JOnAS and at stop time it stops JOnAS. Bewared the JONAS_ROOT and the PATH variables must be set before (they get default values between phases launched by different command scripts). This is not done in this ADL but it is done in org.objectweb.fractal.deployment.jonas.Jonas_no_Install.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
<component name="runner1" definition="org.objectweb.fractal.deployment.jonas.Jonas_runner">
  <component name="host"        definition="./host1/host"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.SetVariable

Sets the environment variable at start and unsets it at stop.

parameters ADL(s) argument(s) comments
host ./XXX/host none XXX is the host component on witch it is deployed.
var org.objectweb.fractal.deployment.jonas.Variable variable the name of the variable
value org.objectweb.fractal.deployment.jonas.Value value the value of the variable
<component name="var1" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
  <component name="host"        definition="./host1/host"/>
  <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
  <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/manley/apache-tomcat-5.5.12)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.Jclusterd

At start, it starts jclusterd of the JOnAS application (that is deployed on a host). And stops it at stop phase.

parameters ADL(s) argument(s) comments
jonas ./XXX/jonas none XXX is the JOnAS component on witch it is deployed.
args org.objectweb.fractal.deployment.jonas.Arguments arguments list of arguments (separated by a space) given to Jclustered.
<component name="jclusterd" definition="org.objectweb.fractal.deployment.jonas.Jclusterd">
  <component name="jonas"      definition="./jonas1/jonas"/> 
  <component name="args"       definition="org.objectweb.fractal.deployment.jonas.Arguments(arg1 arg2 arg3)"/>
</component>
	   

org.objectweb.fractal.deployment.jonas.GetLogs

At start time it copies all the log files of the JOnAS application to a defined directory on the local machine.

parameters ADL(s) argument(s) comments
jonas ./XXX/jonas none XXX is the JOnAS component on witch it is deployed.
logsdir org.objectweb.fractal.deployment.jonas.LogsDir local directory local directory where the log files are copies.
<component name="logs" definition="org.objectweb.fractal.deployment.jonas.GetLogs">
  <component name="jonas"   definition="./jonas1/jonas"/>
  <component name="logsdir" definition="org.objectweb.fractal.deployment.jonas.LogsDir(/home/manley/tmp)"/>
</component>
	   

3. Full examples of a main ADL

Here are some examples of main ADLs. The file in which there are set must have the same name and the .fractal extention for example the first one is called myMain. You set main ADLs in the $JONAS_ROOT/conf directory.

Example Main with JOnAS, JONAS_BASE on a single hosts

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="myMain">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>



<!--  JAVA  -->


  <component name="java1" definition="org.objectweb.fractal.deployment.java.Java">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
  </component>




<!--  JOnAS  -->

  <component name="var11" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var21" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="var31" definition="org.objectweb.fractal.deployment.jonas.SetJonasbase">
    <component name="host"        definition="./host1/host"/>
    <component name="jonasbase"   definition="org.objectweb.fractal.deployment.jonas.JonasBase(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="jonas11" definition="org.objectweb.fractal.deployment.jonas.Jonas">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>


<!--  END -->


  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="java1.deployment"/>
  <binding client="runner.deployment-02" server="var11.deployment"/>
  <binding client="runner.deployment-03" server="var21.deployment"/>  
  <binding client="runner.deployment-04" server="var31.deployment"/>  
  <binding client="runner.deployment-05" server="jonas11.deployment"/>


</definition>			
			

Example Main with JOnAS and JONAS_BASE on a a cluster of two hosts

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="The2Hosts">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>


  <component name="host2"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(singha)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.CSH"/>
  </component>


<!--  JAVA  -->


  <component name="java1" definition="org.objectweb.fractal.deployment.java.Java">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
  </component>


  <component name="java2" definition="org.objectweb.fractal.deployment.java.Java">
    <component name="host"        definition="./host2/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
  </component>


<!--  JOnAS  -->

  <component name="var11" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var21" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="var31" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(JONAS_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="jonas11" definition="org.objectweb.fractal.deployment.jonas.Jonas">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>


  <component name="var12" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var22" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="var32" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(JONAS_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="jonas12" definition="org.objectweb.fractal.deployment.jonas.Jonas">
    <component name="host"        definition="./host2/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>


<!--  END -->


  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="java1.deployment"/>
  <binding client="runner.deployment-02" server="var11.deployment"/>
  <binding client="runner.deployment-03" server="var21.deployment"/>  
  <binding client="runner.deployment-04" server="var31.deployment"/>  
  <binding client="runner.deployment-05" server="jonas11.deployment"/>
  <binding client="runner.deployment-06" server="java2.deployment"/>
  <binding client="runner.deployment-07" server="var12.deployment"/>
  <binding client="runner.deployment-08" server="var22.deployment"/>  
  <binding client="runner.deployment-09" server="var32.deployment"/>  
  <binding client="runner.deployment-10" server="jonas12.deployment"/>

</definition>			
			

Example Main with JOnAS, JONAS_BASE and Jclustered on a a cluster of two hosts

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="Main">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>


  <component name="host2"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(singha)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.CSH"/>
  </component>


<!--  JAVA  -->


  <component name="java1" definition="org.objectweb.fractal.deployment.java.Java">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
  </component>


  <component name="java2" definition="org.objectweb.fractal.deployment.java.Java">
    <component name="host"        definition="./host2/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Java)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jdk1.5.0_06.tar)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,jdk1.5.0_06)"/>
  </component>


<!--  JOnAS  -->

  <component name="var11" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var21" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="var31" definition="org.objectweb.fractal.deployment.jonas.SetJonasbase">
    <component name="host"        definition="./host1/host"/>
    <component name="jonasbase"   definition="org.objectweb.fractal.deployment.jonas.JonasBase(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="jonas11" definition="org.objectweb.fractal.deployment.jonas.Jonas">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>


 <component name="jclusterd1" definition="org.objectweb.fractal.deployment.jonas.Jclusterd">
    <component name="jonas"      definition="./jonas11/jonas"/> 
    <component name="args"       definition="org.objectweb.fractal.deployment.jonas.Arguments( )"/>
  </component>


  <component name="var12" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var22" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="var32" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host2/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(JONAS_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>

  <component name="jonas12" definition="org.objectweb.fractal.deployment.jonas.Jonas">
    <component name="host"        definition="./host2/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>


 <component name="jclusterd2" definition="org.objectweb.fractal.deployment.jonas.Jclusterd">
    <component name="jonas"      definition="./jonas12/jonas"/> 
    <component name="args"       definition="org.objectweb.fractal.deployment.jonas.Arguments( )"/>
  </component>

<!--  END -->


  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="java1.deployment"/>
  <binding client="runner.deployment-02" server="var11.deployment"/>
  <binding client="runner.deployment-03" server="var21.deployment"/>  
  <binding client="runner.deployment-04" server="var31.deployment"/>  
  <binding client="runner.deployment-05" server="jonas11.deployment"/>
  <binding client="runner.deployment-06" server="jclusterd1.deployment"/>
  <binding client="runner.deployment-07" server="java2.deployment"/>
  <binding client="runner.deployment-08" server="var12.deployment"/>
  <binding client="runner.deployment-09" server="var22.deployment"/>  
  <binding client="runner.deployment-10" server="var32.deployment"/>  
  <binding client="runner.deployment-11" server="jonas12.deployment"/>
  <binding client="runner.deployment-12" server="jclusterd2.deployment"/>

</definition>			
			

Deploying a correction patch with start top of JOnAS

To stop JOnAS you have to lanch the stop phase and to copy the path and start JOnAS you have to launch the start phase.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="Main">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>


<!--  JOnAS  -->

  <component name="copy" definition="org.objectweb.fractal.deployment.jonas.CopyZip">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley, )"/>
  </component>

  <component name="runner1" definition="org.objectweb.fractal.deployment.jonas.Jonas_no_Install">
    <component name="host"        definition="./host1/host"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>

<!--  END -->

  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="copy.deployment"/>
  <binding client="runner.deployment-02" server="runner1.deployment"/>

</definition>			
			

Getting logs from a clustered host

To get logs from a JOnAS execution it is necessary to have a the JOnAS component in the main ADL.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="Main">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.FTP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>


<!--  JOnAS  -->

 <component name="var1" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var2" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>


  <component name="copy" definition="org.objectweb.fractal.deployment.jonas.CopyZip">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley, )"/>
  </component>

  <component name="jonas1" definition="org.objectweb.fractal.deployment.jonas.Jonas_no_Install">
    <component name="host"        definition="./host1/host"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>

 <component name="logs" definition="org.objectweb.fractal.deployment.jonas.GetLogs">
    <component name="jonas"   definition="./jonas1/jonas"/>
    <component name="logsdir" definition="org.objectweb.fractal.deployment.jonas.LogsDir(/home/manley/tmp)"/>
  </component>

<!--  END -->

  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="var1.deployment"/>
  <binding client="runner.deployment-02" server="var2.deployment"/>
  <binding client="runner.deployment-03" server="copy.deployment"/>
  <binding client="runner.deployment-04" server="jonas1.deployment"/>
  <binding client="runner.deployment-05" server="logs.deployment"/>

</definition>			
			

Example with SSH and SCP

To get logs from a JOnAS execution it is necessary to have a the JOnAS component in the main ADL

<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN" "classpath://org/objectweb/fractal/adl/xml/standard.dtd">

<definition name="Main">

  <interface name="r" signature="org.objectweb.fractal.deployment.util.RunnableArg" role="server"/>

  <component name="runner" definition="org.objectweb.fractal.deployment.util.Runner"/>


<!-- HOST -->

  <component name="host1"  definition="org.objectweb.fractal.deployment.hostserver.Host">
    <component name="user"     definition="org.objectweb.fractal.deployment.hostserver.InsertUser"/>
    <component name="hostname" definition="org.objectweb.fractal.deployment.hostserver.Hostname(tecate)"/>
    <component name="tmpdir"   definition="org.objectweb.fractal.deployment.hostserver.TmpDir(/tmp)"/>
    <component name="upload"   definition="org.objectweb.fractal.deployment.hostserver.SCP"/>
    <component name="protocol" definition="org.objectweb.fractal.deployment.hostserver.SSH"/>
    <component name="shell"    definition="org.objectweb.fractal.deployment.hostserver.SH"/>
  </component>


<!--  JOnAS  -->

 <component name="var1" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_HOME)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/apache-tomcat-5.5.12)"/>
  </component>

  <component name="var2" definition="org.objectweb.fractal.deployment.jonas.SetVariable">
    <component name="host"        definition="./host1/host"/>
    <component name="var"         definition="org.objectweb.fractal.deployment.jonas.Variable(CATALINA_BASE)"/>
    <component name="value"       definition="org.objectweb.fractal.deployment.jonas.Value(/home/goal/manley/JONAS_4_8_0)"/>
  </component>


  <component name="copy" definition="org.objectweb.fractal.deployment.jonas.CopyZip">
    <component name="host"        definition="./host1/host"/>
    <component name="src"         definition="org.objectweb.fractal.deployment.jonas.Src(/home/manley/FDF-librairy/Jonas)"/>
    <component name="filename"    definition="org.objectweb.fractal.deployment.jonas.Filename(jonas4.8.0-bin.tgz)"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley, )"/>
  </component>

  <component name="jonas1" definition="org.objectweb.fractal.deployment.jonas.Jonas_no_Install">
    <component name="host"        definition="./host1/host"/>
    <component name="destination" definition="org.objectweb.fractal.deployment.jonas.Destination(/home/goal/manley,JONAS_4_8_0)"/>
  </component>

 <component name="logs" definition="org.objectweb.fractal.deployment.jonas.GetLogs">
    <component name="jonas"   definition="./jonas1/jonas"/>
    <component name="logsdir" definition="org.objectweb.fractal.deployment.jonas.LogsDir(/home/manley/tmp)"/>
  </component>

<!--  END -->

  <binding client="this.r" server="runner.r"/>

  <binding client="runner.deployment-01" server="var1.deployment"/>
  <binding client="runner.deployment-02" server="var2.deployment"/>
  <binding client="runner.deployment-03" server="copy.deployment"/>
  <binding client="runner.deployment-04" server="jonas1.deployment"/>
  <binding client="runner.deployment-05" server="logs.deployment"/>

</definition>			
			

4. Insert FDF in an other application

It is possible to insert FDF in a other application. The class to bind to the other application is org.objectweb.fractal.deployment.util.Runner. The main ADL describes all the components and all the binding of the Runner class. Therefore it is necessary to include the main ADL and the Runner class in the other project.

The class Runner has two interfaces, Runnable and Run. The interface Run gives the two methods : void setArguments(String[] arg) and void run(). The setArguments() method takes a list of phases sutch as "install", "start", "stop" and "uninstall". The phases that have been inserted in the method will be executed at the next call of run(). If you want to execute install and start you may write :

setArguments({"install", "start"});
run();
		

and the call of run() will execute these two phases. The order of the phases you insert in setArguments() is of no importance. However if you insert a new list of phases the old one will be removed. If no valid argument has been set all four phases will be executed.

As a example of binding the FDF to an other application in Fractal, see as follows. First you must declare an attribute of type run.

in a Java component for eg callFDF:

import org.objectweb.fractal.deployment.util.Run;
...

    /**
     * The FDF component.
     *
     * @fractal.bc 
     */
    protected Run run;

...
   setArguments({"install"});
   run();
   setArguments({"start"});
   run();
   setArguments({"stop"});
   run();
   setArguments({"uninstall"});
   run();
....
		
		

Then is a ADL you must bind the runner component of the FDF main ADL with callFDF. The runner component must be a shared (with the main ADL) component in the followed example:

<component name="runner"      definition="./runner"/>
<binding client="callFDFComponent.run"  server="runner.run"/>		
		

5. FDF-Library

The FDF-Library contains binary code that may be deployed on the distant machines.

6. Conclusion

The Fractal Deployment Framework (FDF) has been developed to deploy software on distant machines. For the moment Java, Ant and JOnAS software have been fully implemented and tested. But it is easy to extend the framework to other software. And other software are under way.

Compared to a script it has the advantage of being tested and to be extended. A script can difficultly be adapted to new software.

The level of complexity of this application can be reduced by further developments and by creating a deployment language that can take over the writing of the main ADL actually left to human.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2006-07-25 11:16 AM