This method is called automatically when the
servlet is initializing.
962839
@Override
	public void initialize() {
		/*
		 * Two resource providers are defined. Each one handles a specific
		 * type of resource.
		 */
		List<IResourceProvider> providers = new ArrayList<>();
		providers.add(new PatientResourceProvider());
		providers.add(new OrganizationResourceProvider());
		setResourceProviders(providers);
		
		/*
		 * Use a narrative generator. This is a completely optional step, 
		 * but can be useful as it causes HAPI to generate narratives for
		 * resources which don't otherwise have one.
		 */
		INarrativeGenerator narrativeGen = new DefaultThymeleafNarrativeGenerator();
		getFhirContext().setNarrativeGenerator(narrativeGen);

		/*
		 * Enable CORS
		 */
		CorsConfiguration config = new CorsConfiguration();
		CorsInterceptor corsInterceptor = new CorsInterceptor(config);
		config.addAllowedHeader("Accept");
		config.addAllowedHeader("Content-Type");
		config.addAllowedOrigin("*");
		config.addExposedHeader("Location");
		config.addExposedHeader("Content-Location");
		config.setAllowedMethods(Arrays.asList("GET","POST","PUT","DELETE","OPTIONS"));
		registerInterceptor(corsInterceptor);

		/*
		 * This server interceptor causes the server to return nicely
		 * formatter and coloured responses instead of plain JSON/XML if
		 * the request is coming from a browser window. It is optional,
		 * but can be nice for testing.
		 */
		registerInterceptor(new ResponseHighlighterInterceptor());
		
		/*
		 * Tells the server to return pretty-printed responses by default
		 */
		setDefaultPrettyPrint(true);
		
	}
831313
@PostConstruct
    public void init() {
        JFXDepthManager.setDepth(content, 1);
        JFXNodeUtils.addDelayedEventHandler(searchField, Duration.millis(400),
            KeyEvent.KEY_PRESSED, event -> highlighter.highlight(content, searchField.getText()));
    }
1313459
void init() throws MpJwtProcessingException {
        String methodName = "init";
        if (tc.isDebugEnabled()) {
            Tr.entry(tc, methodName);
        }
        setUpJsseHelper();
        if (this.jsseHelper == null) {
            if (tc.isDebugEnabled()) {
                Tr.exit(tc, methodName);
            }
            return;
        }
        Properties sslProps = null;
        try {
            sslProps = getSslPropertiesFromJsseHelper();
        } catch (Exception e) {
            String msg = Tr.formatMessage(tc, "ERROR_LOADING_SSL_PROPS", new Object[] { e.getLocalizedMessage() });
            Tr.error(tc, msg);
            throw new MpJwtProcessingException(msg, e);
        }
        setKeystoreAndTruststoreNames(sslProps);
        if (tc.isDebugEnabled()) {
            Tr.exit(tc, methodName);
        }
    }
