Create a initializer to be executed during the flowlet driver initialization.
967704
private Service createServiceHook(String flowletName, Iterable<ConsumerSupplier<?>> consumerSuppliers,
                                    AtomicReference<FlowletProgramController> controller) {
    final List<String> streams = Lists.newArrayList();
    for (ConsumerSupplier<?> consumerSupplier : consumerSuppliers) {
      QueueName queueName = consumerSupplier.getQueueName();
      if (queueName.isStream()) {
        streams.add(queueName.getSimpleName());
      }
    }

    // If no stream, returns a no-op Service
    if (streams.isEmpty()) {
      return new AbstractService() {
        @Override
        protected void doStart() {
          notifyStarted();
        }

        @Override
        protected void doStop() {
          notifyStopped();
        }
      };
    }
    return new FlowletServiceHook(flowletName, streams, controller);
  }
243403
public final synchronized void initialize(Object flowOwner)
    {
        if(this.initialized)
        {
            throw new FaxException("Vendor policy already initialized.");
        }
        
        if(flowOwner==null)
        {
            throw new FaxException("Flow owner not provided.");
        }

        //set flag
        this.initialized=true;

        //get flow owner
        this.vendorPolicyFlowOwner=flowOwner;
        
        //initialize
        this.initializeImpl();
    }
1300941
def _init_logger(self):
        
        if self.flow:
            self.logger = self.flow.logger.getChild(self.__class__.__name__)
        else:
            self.logger = logging.getLogger(__name__)
974646
@Override
    public void init(@NonNull Configuration configuration, @NonNull Allocator allocator) {
        this.configuration = configuration;

        this.deviceMemoryTracker = new DeviceAllocationsTracker(this.configuration);
        this.flowController.init(allocator);
    }
1119716
def _init(self, *args, **kwargs):
        
        self._init_attr('_deps', None)

        self._init_attr('_ban_optimize', False)
        self._init_attr('_engine', None)
        self._init_attr('_Expr__execution', None)

        self._init_attr('_need_cache', False)
        self._init_attr('_mem_cache', False)

        if '_id' not in kwargs:
            kwargs['_id'] = new_id()

        super(Expr, self)._init(*args, **kwargs)
727140
public void initAtStartup() {
        //final String appsToInit = ConfigurationManager.getConfigInstance().getString("evcache.appsToInit");
        final String appsToInit = EVCacheConfig.getInstance().getDynamicStringProperty("evcache.appsToInit", "").get();
        if (appsToInit != null && appsToInit.length() > 0) {
            final StringTokenizer apps = new StringTokenizer(appsToInit, ",");
            while (apps.hasMoreTokens()) {
                final String app = getAppName(apps.nextToken());
                if (log.isDebugEnabled()) log.debug("Initializing EVCache - " + app);
                initEVCache(app);
            }
        }
    }
1257210
def _create_driver(self, **kwargs):
        
        if self.driver is None:
            self.driver = self.create_driver(**kwargs)
            self.init_driver_func(self.driver)
108471
private void invokeInitializersBasedOnPriority(ITestContext context) {
        ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class);
        List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>();
        for (Initializer l : serviceLoader) {
            loader.add((AbstractConfigInitializer) l);
        }
        Collections.sort(loader);
        for (AbstractConfigInitializer temp : loader) {
            temp.initialize(context);
        }
    }
1085993
void init() {
        ExecutionService executionService = nodeEngine.getExecutionService();

        executionService.scheduleWithRepetition(CLUSTER_EXECUTOR_NAME, this::heartbeat,
                heartbeatIntervalMillis, heartbeatIntervalMillis, TimeUnit.MILLISECONDS);

        if (icmpParallelMode) {
            startPeriodicPinger();
        }
    }
64303
@PostConstruct
    public void init() throws Exception {
        try {
            if (alreadyInited.compareAndSet(false, true)) {
                initAdminContainerConfigIfNeeded();
                initAdminRegistryIfNeeded();

                if (! adminContainerConfig.shouldEnable()) {
                    return;
                }

                if (adminContainerConfig.shouldScanClassPathForPluginDiscovery()) {
                    adminPageRegistry.registerAdminPagesWithClasspathScan();
                }

                Injector adminResourceInjector;
                if (shouldShareResourcesWithParentInjector()) {
                    adminResourceInjector = appInjector.createChildInjector(buildAdminPluginsGuiceModules());
                } else {
                    adminResourceInjector = LifecycleInjector
                            .builder()
                            .inStage(Stage.DEVELOPMENT)
                            .usingBasePackages("com.netflix.explorers")
                            .withModules(buildAdminPluginsGuiceModules())
                            .build()
                            .createInjector();
                    adminResourceInjector.getInstance(LifecycleManager.class).start();
                }

                server = new Server(adminContainerConfig.listenPort());
                final List<Filter> additionaFilters = adminContainerConfig.additionalFilters();

                // redirect filter based on configurable RedirectRules
                final Context rootHandler = new Context();
                rootHandler.setContextPath("/");
                rootHandler.addFilter(new FilterHolder(adminResourceInjector.getInstance(RedirectFilter.class)), "/*", Handler.DEFAULT);
                rootHandler.addServlet(new ServletHolder(new DefaultServlet()), "/*");

                // admin page template resources
                AdminResourcesFilter arfTemplatesResources = adminResourceInjector.getInstance(AdminResourcesFilter.class);
                Map<String, Object> props = new HashMap<>(adminContainerConfig.getJerseyConfigProperties());
                props.put(PackagesResourceConfig.PROPERTY_PACKAGES, 
                        adminContainerConfig.jerseyViewableResourcePkgList() + ";" + 
                        Objects.toString(props.get(PackagesResourceConfig.PROPERTY_PACKAGES)));
                arfTemplatesResources.setProperties(props);

                logger.info("Admin templates context : {}", adminContainerConfig.templateResourceContext());
                final Context adminTemplatesResHandler = new Context();
                adminTemplatesResHandler.setContextPath(adminContainerConfig.templateResourceContext());
                adminTemplatesResHandler.setSessionHandler(new SessionHandler());
                adminTemplatesResHandler.addFilter(LoggingFilter.class, "/*", Handler.DEFAULT);
                adminTemplatesResHandler.addFilter(new FilterHolder(adminResourceInjector.getInstance(RedirectFilter.class)), "/*", Handler.DEFAULT);
                applyAdditionalFilters(adminTemplatesResHandler, additionaFilters);
                adminTemplatesResHandler.addFilter(new FilterHolder(arfTemplatesResources), "/*", Handler.DEFAULT);
                adminTemplatesResHandler.addServlet(new ServletHolder(new DefaultServlet()), "/*");
                
                // admin page data resources
                AdminResourcesFilter arfDataResources = adminResourceInjector.getInstance(AdminResourcesFilter.class);
                props = new HashMap<>(adminContainerConfig.getJerseyConfigProperties());
                props.put(PackagesResourceConfig.PROPERTY_PACKAGES, 
                        appendCoreJerseyPackages(adminPageRegistry.buildJerseyResourcePkgListForAdminPages()) + ";" + 
                        Objects.toString(props.get(PackagesResourceConfig.PROPERTY_PACKAGES)));
                arfDataResources.setProperties(props);

                logger.info("Admin resources context : {}", adminContainerConfig.ajaxDataResourceContext());
                final Context adminDataResHandler = new Context();
                adminDataResHandler.setContextPath(adminContainerConfig.ajaxDataResourceContext());
                adminDataResHandler.addFilter(LoggingFilter.class, "/*", Handler.DEFAULT);
                adminDataResHandler.addFilter(new FilterHolder(adminResourceInjector.getInstance(RedirectFilter.class)), "/*", Handler.DEFAULT);
                applyAdditionalFilters(adminDataResHandler, additionaFilters);
                adminDataResHandler.addFilter(new FilterHolder(arfDataResources), "/*", Handler.DEFAULT);
                adminDataResHandler.addServlet(new ServletHolder(new DefaultServlet()), "/*");

                QueuedThreadPool threadPool = new QueuedThreadPool();
                threadPool.setDaemon(true);
                server.setThreadPool(threadPool);

                ResourceHandler resource_handler = new ResourceHandler() {
                    @Override
                    public Resource getResource(String path) throws MalformedURLException {
                        Resource resource = Resource.newClassPathResource(path);
                        if (resource == null || !resource.exists()) {
                            resource = Resource.newClassPathResource("META-INF/resources" + path);
                        }
                        if (resource != null && resource.isDirectory()) {
                            return null;
                        }
                        return resource;
                    }                    
                };
                resource_handler.setResourceBase("/");

                HandlerCollection handlers = new HandlerCollection();
                handlers.setHandlers(new Handler[]{resource_handler, adminTemplatesResHandler, adminDataResHandler, rootHandler});
                server.setHandler(handlers);
                for (Connector connector : adminContainerConfig.additionalConnectors()) {
                    server.addConnector(connector);
                }

                server.start();

                final Connector connector = server.getConnectors()[0];
                serverPort = connector.getLocalPort();
                
                logger.info("jetty started on port {}", serverPort);
            }
        } catch (Exception e) {
            logger.error("Exception in building AdminResourcesContainer ", e);
        }
    }
951002
public void initialize() {
        val pair = buildLoggerContext(environment, resourceLoader);
        pair.ifPresent(it -> {
            this.logConfigurationFile = it.getKey();
            this.loggerContext = it.getValue();
        });
    }
124216
protected void configureContext(Context context,
			ServletContextInitializer[] initializers) {
		TomcatStarter starter = new TomcatStarter(initializers);
		if (context instanceof TomcatEmbeddedContext) {
			TomcatEmbeddedContext embeddedContext = (TomcatEmbeddedContext) context;
			embeddedContext.setStarter(starter);
			embeddedContext.setFailCtxIfServletStartFails(true);
		}
		context.addServletContainerInitializer(starter, NO_CLASSES);
		for (LifecycleListener lifecycleListener : this.contextLifecycleListeners) {
			context.addLifecycleListener(lifecycleListener);
		}
		for (Valve valve : this.contextValves) {
			context.getPipeline().addValve(valve);
		}
		for (ErrorPage errorPage : getErrorPages()) {
			new TomcatErrorPage(errorPage).addToContext(context);
		}
		for (MimeMappings.Mapping mapping : getMimeMappings()) {
			context.addMimeMapping(mapping.getExtension(), mapping.getMimeType());
		}
		configureSession(context);
		new DisableReferenceClearingContextCustomizer().customize(context);
		for (TomcatContextCustomizer customizer : this.tomcatContextCustomizers) {
			customizer.customize(context);
		}
	}
