Delegates to jasper servlet with a controlled context class loader.

@see JspServlet#init(ServletConfig)
557071
@Override
	public void init(final ServletConfig config) throws ServletException {
		try {
			ContextClassLoaderUtils.doWithClassLoader(jasperClassLoader,
					new Callable<Void>() {

						@Override
						public Void call() throws Exception {
							config.getServletContext().setAttribute(
									org.apache.tomcat.InstanceManager.class
											.getName(), new InstanceManager());
							jasperServlet.init(config);
							return null;
						}

					});
		} catch (ServletException e) {
			// re-thrown
			throw e;
			//CHECKSTYLE:OFF
		} catch (Exception ignore) {
			// ignored as it should never happen
			LOG.error("Ignored exception", ignore);
		}
		//CHECKSTYLE:ON
	}
1169741
public void init(ServletConfig config)
        throws ServletException
    {
        super.init(config);

        try {
            if (_service == null) {
                String className = getInitParameter("service-class");
                Class<?> serviceClass = null;

                if (className != null) {
                    ClassLoader loader = Thread.currentThread().getContextClassLoader();

                    if (loader != null)
                        serviceClass = Class.forName(className, false, loader);
                    else
                        serviceClass = Class.forName(className);
                }
                else {
                    if (getClass().equals(BurlapServlet.class))
                        throw new ServletException("server must extend BurlapServlet");

                    serviceClass = getClass();
                }

                _service = serviceClass.newInstance();

                if (_service instanceof BurlapServlet)
                    ((BurlapServlet) _service).setService(this);
                if (_service instanceof Service)
                    ((Service) _service).init(getServletConfig());
                else if (_service instanceof Servlet)
                    ((Servlet) _service).init(getServletConfig());
            }

            if (_apiClass == null) {
                String className = getInitParameter("api-class");

                if (className != null) {
                    ClassLoader loader = Thread.currentThread().getContextClassLoader();

                    if (loader != null)
                        _apiClass = Class.forName(className, false, loader);
                    else
                        _apiClass = Class.forName(className);
                }
                else
                    _apiClass = _service.getClass();
            }

            _skeleton = new BurlapSkeleton(_service, _apiClass);
        } catch (ServletException e) {
            throw e;
        } catch (Exception e) {
            throw new ServletException(e);
        }
    }
220953
@Override
    public void init(FilterConfig filterConfig) throws ServletException {
        LOG.info("AtlasAuthenticationFilter initialization started");
        final FilterConfig globalConf = filterConfig;
        final Map<String, String> params = new HashMap<>();
        try {
            configuration = ApplicationProperties.get();
        } catch (Exception e) {
            throw new ServletException(e);
        }

        if (configuration != null) {
            headerProperties = ConfigurationConverter.getProperties(configuration.subset("atlas.headers"));
        }

        FilterConfig filterConfig1 = new FilterConfig() {
            @Override
            public ServletContext getServletContext() {
                if (globalConf != null) {
                    return globalConf.getServletContext();
                } else {
                    return nullContext;
                }
            }

            @SuppressWarnings("unchecked")
            @Override
            public Enumeration<String> getInitParameterNames() {
                return new IteratorEnumeration(params.keySet().iterator());
            }

            @Override
            public String getInitParameter(String param) {
                return params.get(param);
            }

            @Override
            public String getFilterName() {
                return "AtlasAuthenticationFilter";
            }
        };

        super.init(filterConfig1);

        optionsServlet = new HttpServlet() {
        };
        optionsServlet.init();
    }
583638
@SuppressWarnings("unchecked")
    public void init() throws ServletException {
	// Method re-written for PQ47469
	String servlets = getRequiredInitParameter(PARAM_SERVLET_PATHS);
	StringTokenizer sTokenizer = new StringTokenizer(servlets);
	Vector servletChainPath = new Vector();

	while (sTokenizer.hasMoreTokens() == true) {
		String path = sTokenizer.nextToken().trim();
			
		if (path.length() > 0) {
			servletChainPath.addElement(path);
		}
	}

	int chainLength = servletChainPath.size();

	if (chainLength > 0) {
		this.chainPath = new String[chainLength];
			
		for (int index = 0; index < chainLength; ++index) {
			this.chainPath[index] = (String)servletChainPath.elementAt(index);
		}
	}

    }
83576
@Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        m_fedoraServerHost = m_server.getParameter("fedoraServerHost");
    }