1125189
protected void onStartup(ServletContext servletContext, Class<?> appConfig, int maxFileSize) {
    // Create the 'root' Spring application context
    AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    rootContext.setAllowBeanDefinitionOverriding(false);
    rootContext.register(appConfig);

    // Manage the lifecycle of the root application context
    servletContext.addListener(new ContextLoaderListener(rootContext));

    // Register and map the dispatcher servlet
    DispatcherServlet dispatcherServlet = new DispatcherServlet(rootContext);
    dispatcherServlet.setDispatchOptionsRequest(true);
    // instead of throwing a 404 when a handler is not found allow for custom handling
    dispatcherServlet.setThrowExceptionIfNoHandlerFound(true);

    ServletRegistration.Dynamic dispatcherServletRegistration =
        servletContext.addServlet("dispatcher", dispatcherServlet);
    if (dispatcherServletRegistration == null) {
      LOG.warn(
          "ServletContext already contains a complete ServletRegistration for servlet 'dispatcher'");
    } else {
      final long maxSize = (long) maxFileSize * MB;
      dispatcherServletRegistration.addMapping("/");
      dispatcherServletRegistration.setMultipartConfig(
          new MultipartConfigElement(null, maxSize, maxSize, FILE_SIZE_THRESHOLD));
      dispatcherServletRegistration.setAsyncSupported(true);
    }

    // add filters
    Dynamic browserDetectionFiler =
        servletContext.addFilter("browserDetectionFilter", BrowserDetectionFilter.class);
    browserDetectionFiler.setAsyncSupported(true);
    browserDetectionFiler.addMappingForUrlPatterns(
        EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), false, "*");

    Dynamic etagFilter = servletContext.addFilter("etagFilter", ShallowEtagHeaderFilter.class);
    etagFilter.setAsyncSupported(true);
    etagFilter.addMappingForServletNames(
        EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), true, "dispatcher");

    // enable use of request scoped beans in FrontController
    servletContext.addListener(new RequestContextListener());

    servletContext.addListener(HttpSessionEventPublisher.class);
  }
1215228
private static void init() {
        String pkgs = System.getProperty("java.protocol.handler.pkgs");
        if (pkgs == null || pkgs.trim().length() == 0) {
            pkgs = "org.jboss.net.protocol|org.jboss.vfs.protocol";
            System.setProperty("java.protocol.handler.pkgs", pkgs);
        } else if (pkgs.contains("org.jboss.vfs.protocol") == false) {
            if (pkgs.contains("org.jboss.net.protocol") == false) { pkgs += "|org.jboss.net.protocol"; }
            pkgs += "|org.jboss.vfs.protocol";
            System.setProperty("java.protocol.handler.pkgs", pkgs);
        }
    }
322991
@Override
    public void init(ServletConfig config) throws ServletException {
        LOGGER.info("Initializing filesystem resource servlet");
        super.init(config);

        final String directory = config.getInitParameter("directory");
        if (StringUtils.isNotBlank(directory)) {
            this.directory = directory;
        }

        final String absolute = config.getInitParameter("absolute");
        if (StringUtils.isNotBlank(absolute)) {
            this.absolute = BooleanUtil.valueOf(absolute);
        }
    }
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();

    }
460102
public void init(String webAppRfsPath, String servletMapping, String defaultWebApplication) {

        try {
            // explicit set to null to overwrite exiting values from session
            m_availableModules = null;
            m_fullDatabaseKey = null;
            m_databaseKey = null;
            m_databaseKeys = null;
            m_databaseProperties = null;
            m_configuration = null;
            m_installModules = null;
            m_moduleDependencies = null;
            m_sortedDatabaseKeys = null;
            m_moduleFilenames = null;

            if (servletMapping == null) {
                servletMapping = "/opencms/*";
            }
            if (defaultWebApplication == null) {
                defaultWebApplication = "ROOT";
            }
            m_servletMapping = servletMapping;
            m_defaultWebApplication = defaultWebApplication;

            setWebAppRfsPath(webAppRfsPath);
            m_errors = new ArrayList<String>();

            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(webAppRfsPath)) {
                m_configuration = new CmsParameterConfiguration(m_configRfsPath + CmsSystemInfo.FILE_PROPERTIES);
                readDatabaseConfig();
            }

            if (m_workplaceImportThread != null) {
                if (m_workplaceImportThread.isAlive()) {
                    m_workplaceImportThread.kill();
                }
                m_workplaceImportThread = null;
                m_newLoggingOffset = 0;
                m_oldLoggingOffset = 0;
            }
        } catch (Exception e) {
            e.printStackTrace();
            m_errors.add(e.toString());
        }
    }
