On Feb 28, 2008, at 7:32 AM, anujith amaratunga wrote:
 Registry from the HttpSessionListener
itself, so I can pull out my service. Is there a way to access the Registry
from a non page, non service class?

You can create a registry by doing something like:
RegistryBuilder builder = new RegistryBuilder();
builder.add(MiniAppModule.class);
Registry registry = builder.build();
registry.performRegistryStartup();
Hello hello = registry.getService(Hello.class);
(See http://wiki.apache.org/tapestry/Tapestry5HowToIocOnly)

However this will create a new instance of the registry. It won't be the same instance that you have available elsewhere. I don't know if there is a way to get a reference to the same registry that is being used by ioc elsewhere in the program.

Most of the time it doesn't really matter because your services should usually be stateless anyway.

Mark

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

Reply via email to