205583
public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    String dirBrowse = filterConfig.getInitParameter("directoryBrowsingDisallowed");

    if (dirBrowse != null) {
      dirBrowse = dirBrowse.toLowerCase();

      directoryBrowsingDisallowed = dirBrowse.equals("yes") ||
                                    dirBrowse.equals("true");
    }
  }
245424
public static final void init(final CClassLoaderConfig config) {
		CClassLoader.installURLStreamHandlerFactory();
		if (CClassLoader.getRootLoader().isInit()) {
			return;
		}

		// initialize the loaders default parameters.
		for (final Iterator it = config.getLoadersInfoMap().entrySet()
				.iterator(); it.hasNext();) {
			final Map.Entry entry = (Map.Entry) it.next();
			final String loaderPath = (String) entry.getKey();
			final CClassLoaderConfig.CLoaderInfo info = (CClassLoaderConfig.CLoaderInfo) entry
					.getValue();
			final CClassLoader loader = CClassLoader.getLoader(loaderPath);
			loader.config = config;
			loader.booAlone = info.isAlone();
			loader.booDoNotForwardToParent = info.isDoNotForwardToParent();
			loader.booMandatory = info.isMandatory();

			if (loader.isMandatory()) {
				CClassLoader.mandatoryLoadersMap.put(loader.getPath(), loader);
			}

			loader.booResourceOnly = info.isResourceOnly();
		}
		// lookup classes/resources in filesystem
		for (final Iterator it = config.getFilesMap().entrySet().iterator(); it
				.hasNext();) {
			final Map.Entry entry = (Map.Entry) it.next();
			final String loaderPath = (String) entry.getKey();
			final List list = (List) entry.getValue();
			final CClassLoader loader = CClassLoader.getLoader(loaderPath);

			for (final Iterator f = list.iterator(); f.hasNext();) {
				final Object obj = f.next();
				if (obj instanceof URL) {
					final URL file = (URL) obj;
					String name = file.toString();
					final int index = name.indexOf(loaderPath);
					if (index != -1) {
						name = name.substring(index + loaderPath.length());
					}
					if (name.endsWith(".jar")) {
						loader.addResource(name, file);
						loader.readDirectories(file);
					} else {
						loader.addResource(name, file);
						if (!loader.booResourceOnly && name.endsWith(".class")) {
							name = name.substring(0, name.lastIndexOf('.'));
							name = name.replace('\\', '/');
							name = name.replace('/', '.');
							loader.addClass(name, file);
						} else if (name.startsWith("native/")) {
							String system = name.substring(7);
							system = system.substring(0, system.indexOf('/'));
							if (!loader.dllMap.containsKey(system)) {
								loader.dllMap.put(system, file);
							}
							if (!loader.resourcesMap.containsKey(name)) {
								loader.resourcesMap.put(name, file);
							} else {
								final Object to = loader.resourcesMap.get(name);
								if (to instanceof URL) {
									final URL uo = (URL) to;
									final List l = new ArrayList();
									l.add(uo);
									l.add(file);
									loader.resourcesMap.put(name, l);
								} else if (to instanceof List) {
									final List uo = (List) to;
									uo.add(file);
									loader.resourcesMap.put(name, uo);
								}
							}
						}
					}
				}
			}
		}

		// set init state
		CClassLoader.setInit(CClassLoader.getRootLoader());
	}
424766
static void initialize() {
        if (INITIALIZED.getAndSet(true)) {
            throw new IllegalStateException("Already initialized");
        }
        // Set the default initializer if none has been provided yet.
        INITIALIZER.compareAndSet(null, new ServiceLoaderZoneRulesInitializer());
        INITIALIZER.get().initializeProviders();
    }
1329040
public void initialize() throws ServletException, Throwable {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
            logger.entering(CLASS_NAME, "Initialize : app = " + config.getApplicationName() + ", initialized = " + initialized + ", destroyed = " + destroyed);
        
        if (!initialized && !destroyed) {
            synchronized (lock) {
                if (!initialized && !destroyed &&!com.ibm.ws.webcontainer.osgi.WebContainer.isServerStopping()) {
                    initialize(this.config, this.moduleConfig, this.extensionFactories);
                    started();
                    initialized = true;
                    config.setSessionCookieConfigInitilialized();
                }
            }
        }
               
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
            logger.exiting(CLASS_NAME, "Initialize : initialized = " + initialized + ", destroyed = " + destroyed);

    }
37423
@Override
	public void init(ServletContext context, JawrConfig config) {
		this.context = context;
		this.charset = config.getResourceCharset();
	}
