// Build an environment wrapper
// If the current env is a facade, change the delegate and continue processing the facade, since
// we may have other redirects that will in turn also change the facade delegate
MutableEnvironmentFacade facade = environment instanceof MutableEnvironmentFacade ?
((MutableEnvironmentFacade)environment) : null;
if (facade != null) {
// Consider the facade delegate (the real environment)
environment = facade.getDelegate();
}
Environment newEnv = new ForwardEnvironmentWrapper(environment, this.manager, uri, getLogger());
if (facade != null) {
// Change the facade delegate
facade.setDelegate((EnvironmentWrapper)newEnv);
newEnv = facade;
}
// Get the processor that should process this request
TreeProcessor processor;