Chris, The service implementation returned by the ServicePoint object is indeed cached. But it's up to the ServiceModel object to supply it. And often (for all models but "primitive") this won't be the actual core service implementation (CSI) but rather a proxy object, which will lazily create the CSI and delegate to it.
That being said I don't think you can implement "template" (usually refered to as "prototype" in Spring) as you see it as a service model. What you could quite easily do is implement a service model which returns a new CSI for every method invocation on the service. But that's not what you want, is it? Take a look at the HiveMind BeanFactory: http://jakarta.apache.org/hivemind/hivemind-lib/BeanFactoryBuilder.html. If you need more advanced dependency injection on the created objects you will have to roll your own. Take a look at this message for some ideas: http://tinyurl.com/9m4kn. We're looking into implementing reusable code more advanced dependency injection, a la BuilderFactory, in HiveMind 1.2. HTH, --knut On 9/29/05, Chris Burnley <[EMAIL PROTECTED]> wrote: > Hi, I'd like to query why ServicePointImpl.getService method caches the > service object. > > I'm implementing a "template" service model which always creates new > instances ( perhaps I'm going about it the wrong way), which of course > doesn't work because the the service is cached in ServicePointImpl. I > realise that in theory services should be usually mostly stateless and > interchangeable, but that is contradicted by the existence of the thread > service model. > > Shouldn't the reference returned be the responsibility of ServiceModel ? > > regards, > > Chris Burnley > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
