I'd like to use tapestry-ioc outside the context of a web app but I'm running
into a conceptual problem. I need to create and destroy objects in response to
asynchronous events, so I've defined the following interface:
public interface ServiceFactory
{
public Service createService(Registry registry);
}
I pass the registry object so the service factory can look up all the necessary
services in order to construct the particular service.
I'd like the event publisher to be in the Tapestry Registry with the following
interface:
public interface EventPublisher
{
public void addServiceFactory(ServiceFactory factory);
}
The problem is, I don't know how to get the registry object into the
EventPublisher's implementation. Ideally, I'd like to inject the Registry into
the EventPublisherImpl's constructor, but I know that's impossible under
5.0.4's implementation. What do you think about enhancing injection to support
this kind of bootstrapping?