I don't know how to inject the Registry as a service, but I'd like to ask, why ? And what's the flaw in having only one Tapestry instance per JVM ?
*---------------------* *Muhammad Gelbana* http://www.linkedin.com/in/mgelbana On Sat, Oct 19, 2013 at 11:21 AM, Martin Kersten < martin.kersten...@gmail.com> wrote: > Hi there, > > I just wonder why the registry is not available as a service. > > Doing all those test writing I got used to handle the Registry directly. > Since the Registry represents the IOC for me, I just wonder why it is ment > to that the registry can not directly be injected (or do I miss something > here). > > The only reference I found was that the Registry adds itself to the > SerializationSupport. Which by checking the references looks like a relict > and should be removed from the code. It looks like that tapestry tries to > impose a single tapestry instance per JVM which seams to me like a design > flaw. (If you collect things to change for Tapestry 6 maybe one should add > that multiple instances of tapestry should be possible per JVM so no more > use of static references). > > So unitl I missed something, I just wonder why I can not do something like: > > ServiceImpl(Registry){...} > > I can provide it easily by doing something like: > > binder.bind(RegisteryReference.class); > > --- > registery.getService(RegisteryReference).setRegistery(registry); > > And then I inject the reference in my services. The reference uses a weak > link to ease gc on shutdown. > > (Or I just bind a registry wrapper that delegates the registry interaction > towards the real registry once it is created). > > Any comments why this is not available by default or did I missed the point > here and its already in place? > > > Cheers, > > Martin (Kersten), > Germany >