936787
public void init() {
        if (logger != null && StringUtils.isNotEmpty(name)) {
            if (logger.isWarnEnabled() && !ConfigUtils.isFilePath(name)) {
                try {
                    List<String> realPaths = new ArrayList<String>();
                    Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources(name);
                    while (e.hasMoreElements()) {
                        URL url = (URL) e.nextElement();
                        realPaths.add(url.getFile());
                    }
                    if (realPaths.size() > 1) {
                        logger.warn("Multi httl config in classpath, conflict configs: " + realPaths + ". Please keep only one config.");
                    }
                } catch (IOException e) {
                    logger.error(e.getMessage(), e);
                }
            }
            if (logger.isInfoEnabled()) {
                String realPath = ConfigUtils.getRealPath(name);
                if (StringUtils.isNotEmpty(realPath)) {
                    logger.info("Load httl config from " + realPath + " in " + (name.startsWith("/") ? "filesystem" : "classpath") + ".");
                }
            }
        }
    }
1317939
private void initialize() {
		this.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				// Get the HttpSessionsSite
				HttpSessionsPanel panel = extension.getHttpSessionsPanel();
				HttpSessionsSite site = panel.getCurrentHttpSessionSite();
				if (site == null)
					return;

				// Get the selected session, mark it as active and trigger a table repaint
				HttpSession item = panel.getSelectedSession();
				site.setActiveSession(item);
			}
		});

	}
612387
public void contextInitialized(ServletContextEvent servletContextEvent) {
		ServletContext servletContext = servletContextEvent.getServletContext();

		File tempWriteDir = (File) servletContext
				.getAttribute("javax.servlet.context.tempdir");
		servletContext.setAttribute("audioFilePath", FILE_PROTOCOL + tempWriteDir
				.getAbsolutePath() + File.separatorChar);
		for (int i = 0; i < AUDIO_FILES.length; i++) {
			String audioFile = AUDIO_FILES[i];
			logger.info("Writing " + audioFile + " to webapp temp dir : "
					+ tempWriteDir);			
			InputStream is = servletContext.getResourceAsStream(AUDIO_DIR + "/" + audioFile);
			copyToTempDir(is, tempWriteDir, audioFile);
		} 

		Enumeration<String> initParamNames = servletContext
				.getInitParameterNames();
		logger.info("Setting init Params into application context");
		while (initParamNames.hasMoreElements()) {
			String initParamName = (String) initParamNames.nextElement();
			servletContext.setAttribute(initParamName, servletContext
					.getInitParameter(initParamName));
			logger.info("Param key=" + initParamName + ", value = "
					+ servletContext.getInitParameter(initParamName));
		}
		// map acting as a registrar
		servletContext.setAttribute("registeredUsersMap", new HashMap<String, String>());
		
		if(servletContextEvent.getServletContext().getAttribute(MS_CONTROL_FACTORY) == null) {
			DriverImpl d = new DriverImpl();
			properties = new Properties();
			properties.setProperty(MGCP_STACK_NAME, "SipServlets");
			properties.setProperty(MGCP_PEER_IP, PEER_ADDRESS);
			properties.setProperty(MGCP_PEER_PORT, MGW_PORT);
	
			properties.setProperty(MGCP_STACK_IP, LOCAL_ADDRESS);
			properties.setProperty(MGCP_STACK_PORT, CA_PORT);
	
			try {
				// create the Media Session Factory
				final MsControlFactory msControlFactory = new DriverImpl().getFactory(properties); 
				MsControlObjects.msControlFactory = msControlFactory;
				servletContextEvent.getServletContext().setAttribute(MS_CONTROL_FACTORY, msControlFactory);
				
				MMSUtil.msControlFactory = MsControlObjects.msControlFactory;
				String pathToAudioDirectory = (String)servletContextEvent.getServletContext().getAttribute("audioFilePath");
				MMSUtil.audioFilePath = pathToAudioDirectory;
				logger.info("started MGCP Stack on " + LOCAL_ADDRESS + "and port " + CA_PORT + " obj: " + MsControlObjects.msControlFactory);
			} catch (Exception e) {
				logger.error("couldn't start the underlying MGCP Stack", e);
			}
		} else {
			logger.info("MGCP Stack already started on " + LOCAL_ADDRESS + "and port " + CA_PORT);
		}
	}
