It is, not as the Registry service, but as the ObjectLocator service (Registry extends ObjectLocator and ObjectLocator is the one that declares the getService(), getObject() and autobuild() methods).
Tapestry-IoC does *not* impose one Registry per JVM. Same for Tapestry(-core). You can create as many Registry instances you want using RegistryBuilder. Tapestry(-core) automatically creates one Registry per web application, but you can create as many as you want using RegistryBuilder. For more information, read http://tapestry.apache.org/starting-the-ioc-registry.html. By the way, it would be nice to ask how to do something instead of why x doesn't exist, because sometimes it does exist, as that's the case with both statements in the original message in the thread. On Sat, Oct 19, 2013 at 6: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 > -- Thiago