did i get you right, that i can simply inject ObjectLocator service to my Quartz JobFactory and instantiate jobs via autobuild()
I mean sources saying all dependencies will be injected. On Tue, Jun 7, 2011 at 8:20 PM, Howard Lewis Ship <hls...@gmail.com> wrote: > Unfortunately, Tapestry is not Spring :-) The proxy you get back from > a direct or indrect call to getService() is always global, though in > the case of the perthread scope, that core service implementation is > ... another proxy that manages and delegates to the per-thread > instance. > > I think you need to use an explicit factory if you want to control > when new instances are created. In fact, for ordinary beans, you can > get the BeanModelSource, get a BeanModel for a class, and use its > newInstance() method. > > However, that's roundabout, because newInstance() gets the > ObjectLocator (which can be injected into any service) and invokes > autobuild() on it ... so it's a very generic factory. > > On Tue, Jun 7, 2011 at 8:52 AM, Dmitriy Vsekhvalnov > <dvsekhval...@gmail.com> wrote: > > i was hoping someone already did it :) > > > > Last time i was trying to do it with Hivemind, proxy created a new > instance > > every method call, and this is not what i want. I mostly likely want > > no-proxy, but just new instance. > > > > On Tue, Jun 7, 2011 at 6:32 PM, Thiago H. de Paula Figueiredo < > > thiag...@gmail.com> wrote: > > > >> On Tue, 07 Jun 2011 10:47:23 -0300, Dmitriy Vsekhvalnov < > >> dvsekhval...@gmail.com> wrote: > >> > >> Hi all, > >>> > >> > >> Hi! > >> > >> > >> is it possible to have services bound with Bean scope? I'm using > Quartz > >>> scheduler and my jobs are actually services bound in AppModule with all > >>> dependency injection and so on. > >>> But i want different instances of jobs. So every time i call > >>> ServiceResources:getService(..., Job.class) > >>> i want new instance back. > >>> > >> > >> Is what do you want the same as the prototype scope in Spring? > >> > >> > >> I remember it was not possible to implement with Hivemind, how about > >>> Tapestry-IOC? > >>> > >> > >> Tapestry-IoC provides singleton and per-thread scopes out of the box, > but > >> you can add your own ones. Implement ServiceLifecycle2 and contribute it > to > >> the ServiceLifecycleSource service. Take a look at the > >> PerThreadServiceLifecycle source for an example. > >> > >> -- > >> Thiago H. de Paula Figueiredo > >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > >> and instructor > >> Owner, Ars Machina Tecnologia da Informação Ltda. > >> http://www.arsmachina.com.br > >> > > > > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > > The source for Tapestry training, mentoring and support. Contact me to > learn how I can get you up and productive in Tapestry fast! > > (971) 678-5210 > http://howardlewisship.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >