The easiest way I can think of is to have an ApplicationContextProvider
service which is defined by your tapestry module.

eg:
@UsesOrderedConfiguration(String.class)
public interface ApplicationContextProvider {
ApplicationContext getApplicationContext();
}

Then, in your custom SpringModuleDef you'll call
ServiceBuilderResources.getService(ApplicationContextProvider.class) to get
an ApplicationContext instance.

You could then have use distributed configuration to define the app context
files for the OrderedConfiguration.

As I said earlier, I think this highlights a bigger problem that you need
the servlet api on your classpath for a non-web app. Perhaps
tapestry-spring needs to be split into tapestry-ioc-spring and
tapestry-spring.

Reply via email to