// Create the source resolver relative to the environment.
// Design note : creating the SourceResolver could also have been done
// in TreeProcessor.invoke(), but doing it here ensures we use the local
// component manager used by all other nodes.
EnvironmentSourceResolver resolver = new EnvironmentSourceResolver(this.manager, env);
SitemapRedirector redirector = new SitemapRedirector(env);
Map objectModel = env.getObjectModel();
Object oldResolver = objectModel.get(OBJECT_SOURCE_RESOLVER);
Object oldRedirector = env.getAttribute(REDIRECTOR_ATTR);
objectModel.put(OBJECT_SOURCE_RESOLVER, resolver);
env.setAttribute(REDIRECTOR_ATTR, redirector);
try {
// FIXME : is there any useful information that can be passed as top-level parameters,
// such as the URI of the mount point ?
return invokeNodes(this.children, env, context);
} finally {
// Restore old redirector and resolver
env.setAttribute(REDIRECTOR_ATTR, oldRedirector);
objectModel.put(OBJECT_SOURCE_RESOLVER, oldResolver);
// Dispose the resolver
resolver.dispose();
}
}