Associates this ResourceInjector with the component environment of the
given servlet context.
if (!(servletContext instanceof ApplicationContextFacade)) {
return;
}
final ApplicationContextFacade contextFacade =
(ApplicationContextFacade) servletContext;
StandardContext context = null;
if (System.getSecurityManager() != null) {
context = (StandardContext) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return contextFacade.getUnwrappedContext();
}
});
} else {
context = contextFacade.getUnwrappedContext();
}
if (context != null) {
desc = (JndiNameEnvironment)
Switch.getSwitch().getDescriptorFor(context);
}