Init method is called automatically with the service creation.
554933
public function init()
    {
        if ($this->getCache() === null) {
            $options = $this->getOptions();
            $this->setCache(Cache\StorageFactory::factory($options['cache']));
        }

        $this->isInit = true;
    }
875017
public function init()
    {
        $this->invokeBeforeContainerCreatedHook();

        $this->container = $this->createContainer();

        StaticContainer::push($this->container);

        $this->validateEnvironment();

        $this->invokeEnvironmentBootstrappedHook();

        Piwik::postEvent('Environment.bootstrapped'); // this event should be removed eventually
    }
187735
public void init() {
        if (FacesContext.getCurrentInstance().getPartialViewContext().isAjaxRequest()) {
            return;
        }

        if (id != null && !"".equals(id)) {
            entity = crudService.findById(id);
            if (entity == null) {
                log.info(String.format("Entity not found with id %s, a new one will be initialized.", id));
                id = null;
                entity = initEntity();
            }
        }
    }
1023724
protected function init()
    {
        $this->setupContainer();
        $this->configure();
        $this->errorHandling();
        $this->registerServices();

        $this->initialized = true;
    }
1324395
public void init() {
        if (executorService == null) {
            int numThreads = Math.min(Math.max(Runtime.getRuntime().availableProcessors(), 1), 4);
            executorService = Executors.newFixedThreadPool(numThreads);
            myOwnExecutorService = true;
        } else {
            myOwnExecutorService = false;
        }
    }
1226426
public void init() {
    waitForHandshake();

    availableServices = buildAvailableServices(getHostInfo());

    connect();

    // We always need a debugger, and it should never be included in the set of required services
    if (OperaDefaults.ENABLE_DEBUGGER &&
        !(requiredServices.contains(ScopeService.ECMASCRIPT) ||
          requiredServices.contains(ScopeService.ECMASCRIPT_DEBUGGER))) {
      if (availableServices.containsKey(ScopeService.ECMASCRIPT)) {
        requiredServices.add(ScopeService.ECMASCRIPT);
      } else {
        requiredServices.add(ScopeService.ECMASCRIPT_DEBUGGER);
      }
    } else {
      debugger = new MockEcmascriptDebugger();
    }

    services = createServices(requiredServices);
    enableServices(services.values());
    initializeServices(services.values());
  }
1331861
async function init () {
    // initialze logging
    initLogging(this.immutableApp)
    // initialize global dir config by merging module configs
    initDir(this.immutableApp)
    // initalize handlebars
    initHandlebars(this.immutableApp)
    // initalize express request handling - bodyParser, cookieParser, etc
    initExpress(this.immutableApp)
    // initialize app
    initApp(this.immutableApp)
    // add error handler after all other middleware and routers
    initErrorHandler(this.immutableApp)
    // initialize models
    await initModels(this.immutableApp)
    // intialize components after models since they may use models
    initComponents(this.immutableApp)
    // initialize services after models since they may use models
    await initServices(this.immutableApp)
    // set initialize flag to true
    this.immutableApp.initialized = true
    // debug
    debug('init', this.immutableApp)
}
287513
@SuppressFBWarnings("PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS")
    public void initServiceRegistryIfNecessary() {
        val size = this.serviceRegistry.size();
        LOGGER.trace("Service registry contains [{}] service definition(s)", size);

        LOGGER.warn("Service registry [{}] will be auto-initialized from JSON service definitions. "
            + "This behavior is only useful for testing purposes and MAY NOT be appropriate for production. "
            + "Consider turning off this behavior via the setting [cas.serviceRegistry.initFromJson=false] "
            + "and explicitly register definitions in the services registry.", this.serviceRegistry.getName());

        val servicesLoaded = this.jsonServiceRegistry.load();
        LOGGER.debug("Loaded JSON services are [{}]", servicesLoaded.stream().map(RegisteredService::getName).collect(Collectors.joining(",")));

        servicesLoaded
            .forEach(r -> {
                if (!findExistingMatchForService(r)) {
                    LOGGER.debug("Initializing service registry with the [{}] JSON service definition...", r.getName());
                    this.serviceRegistry.save(r);
                }
            });
        this.servicesManager.load();
        LOGGER.info("Service registry [{}] contains [{}] service definitions", this.serviceRegistry.getName(), this.servicesManager.count());

    }
846576
private synchronized void initialize() {
        Iterator types = EntityTypesLocator.getEntityTypes().getAllEntityTypes();
        String factoryName = null;

        while (types.hasNext()) {
            Class type = (Class) types.next();
            if (type != Object.class) {
                String factoryKey =
                        "org.apereo.portal.services.EntityNameFinderService.NameFinderFactory.implementation_"
                                + type.getName();
                try {
                    factoryName = PropertiesManager.getProperty(factoryKey);
                } catch (Exception runtime) {
                    String dMsg =
                            "EntityNameFinderService.initialize(): "
                                    + "could not find property for "
                                    + type.getName()
                                    + " factory.";
                    log.debug(dMsg);
                }
                if (factoryName != null) {
                    try {
                        IEntityNameFinderFactory factory =
                                (IEntityNameFinderFactory) Class.forName(factoryName).newInstance();
                        getNameFinders().put(type, factory.newFinder());
                    } catch (Exception e) {
                        String eMsg =
                                "EntityNameFinderService.initialize(): "
                                        + "Could not instantiate finder for "
                                        + type.getName()
                                        + ": ";
                        log.error(eMsg, e);
                    }
                }
            }
        }
        setInitialized(true);
    }
