{
loader.closeWebApplicationContext(servletContext);
}
};
final RegistryShutdownHub shutdownHub = resources.getService(RegistryShutdownHub.class);
return new ObjectCreator()
{
public Object createObject()
{
return resources.getTracker().invoke(
"Creating Spring ApplicationContext via ContextLoader",
new Invokable<Object>()
{
public Object invoke()
{
resources.getLogger().info(
String.format("Starting Spring (version %s)", SpringVersion
.getVersion()));
WebApplicationContext context = loader
.initWebApplicationContext(servletContext);
shutdownHub.addRegistryShutdownListener(shutdownListener);
applicationContextCreated.set(true);
return context;
}