Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public interface HelloDispatcher {
    public void dispatch();
    public String getLanguage();
    public List<Person> getPersons();
}

...

The next section describes the abstract composite implementation.

Composite Design

To implement this composite, we reuse existing service implementations;we have three off-the-shelf services:

...

Code Block
public interface Dispatch{
    public void dispatch();
}

So to design our application we will use these services to obtain the following applicationsThese services define the overall abstract implementation of the composite.

Composite Description

To describe our applicationcomposite, we will use the iPOJO service-oriented ADL:

Code Block
<composite name="HelloComposition" factory="Hello">
    <import specification="org.apache.felix.ipojo.composition.ex1.person.Person"  aggregate="true"/>
    <provides<service specification="org.apache.felix.ipojo.composition.ex1.compohello.HelloDispatcherHello"/>
    <service specification="org.apache.felix.ipojo.composition.ex1.hellosay.HelloDispatcher"/>
    <service specification="org.apache.felix.ipojo.composition.ex1.saydirectory.DispatcherDirectory"/>
    <service<provides specification="org.apache.felix.ipojo.composition.ex1.directorycompo.DirectoryHelloDispatcher"/>
</composite>

This application The composite is described by a composite. This composite is expressed in term of service specification, resulting in an abstract component implementation; it declares:

  • Imports An import for all available Person service in services from the parent composite.
  • Sub-services for Hello, Dispatcher, and Directory services.
  • A provided HelloDispatcher service Provides the Hello Dispatch to the parent composite.
  • Instantiates inside the composition a Hello service, a Dispatcher Service and a Directory Service.

The providing is based on a method delagation on available specifications as depict When this composite is instantiated, all Person services from the parent composite are made available in the composite service registry and instances of the Hello, Dispatcher, and Directory are created from available factory services and their corresponding services are published in the composite service registry. The provided HelloDispatcher service is based on method delagation to sub-service specifications as depicted in the following image:

The delegation of HelloDispatcher service methods to sub-service methods is automatically performed by iPOJO based on method name and method parameter matching.

Composite Description Future Work

...