javax.naming.Context context = null;
if (isUseNaming() && namingContextListener != null) {
context = namingContextListener.getEnvContext();
}
Map<String, Map<String, String>> injectionMap =
buildInjectionMap(getIgnoreAnnotations() ? new NamingResources(): getNamingResources());
instanceManager = new DefaultInstanceManager
(context, injectionMap, this, this.getClass().getClassLoader());
getServletContext().setAttribute(InstanceManager.class.getName(), instanceManager);
} else {
getServletContext().setAttribute(InstanceManager.class.getName(), instanceManager);