736876
private void init()
    {
        //request.setCharacterEncoding(setting.getCharset());
        response.setCharacterEncoding(config.getCharset());
        response.setContentType("text/html;charset="+config.getCharset());
        response.setStatus(HttpServletResponse.SC_OK);
    }
717238
@PostConstruct
	public void init() {
		findBeans();
		SAXBuilder builder = new SAXBuilder();
		Document doc = null;
		try {
			doc = builder.build(getSchema().getInputStream());
			SchemaParserImpl schemaParser = new SchemaParserImpl();
			schemaParser.parse(doc);
			ParserSource parserSource = new InputStreamParserSource(getProcesses());
			
			ProcessTextProvider textProvider = new ProcessTextProvider(parserSource,schemaParser,this);
			ParsePackage parsePackage = new ParsePackage();
			parsePackage.parse(textProvider);
		} catch (Exception e) {
			throw new WorkflowException(e);
		}
		HashIdLogger.log(this,"postconstruct");
	}
136147
public void onServletInit (@Nonnull final Class <? extends GenericServlet> aServletClass)
  {
    if (LOGGER.isDebugEnabled ())
      LOGGER.debug ("onServletInit: " + aServletClass);
    _updateStatus (aServletClass, EServletStatus.INITED);
  }
642798
public synchronized void init() {
		for (SocketBinding binding : socketBindings) {
			socketBindingsMap.put(binding.getName(), binding);
		}
		for (SecurityRealm realm : securityRealms) {
			securityRealmsMap.put(realm.getName(), realm);
		}
		for (Interface iface : interfaces) {
			interfacesMap.put(iface.getName(), iface);
		}
		if (subsystem != null) {
			for (UndertowSubsystem.FileHandler handler : subsystem.getFileHandlers()) {
				handlersMap.put(handler.getName(), handler);
			}
			if (subsystem.getFilters() != null) {
				for (UndertowSubsystem.ResponseHeaderFilter filter : subsystem.getFilters().getResponseHeaders()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.ErrorPageFilter filter : subsystem.getFilters().getErrorPages()) {
					filtersMap.put(filter.getName(), filter);
				}
				for (UndertowSubsystem.CustomFilter filter : subsystem.getFilters().getCustomFilters()) {
					filtersMap.put(filter.getName(), filter);
				}
			}
		}
	}
1304964
private void initialize() {
		this.setContentPane(getJContentPane());
        this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        this.setTitle(TITLE);
		this.addWindowListener(new java.awt.event.WindowAdapter() {
		    @Override
		    public void windowClosing(WindowEvent winEvt) {
				  stop();
                  BrowserDialog.this.setVisible(false);
		    }
		});
        pack();
	    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
	    	this.setSize(640,480);
	    }

	}
772304
private synchronized void defaultInit() 
    {
        if (!_initialized)
        {
            _initialized = true;
            String sinkClasses = System.getProperty("LOG_SINKS","org.browsermob.proxy.jetty.log.OutputStreamLogSink");
            StringTokenizer sinkTokens = new StringTokenizer(sinkClasses, ";, ");
                    
            LogSink sink= null;
            while (sinkTokens.hasMoreTokens())
            {
                String sinkClassName = sinkTokens.nextToken();
                    	
                try
                {
                    Class sinkClass = Loader.loadClass(this.getClass(),sinkClassName);
                    if (org.browsermob.proxy.jetty.log.LogSink.class.isAssignableFrom(sinkClass)) {
                        sink = (LogSink)sinkClass.newInstance();
                        sink.start();
                        add(sink);
                    }
                    else
                        // Can't use Code.fail here, that's what we're setting up
                        System.err.println(sinkClass+" is not a org.browsermob.proxy.jetty.log.LogSink");
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }