Yes, I have been reading about that, and I might go this route. I also saw 
mentioned that the @Provides annotation supports a "strategy" property to allow 
me to create a new instance for every request, another requirement I have. 
Something like this:

@Provides(strategy="instance")

However, "strategy" is not documented in the iPOJO reference card at 
http://felix.apache.org/site/ipojo-reference-card.html. Is strategy an 
officially supported property? Will I run into problems in the future if I use 
it?

Thanks for your help!

john

-----Original Message-----
From: Clement Escoffier [mailto:[email protected]] 
Sent: Wednesday, July 15, 2009 9:21 AM
To: [email protected]
Subject: Re: iPOJO temporary service instances?


On 15.07.2009, at 00:19, John Stump wrote:

> There is a pattern I am trying to recreate within the iPOJO world,  
> but I can't quite figure it out.
>
> I want to be able to look up a service, create an instance of it,  
> use it, and toss it away. What iPOJO seems to support is creating  
> instances of services up front and have them ready and waiting. But  
> I don't want that. I want a service to be instantiated on demand.  
> How do I do this?
>
> One thought I had was to not create an instance of the service in  
> the metadata.xml, then the client can get the factory of the  
> service, create an instance, then discard it when it is through with  
> it. But this approach seems somewhat clumsy. Is there a better way?
>

By the way, iPOJO creates service objects only when they are needed  
(laziness) except if you configure it to be immediate.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to