back to API     back to index     prev     next  

XML Deployment Descriptors

Objectives

Parameters tied to the deployment of an application should be totally described in a xml deployment descriptor. Hence within the source code, there are no longer any references to :

A ProActive application can be deployed on different hosts, with different protocols without changing the source code

Principles

Different types of VirtualNodes

Different types of JVMs



Validation against XML Schema

To avoid mistake when building XML descriptors, ProActive provides an XML Schema called DescriptorSchema. Then to validate your file against this schema, the following line must be put at the top of the xml document as it is done for all ProActive examples.
<ProActiveDescriptor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="Location_of_DescriptorSchema.xsd">
	
Note that this schema is available in the ProActive distribution package under ProActive\descriptor directory. Using descriptors related methods (Proactive.getProActiveDescriptor(file)) triggers automatic and transparent validation of the file using Xerces2_4_0 if the ProActive property schema.validation is set to enable(see configuration file for more details). If a problem occurs during the validation, an error message is displayed otherwise if the validation is successful no message appear. An XML validation tool such as XMLSPY5.0(windows) can also be used to validate XML descriptors.

Complete description and examples

Following XML files examples are used for the C3D application. The first file is read when launching the C3DDispatcher. The second one is read every time a C3DUser is added. Both files contain many features described earlier in this document.

Killing the application

ProActive gives the ability to kill all JVMs and Nodes deployed with an XML descriptor with the method: killall(boolean softly) in class ProActiveDescriptor:

ProActiveDescriptor pad = ProActive.getProActiveDescriptor(String xmlFileLocation);
//----------- Returns a ProActiveDescriptor object from the xml file
pad.activateMappings();
--------------------------------------------
--------------------------------------------
--------------------------------------------
pad.killall(false);
//----------- Kills every jvms deployed with the descriptor

If softly is set to false, all jvms created when activating the descriptor are killed abruptely. If true a jvm that originates the creation of a rmi registry waits until registry is empty before dying. To be more precise a thread is created to ask periodically the registry if objects are still registered.

Processes

There is the possiblity to use only the infrastructure part in order to create processes. A Schema called ProcessSchema located in the examples directory allows to validate XML files for processes. ProActive provides also the ability to use all processes defined above without using XML Deployment Descriptor. You can programmatically create such processes.
In order to get familiar on how to create processes programmatically see Process package

Copyright © April 2004 INRIA All Rights Reserved.