901553
private static void initIfNeeded()
   {
      if (!INITIALIZED)
      {
         synchronized (JCRAPIAspect.class)
         {
            if (!INITIALIZED)
            {
               ExoContainer container = ExoContainerContext.getTopContainer();
               JCRAPIAspectConfig config = null;
               if (container != null)
               {
                  config = (JCRAPIAspectConfig)container.getComponentInstanceOfType(JCRAPIAspectConfig.class);
               }
               if (config == null)
               {
                  TARGET_INTERFACES = new Class<?>[]{};
                  LOG.warn("No interface to monitor could be found");
               }
               else
               {
                  TARGET_INTERFACES = config.getTargetInterfaces();
                  for (Class<?> c : TARGET_INTERFACES)
                  {
                     Statistics global = new Statistics(null, "global");
                     Map<String, Statistics> statistics = new TreeMap<String, Statistics>();
                     Method[] methods = c.getMethods();
                     for (Method m : methods)
                     {
                        String name = getStatisticsName(m);
                        statistics.put(name, new Statistics(global, name));
                     }
                     JCRStatisticsManager.registerStatistics(c.getSimpleName(), global, statistics);
                     ALL_STATISTICS.put(c.getSimpleName(), statistics);
                  }
               }
               INITIALIZED = true;
            }
         }
      }
   }
920426
public void init() throws Exception {
        for (Object object : starters) {
            if (object instanceof LifeCycle)
                ((LifeCycle) object).init();
        }
    }
777189
@Override
    public void initialise(String root) {
        functionCalls.clear();
        variables.clear();
        initCreator(root);
    }
125984
protected void init() {
    if (settings.autostart()) {
      runner = settings.getRunner();
      logger.config("Using runner " + runner.getClass().getSimpleName());
    } else {
      settings.setPort(OperaDefaults.SERVER_DEFAULT_PORT_IDENTIFIER);
    }

    createScopeServices();

    // Launch Opera if the runner has been setup
    if (runner != null) {
      runner.startOpera();
    }

    services.init();
    debugger = services.getDebugger();
    debugger.setDriver(this);

    windowManager = services.getWindowManager();
    exec = services.getExec();
    core = services.getCore();
    cookieManager = services.getCookieManager();
    //cookieManager.updateCookieSettings();

    mouse = new OperaMouse(this);
    keyboard = new OperaKeyboard(this);
    services.getConsoleLogger().onConsoleMessage(new ConsoleMessageConverter(logs));

    // Get product from Opera
    settings.setProduct(utils().getProduct());

    // TODO(andreastt): Expose profile on core service
    if (!utils().getUserAgent().contains("Mini")) {
      preferences = new OperaScopePreferences(services.getPrefs());

      // Enable popups for testing purposes
      preferences().set("User Prefs", "Ignore Unrequested Popups", false);

      // Mobile has disabled JavaScript autofocus for usability reasons
      if (utils().getProduct().is(MOBILE)) {
        preferences().set("User Prefs", "Allow Autofocus Form Element", true);
      }
    }

    // Update browser's proxy configuration
    proxy = new OperaProxy(this);
    proxy.parse(settings.getProxy());
  }
1188286
public function doInit()
    {
        //extension hook
        $this->extend('onBeforeInit');

        // Safety call
        $this->baseInitCalled = false;
        $this->init();
        if (!$this->baseInitCalled) {
            $class = static::class;
            user_error(
                "init() method on class '{$class}' doesn't call Controller::init()."
                . "Make sure that you have parent::init() included.",
                E_USER_WARNING
            );
        }

        $this->extend('onAfterInit');
    }
101193
@PostLoad
    @PostPersist
    @PostUpdate
    @PostRemove
    private void init() {
        if (this.internalPortletDefinitionId != -1
                && (this.portletDefinitionId == null
                        || this.portletDefinitionId.getLongId()
                                != this.internalPortletDefinitionId)) {
            this.portletDefinitionId =
                    PortletDefinitionIdImpl.create(this.internalPortletDefinitionId);
        }
    }
346279
protected static function init()
    {
        self::$_endpointSetting = self::settingWithFunc(
            Resources::SERVICE_MANAGEMENT_ENDPOINT_NAME,
            Validate::getIsValidUri()
        );

        self::$_certificatePathSetting = self::setting(
            Resources::CERTIFICATE_PATH_NAME
        );

        self::$_subscriptionIdSetting = self::setting(
            Resources::SUBSCRIPTION_ID_NAME
        );

        self::$validSettingKeys[] = Resources::SUBSCRIPTION_ID_NAME;
        self::$validSettingKeys[] = Resources::CERTIFICATE_PATH_NAME;
        self::$validSettingKeys[] = Resources::SERVICE_MANAGEMENT_ENDPOINT_NAME;
    }
844766
protected function initialize()
    {
        parent::initialize();

        // unless already configured, set default options to include exceptions
        $options = $this->defaults->getOptions() ?: [];

        foreach ($this->soapOptionDefaults as $option => $value) {

            if ( ! array_key_exists($option, $options)) {

                $options[ $option ] = $value;
            }
        }

        $this->defaults->setOptions($options);
    }