You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Juan Arias <hw...@gmail.com> on 2011/05/06 12:33:47 UTC

doubt...

First of all, greetings and congrats for the hard work

My doubt:
I'm using ipojo annotations to build a sort of modular web application, so I
have to deal with "session" stuff,
what I'm doing right now is using a Factory of a given name to create
instances for each new session created

@Requires(name="webappFactory")
Factory webapp;

is there a means of via API obtain the factory for a certain Component??
Something like:

Factory factory = XXX.getFactoryFor(String name);

my problem is on session cleaning, when session is cleared I need to harvest
all created Instances of such session
and dispose them...

Thanks!!!
-- 
Juan Arias

Re: doubt...

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 5/6/11 6:33, Juan Arias wrote:
> First of all, greetings and congrats for the hard work
>
> My doubt:
> I'm using ipojo annotations to build a sort of modular web application, so I
> have to deal with "session" stuff,
> what I'm doing right now is using a Factory of a given name to create
> instances for each new session created
>
> @Requires(name="webappFactory")
> Factory webapp;
>
> is there a means of via API obtain the factory for a certain Component??
> Something like:
>
> Factory factory = XXX.getFactoryFor(String name);
>
> my problem is on session cleaning, when session is cleared I need to harvest
> all created Instances of such session
> and dispose them...

You are talking about iPOJO component factories, right?

They are all registered in the service registry with the service.pid 
property equal to the factory name, which is the name of the component 
class by default or the name you explicitly specify in your component 
declaration. So, you can always use the OSGi API to look them up.

-> richard

> Thanks!!!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org