925786
@Override
	public void init() throws ServletException {
		super.init();
		try {
			config = new Config("/config/serfj.properties");
		} catch (ConfigFileIOException e) {
			LOGGER.error("Can't load framework configuration", e);
			throw new ServletException(e);
		}
		urlInspector = new UrlInspector(config);
	}
851596
@Override
    public void init(ApplicationConfig config) 
    	throws ServletException {

        // The ApplicationConfig is used by the Application to configure itself.
        mConfig = config;

        // A log for keeping track of events specific to this application
        mLog = config.getLog();

    }
398016
@SuppressWarnings("unchecked")
	public void init() throws ServletException {
		Map<String, Object> config = null;
		String type = getServletConfig().getInitParameter("type");

		ServletContext servletContext = getServletContext();
		configHash = (Integer) servletContext
				.getAttribute(JawrGrailsConstant.JAWR_GRAILS_CONFIG_HASH);

		if (JawrConstant.CSS_TYPE.equals(type))
			config = (Map<String, Object>) servletContext
					.getAttribute(JawrGrailsConstant.JAWR_GRAILS_CSS_CONFIG);
		else if (JawrConstant.BINARY_TYPE.equals(type))
			config = (Map<String, Object>) servletContext
					.getAttribute(JawrGrailsConstant.JAWR_GRAILS_BINARY_CONFIG);
		else
			config = (Map<String, Object>) servletContext
					.getAttribute(JawrGrailsConstant.JAWR_GRAILS_JS_CONFIG);

		Properties jawrProps = (Properties) config
				.get(JawrGrailsConstant.JAWR_GRAILS_CONFIG_PROPERTIES_KEY);
		try {
			if (JawrConstant.BINARY_TYPE.equals(type)) {
				this.requestHandler = new JawrBinaryResourceRequestHandler(
						servletContext, config, jawrProps);
			} else {
				this.requestHandler = new JawrRequestHandler(servletContext,
						config, jawrProps);
			}

			if (JawrConstant.JS_TYPE.equals(type)) {
				servletContext.setAttribute(
						JawrGrailsConstant.JAWR_GRAILS_JS_REQUEST_HANDLER,
						requestHandler);
			} else if (JawrConstant.CSS_TYPE.equals(type)) {
				servletContext.setAttribute(
						JawrGrailsConstant.JAWR_GRAILS_CSS_REQUEST_HANDLER,
						requestHandler);
			} else if (JawrConstant.BINARY_TYPE.equals(type)) {
				servletContext.setAttribute(
						JawrGrailsConstant.JAWR_GRAILS_BINARY_CONFIG,
						requestHandler);
			}
		} catch (ServletException e) {
			LOGGER.error("Jawr servlet with name"
					+ getServletConfig().getServletName()
					+ " failed to initialize properly. ");
			LOGGER.error("Cause:");
			LOGGER.error(e.getMessage(), e);
			throw e;
		} catch (RuntimeException e) {
			LOGGER.error("Jawr servlet with name"
					+ getServletConfig().getServletName()
					+ " failed to initialize properly. ");
			LOGGER.error("Cause: ");
			LOGGER.error(e.getMessage(), e);
			throw new ServletException(e);
		}
	}
993715
@Override
  public void contextInitialized(ServletContextEvent event) {
    this.event = event;
    this.serverContainer = getServerContainer(event);
    super.contextInitialized(event);
  }
401533
private void initConfigPropertyResolver(ServletContext context) {
		String configPropertyResolverClass = getInitParameter("configPropertyResolverClass");
		// Load a custom class to set configPropertyResolver
		configPropResolver = null;
		if (null != configPropertyResolverClass) {
			configPropResolver = (ConfigPropertyResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configPropertyResolverClass);
			if (configPropResolver instanceof ServletContextAware) {
				((ServletContextAware) configPropResolver).setServletContext(context);
			}
		}
	}
263674
@Override
  public void init(final FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    configUrl = filterConfig.getInitParameter("xslt");

    if ((configUrl != null) && debug()) {
      debug("Filter " + filterConfig.getFilterName() +
                                        " using xslt " + configUrl);
    }

    String temp = filterConfig.getInitParameter("ignoreContentType");

    ignoreContentType = "true".equals(temp);
  }
1141806
@Override
    public void contextInitialized(ServletContextEvent event) {
        try {
            initEurekaEnvironment();
            initEurekaServerContext();

            ServletContext sc = event.getServletContext();
            sc.setAttribute(EurekaServerContext.class.getName(), serverContext);
        } catch (Throwable e) {
            logger.error("Cannot bootstrap eureka server :", e);
            throw new RuntimeException("Cannot bootstrap eureka server :", e);
        }
    }