How about extend the ObjectProvider interface, which
allows you to use <set-object> in
<invoke><construct/></invoke> to inject fresh objects
into services.

If your objects need service injection, you can inject
the services to your ObjectProvider first, which then
injects these services into every object it creates.

At least that's what I do currently.  Anyone has
better patterns?

Albert

 --- "Liebig, Stefan " <[EMAIL PROTECTED]>
內容:
> Well, I guess that the use case does not really fit
> what Hivemind is intended to do
> and it wouldn愒 be a problem if that would not be
> possible. But I first thought that the
> service models give me the freedom to implement
> whatever I need/want. Maybe I
> should have read the JavaDoc of ServiceModel more
> carefully!
>  
> However, the intention is to use Hivemind also as a
> kind of object factory (not only
> as a service factory) to retrieve programmatically
> objects from the Hivemind-Registry,
> which have state. This could also be done by plain
> Java factories. But why not
> reuse the rich toolset of Hivemind for constructing
> POJOs.
>  
> Stefan
> email: [EMAIL PROTECTED]
> 
> 
> ________________________________
> 
> Von: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
> Gesendet: Di 11.01.2005 13:17
> An: [email protected]
> Betreff: Re: Trying to create a 慨ew instance"
> service mode l, but ..
> 
> 
> 
> I missed what you are trying to do, I thought this
> was something
> previously discussed, but it's new.
> 
> What's your use case? Why would you need this? What
> do you get that
> threaded or pooled doesn't give you.
> 
> 
> 
> 
> On Mon, 10 Jan 2005 23:36:14 -0800, Liebig, Stefan
> <[EMAIL PROTECTED]> wrote:
> > I have looked at the ThreadedServiceModel and I
> can not see how
> > I can realize that I get for each service request
> a new instance
> > of my service. The only thing I can do is to get
> for each method
> > invocation on a service a new instance. But this
> is different from
> > what I want.
> > Am I missing something?
> >
> > Prototype? I would not associate this term with
> that what I need.
> > Isn愒 a prototype not something unique?
> >
> > Stefan
> > email: [EMAIL PROTECTED]
> >
> > -----Original Message-----
> > From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
> > Sent: Mon 10.01.2005 14:33
> > To: [email protected]
> > Subject: Re: Trying to create a 慨ew instance"
> service model, but ..
> >
> > A good name for this would be "prototype", because
> that's what Spring
> > uses for the same concept.
> >
> > Look at how ThreadedServiceModel works.
> >
> > You basically need a proxy that obtains a fresh
> instance from the
> > ServiceModel for each method invocation.
> >
> > On Mon, 10 Jan 2005 02:04:33 -0800, Liebig, Stefan
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > I tried to create a 慨ew instance&#65533;
service
> model. This service model should
> > > create for each service request a new instance.
> But as I found out this is
> > > not possible because ServicePointImpl
惡aches&#65533;
> the service once created.
> > >
> > > My question - independent on how usefull a 慨ew
> instance&#65533; service model might
> > > be - is:
> > > Shouldn愒 this caching not be part of the
> specific service model? I think the
> > > current solution limits the usage of service
> models.
> > >
> > > Stefan
> > >
> > > email: [EMAIL PROTECTED]
> > >
> > >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Jakarta Tapestry
> > Creator, Jakarta HiveMind
> >
> > Professional Tapestry training, mentoring, support
> > and project work.  http://howardlewisship.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
> 
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=====
Are you an MBA?  Check out http://www.mba.hk for value added services.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to