Chapter 32. Architecture Description Language

The Architecture Description Language (ADL) is used to configure and deploy component systems. The architecture of the system is described in a normalized XML file.

The ADL has been updated and is now an extension of the standard Fractal ADL, allowing to reuse ProActive-specific features such as distributed deployment using deployment descriptors.

The distributed deployment facilities offered by ProActive are reused, and the notion of virtual node is integrated in the component ADL. For this reason, the components ADL has to be associated with a deployment descriptor (this is done at parsing time: both files are given to the parser).

One should refer to the Fractal ADL tutorial for more detailed information about the ADL. Here is a short overview, and a presentation of some added features.

Note that because this ADL is based on the Fractal ADL, it requires the following libraries (included in the /lib directory of the ProActive distribution): fractal-adl.jar, dtdparser.jar, ow_deployment_scheduling.jar

32.1. Overview

Components are defined in definition files, which are .fractal files. The syntax of the document is validated against a DTD retreived from the classpath

 classpath://org/objectweb/proactive/core/component/adl/xml/proactive.dtd 

The definition element has a name (which must be the same name that the file's) and inheritance is supported through the attribute 'extends':

 definition name='org.objectweb.proactive.examples.components.helloworld.hell oworld-distributed-wrappers' 

The exportedVirtualNodes elements is described later in this section

Components can be specified and created in this definition, and these components can themselves be defined in other definition files:

component name='client-wrapper' definition='org.objectweb.proactive.examples.c omponents.helloworld.ClientType'

Nesting is allowed for composite components and is done by adding other 'component' elements.

The binding element specifies bindings between interfaces of components ', and specifying 'this' as the name of the component refers to the current enclosing component.

 binding client='this.r' server='client.r' 

The controller elements can have the following 'desc' values: 'composite', 'parallel' or 'primitive'. A parallel component and the components it contains should be type-compatible

Primitive components specify the content element, which indicates the implementation class containing the business logic for this component:

 content class='org.objectweb.proactive.examples.components.helloworld.ClientImpl' 

The virtual-node element offers distributed deployment information. It can be exported and composed in the exportedVirtualNodes element.

The component will be instantiated on the virtual node it specified (or the one that it exported). For a composite or a parallel component, it means it will be instantiated on the (first if there are several nodes mapped) node of the virtual node. For a primitive component, if the virtual node defines several nodes (cardinality='multiple'), there will be as many instances of the primitive component as there are underlying nodes. Each of these instances will have a suffixed name looking like:

primiveComponentName-cyclicInstanceNumber-n
where primitiveComponentName is the name defined in the ADL. This automatic replication is used in the parallel components.

 virtual-node name='client-node' cardinality='single' 

The syntax is similar to the standard Fractal ADL, and the parsing engine has been extended. Features specific to ProActive are:

  • Virtual nodes have a cardinality property: either 'single' or 'multiple'. When 'single', it means the virtual node in the deployment descriptor should contain 1 node ; when 'multiple', it means the virtual node in the deployment descriptor should contain more than 1 node.

  • Virtual nodes can be exported and composed.

  • Template components are not handled.

  • The controller description includes 'parallel' as a valid attribute.

  • The validating DTD has to be specified as: classpath://org/objectweb/proactive/core/component/adl/xml/proactive.dtd

32.2. Example

The easiest way to understand the ADL is to see an example (Section 33.2.5, “The HelloWorld ADL files”). It corresponds to the helloworld example described later in this document.

32.3. Exportation and composition of virtual nodes

Components are deployed on the virtual node that is specified in their definition ; it has to appear in the deployment descriptor unless this virtual node is exported. In this case, the name of the exported virtual node should appear in the deployment descriptor, unless this exported virtual node is itself exported.

When exported, a virtual node can take part in the composition of other exported virtual nodes. The idea is to further extend reusability of existing (and packaged, packaging being a forthcoming feature of Fractal) components.

In the example, the component defined in helloworld-distributed-wrappers.fractal exports the virtual nodes VN1 and VN2:

exportedVirtualNodes
 exportedVirtualNode name='VN1'
  composedFrom
   composingVirtualNode component='client' name='client-node'
  /composedFrom
 /exportedVirtualNode
 exportedVirtualNode name='VN2'
  composedFrom
   composingVirtualNode component='server' name='server-node'/
  /composedFrom
 /exportedVirtualNode
/exportedVirtualNodes

VN1 is composed of the exported virtual node 'client-node' from the component named client

In the definition of the client component (ClientImpl.fractal), we can see that client-node is an exportation of a virtual node which is also name 'client-node':

exportedVirtualNodes
 exportedVirtualNode name='client-node'
   composedFrom
     composingVirtualNode component='this' name='client-node'/
   /composedFrom
 /exportedVirtualNode
/exportedVirtualNodes
...
virtual-node name='client-node' cardinality='single'/

Although this is a simplistic example, one should foresee a situation where ClientImpl would be a prepackaged component, where its ADL could not be modified ; the exportation and composition of virtual nodes allow to adapt the deployment of the system depending on the existing infrastructure. Colocation can be specified in the enclosing component definition (helloworld-distributed-wrappers.fractal):

exportedVirtualNodes
 exportedVirtualNode name='VN1'
  composedFrom
   composingVirtualNode component='client' name='client-node'
   composingVirtualNode component='server' name='server-node'/
  /composedFrom
 /exportedVirtualNode
/exportedVirtualNodes

As a result, the client and server component will be colocated / deployed on the same virtual node. This can be profitable if there is a lot of communications between these two components.

When specifying 'null' as the name of an exported virtual node, the components will be deployed on the current virtual machine. This can be useful for debugging purposes.

32.4.  Usage

ADL definitions correspond to component factories. ADL definition can be used directly:

      Factory factory = org.objectweb.proactive.core.component.adl.FactoryFactory.getFactory();
      Map context = new HashMap();
      Component c = (Component) factory.newComponent("myADLDefinition",context);
      

It is also possible to use the launcher tool, which parses the ADL, creates a corresponding component factory, and instantiates and assembles the components as defined in the ADL, is started from the org.objectweb.proactive.core.component.adl.Launcher class:

 Launcher [-java|-fractal] <definition> [ <itf> ] [deployment-descriptor])  

where [-java|-fractal] comes from the Fractal ADL Launcher (put -fractal for ProActive components, this will be made optional for ProActive components in the next release), <definition> is the name of the component to be instantiated and started, <itf> is the name of its Runnable interface, if it has one, and <deployment-descriptor> the location of the ProActive deployment descriptor to use. It is also possible to use this class directly from its static main method.