Hi all, sorry if this question is to naive but i am struggling to
understand how
iPOJO indentifies the extender matching bundles.

I have a super class and a concrete class that i want to perform some
logic, first i have
thought that iPOJO automatically by declaring the property:

> <provides specifications="Algorithm"/>
>
on the concrete class.

Then i've done some more reading and i have seen the PAX-WEB example and i
tried to declare
the property <Algorithm> in the concrete class bundle manifest header.

So my question is how to declare the property so the extender service can
identify the bundle?

I've declared and implemented my extender service as follows:


    <component
>         classname="com.MyExtender"
>         name = "MyExtender" public="false">
>         <extender:extender
>             extension="Algorithm" onArrival="onBundleArrival"
> onDeparture="onBundleDeparture" />
>         <callback transition="invalidate" method="stop" />
>         <callback transition="validate" method="start" />
>     </component>
>     <instance
>         name="algorithm.extender"
>         component="MyExtender">
>     </instance>
>

The superclass:

public abstract class Algorithm{
>
> String name;
> String version;
>
> public Algorithm(String name, String version){
>     this.name = name;
>     this.version = version;
> }
>
> public String getName(){
>     return name;
> }
> ...
>
> abstract public void computeSomething(Map<a,b> data);
>

And concrete subclasses as follows:

public class ConcreteAlgorithm extends Algorithm{
>
> Map<a,b> data;
>
> public ConcreteAlgorithm(String name, Map<a,b> data){
>     super(name);
>     data = data;
> }
>
> public void computeSomething(Map<a,b> data){
>     //compute data
> }


Best regards,
Luis

Reply via email to