Cilia/Cilia Reference Card

From Wiki Adele Team
Jump to: navigation, search

Cilia DSL Reference Card

Declaring Basic Elements

Scheduler, Dispatcher, Collector and Sender

   <scheduler name="scheduler.name" classname="scheduler.implementation.class"
      namespace="scheduler.namespace">
   </scheduler>
   <dispatcher name="dispatcher.name" classname="dispatcher.implementation.class"
      namespace="dispatcher.namespace">
   </dispatcher>
  <collector name="collector.name" classname="collector.implementation.class"
      namespace="collector.namespace">
  </collector>
  <sender name="sender.name" classname="sender.implementation.class"
      namespace="sender.namespace">
  </sender>
(Tag) / Attribute Optional Default Value Description
name No Each element must have an associated name.
classname No Defines the class implementing the element.
namespace Yes fr.liglab.adele.cilia Defines element namespace.


Declaring a Processor

Each processor uses a method to process received data. Processors’ default method is named process and receives as parameter of type fr.liglab.adele.cilia.Data. If a different method is used instead, it must be defined in the method tag along with its parameter datatype.

  <processor name="processor.name" classname="processor.implementation.class" namespace="processor.namespace">
    <cilia:method name="process.method" data.type="data.type" />
  </processor>
(Tag) / Attribute Optional Default Value Description
name No Each element must have an associated name.
classname No Defines the class implementing the processor.
namespace Yes fr.liglab.adele.cilia Defines element namespace.
method / process.method No Processor method name.
method / data.type No fr.liglab.adele.cilia Defines the parameter's type.


Declaring properties on Elements

Properties declaration is made in same style for all type of basic elements (scheduler, dispatcher, processor, sender and collector).

   <dispatcher name="dispatcher.name" classname="dispatcher.implementation.class"
      namespace="dispatcher.namespace">
      <properties>
         <property name="my.property1" field="field1" value="value1" />
         <property name="my.property2" field="field2" value="value2" />
      </properties>
   </dispatcher>
Attribute Optional Default Value Description
Name No The property name.
field Yes Defines in which field property value will be injected.
value Yes Defines the default value to be used by this property.

For more information about properties declaration see ipojo documentation.


Declaring Mediators

   <mediator-component name="mediator.name" category="mediator.category">
      <cilia:processor name="processor.name" />
      <cilia:scheduler name="scheduler.name" />
      <cilia:dispatcher name="dispatcher.name" />
   </mediator-component>
(Tag) / Attribute Optional Default Value Description
name No Each mediator must have an associated name.
category Yes general Defines the mediator category.
processor / name No Defines the processor to be used by this mediator.
scheduler / name No Defines the schedulerto be used by this mediator.
processor / name No Defines the dispatcher to be used by this mediator.


Declaring Adapters

Declaring an In Adapter

  <adapter name="adapter.name" pattern="in-only">
    <collector type="collector.name" />
  </adapter>
(Tag) / Attribute Optional Default Value Description
name No The adapter name.
pattern No It must be "in-only"
collector / type No Defines the collector to be used by the adapter.


Declaring an Out Adapter

  <adapter name="adapter.name" pattern="out-only">
    <sender type="sender.name" />
  </adapter>
(Tag) / Attribute Optional Default Value Description
name No The adapter name.
pattern No It must be "out-only"
sender/ type No Defines the sender to be used by the adapter.


Declaring Linkers

<linker
    classname="linker.implementation.class"
    name="linker.name">
  <collector name="collector.name" />
  <sender name="sender.name"  />
</linker>
(Tag) / Attribute Optional Default Value Description
name No Each linker must have an associated name.
classname No Defines the class implementing the linker.
namespace Yes fr.liglab.adele.cilia Defines linker namespace.
sender/ name No Defines the sender to be used by the linker.
collector / name No Defines the collector to be used by the linker.


Declaring Instances

Mediator Instance

<mediator-instance id="mediator.instance.id" type="mediator.type">
  <ports>
    <in-port name="in" />
    <out-port name="out" />
  </ports>
</mediator-instance>

A list of ports can be defined into the ports tag. For in ports the in-port tag is used, for out ports the out-port tag is used.

(Tag) / Attribute Optional Default Value Description
id No The id (name) of the instance.
type No The mediator type of this instance.
in-port / name No The name of the in port.
out-port / name No The name of the out port.


Adapter Instances

<adapter-instance id="adapter.instance.id" type="adapter.type" />
(Tag) / Attribute Optional Default Value Description
id No The id (name) of the instance.
type No The adapter type of this instance.


Bindings

<binding from="aInAdapter" to="mediator1:in" />
<binding from="mediator1:out" to="mediator2:in" linker="event-admin"/>
<binding from="mediator2:out" to="aOutAdapter" />
(Tag) / Attribute Optional Default Value Description
from No The source of the binding. It can be an in-adapter or a mediator in-port.
to No The destination of the binding. It can be an out-adapter or a mediator out-port.
linker Yes direct The linker used to establish the binding.


Declaring a Mediation Chain

<cilia>
  <chain id="chain.id">

    <!-- Adapters instances definition -->
    <adapters>
      <adapter-instance id="in-adapter" type="adapater.type.1"/>
      <adapter-instance id="out-adapter" type="adapater.type.2"/>
    </adapters>

    <!-- Mediators instances definition -->
    <mediators>
       <mediator-instance id="mediator.instance.id" type="mediator.type">
         <ports>
           <in-port name="in" />
          <out-port name="out" />
        </ports>
       </mediator-instance>
    </mediators>

    <!-- Bindings definition -->
    <bindings>
       <binding from="in-adapter" to="mediator1:in" />
       <binding from="mediator1:out" to="mediator2:in" />
       <binding from="mediator2:out" to="out-adapter" />
    </bindings>

  </chain>
</cilia>
(Tag) / Attribute Optional Default Value Description
id No The id of the Cilia chain.