felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Problem trying to use iPOJO Maven plugin
Date Thu, 01 Mar 2007 21:31:02 GMT
Steven E. Harris wrote:
> Clement Escoffier <clement.escoffier@gmail.com> writes:
>> If you want to create on POJO object, add immediate="true" in the
>> component tag. By default, the POJO instantiation are delayed
>> (lazzy). If you do not have "immediate="true" or a invalid->invalid
>> callback, your POJO is not instantiated until it is really needed
>> (to serve a service for example).
> That's not what I'm seeing here. I took another bundle of mine that
> exposes one service. Here's the iPOJO metadata file with the names
> changed:
> ,----
> | <?xml version="1.0" encoding="UTF-8"?>
> | <iPOJO>
> |    <component className="mycorp.Service"
> |               factory="no">
> |       <provides/>
> |    </component>
> |    <instance component="mycorp.Service"
> |              name="myservice"/>
> | </iPOJO>
> `----
> Note that by specifying the "factory" attribute as "no", my intention
> was to not expose a service factory for this component.
> When this bundle starts, I see that it's registered a service with
> "mycorp.Service" as the service class, a "factory.pid" property of
> "mycorp.Service", and a "service.pid" property of "myservice". No
> other bundles are using the service or have every requested it, so I'm
> surprised to see the service registered.
> I'm trying to emulate the lazy loading and exposure of services
> (non-immediate, delayed activation) provided by DS. Does iPOJO offer
> the same capability? It looks like the "mycorp.Service" component
> described above is being treated as an "immediate" component, at least
> by default.

Your above metadata is creating an instance of your component with the 
<instance> element, thus you are seeing a service being registered 
immediately. However, an actual component instance should not be created 
until someone actually tries to use the service. At least that is my 
understanding of how iPOJO works by default.

-> richard

View raw message