447217
public void init(IFilterConfig filterConfig) throws ServletException
    {
        try
        {
            // init the filter instance
            _filterState = FILTER_STATE_INITIALIZING;

    		// LIDB-3598: begin
            this._filterConfig = filterConfig;
    		if(_eventSource != null && _eventSource.hasFilterListeners()){
	    	        
	           	_eventSource.onFilterStartInit(getFilterEvent());
	    		// LIDB-3598: end
	        	_filterInstance.init(filterConfig);
	        	// LIDB-3598: begin
	        	_eventSource.onFilterFinishInit(getFilterEvent());
	    		// LIDB-3598: end
    		}
    		else{
    			_filterInstance.init(filterConfig);
    		}

            _filterState = FILTER_STATE_AVAILABLE;
        }
        catch (Throwable th)
        {
    		if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
	        	FilterErrorEvent errorEvent = getFilterErrorEvent(th);
	        	_eventSource.onFilterInitError(errorEvent);
    		}
        	
            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init", "111", this);
            _filterState = FILTER_STATE_UNAVAILABLE;
            throw new ServletException(MessageFormat.format("Filter [{0}]: could not be initialized", new Object[] {_filterName}), th);
        }

    }
872307
private void initializeDRProducer() {
        try {
            if (m_producerDRGateway != null) {
                m_producerDRGateway.startAndWaitForGlobalAgreement();

                for (Initiator iv2init : m_iv2Initiators.values()) {
                    iv2init.initDRGateway(m_config.m_startAction,
                                          m_producerDRGateway,
                                          isLowestSiteId(iv2init));
                }

                m_producerDRGateway.completeInitialization();
            }
        } catch (Exception ex) {
            CoreUtils.printPortsInUse(hostLog);
            VoltDB.crashLocalVoltDB("Failed to initialize DR producer", false, ex);
        }
    }
902493
public void init(String url, String user, String pass, String driver) {
		this.driver = StrUtil.isNotBlank(driver) ? driver : DriverUtil.identifyDriver(url);
		try {
			Class.forName(this.driver);
		} catch (ClassNotFoundException e) {
			throw new DbRuntimeException(e, "Get jdbc driver [{}] error!", driver);
		}
		this.url = url;
		this.user = user;
		this.pass = pass;
	}
907097
@PostConstruct
    public synchronized void initialize() {
        final FwCoreDirection direction = assistCoreDirection();
        developmentHere = direction.isDevelopmentHere();

        final JsonResourceProvider provider = direction.assistJsonResourceProvider();
        mappingOption = OptionalThing.ofNullable(extractMappingOption(provider), () -> {
            throw new IllegalStateException("Not found the JSON mapping option.");
        });
        printControlState = OptionalThing.of(preparePrintState(provider)); // fixedly exists for now
        yourEngineCreator = OptionalThing.ofNullable(extractYourEngineCreator(provider), () -> {
            throw new IllegalStateException("Not found the your engine creator.");
        });

        // should be last because of using other instance variable
        realJsonEngine = createDefaultJsonEngine();
        showBootLogging();
    }
421974
public void init(ClassLoader loader,
                     ContextSource[] contextSources,
                     String[] prefixes, boolean profilingEnabled) throws Exception {


        mSources = contextSources;
        int len = contextSources.length;
        ArrayList<Class<?>> contextList = new ArrayList<Class<?>>(len);
        ArrayList<ClassLoader> delegateList = new ArrayList<ClassLoader>(len);

        for (int j = 0; j < contextSources.length; j++) {
            Class<?> type = contextSources[j].getContextType();
            if (type != null) {
                contextList.add(type);
                ClassLoader scout = type.getClassLoader();
                if (scout != null && !delegateList.contains(scout)) {
                    delegateList.add(scout);
                }
            }
        }

        mContextsInOrder = contextList.toArray(new Class[contextList.size()]);
        ClassLoader[] delegateLoaders =
            delegateList.toArray(new ClassLoader[delegateList.size()]);

        mInjector = new ClassInjector
            (new DelegateClassLoader(loader, delegateLoaders));

        mProfilingEnabled = profilingEnabled;

        int observerMode = profilingEnabled ? MergedClass.OBSERVER_ENABLED | MergedClass.OBSERVER_EXTERNAL : MergedClass.OBSERVER_ENABLED;

        // temporarily include interface for UtilityContext for backwards
        // compatibility with old code relying on it.
        Class<?>[] interfaces = { UtilityContext.class };
        mConstr = MergedClass.getConstructor2(mInjector,
                                              mContextsInOrder,
                                              prefixes,
                                              interfaces,
                                              observerMode);
    }