Creates a Vertx if one is not started yet.

@param config
the configuration to start a vertx
@param lifecyleListener
the vertx lifecycle listener
189834
public synchronized void getOrCreateVertx(
      final VertxPlatformConfiguration config, final VertxListener listener) {

    Vertx vertx = vertxPlatforms.get(config.getVertxPlatformIdentifier());

    if (vertx != null) {
      listener.whenReady(vertx);
      return;
    }

    VertxOptions options = new VertxOptions();
    options.setClustered(config.isClustered());
    options.setClusterHost(config.getClusterHost());
    options.setClusterPort(config.getClusterPort());

    CountDownLatch latch = new CountDownLatch(1);
    Vertx.clusteredVertx(options, ar -> {
      try {
        if (ar.succeeded()) {
          log.log(Level.INFO, "Acquired Vert.x platform.");
          listener.whenReady(ar.result());
          vertxPlatforms.put(config.getVertxPlatformIdentifier(), ar.result());
        } else {
          throw new RuntimeException("Could not acquire Vert.x platform.",
              ar.cause());
        }
      } finally {
        latch.countDown();
      }
    });

    try {
      if (!latch.await(config.getTimeout(), TimeUnit.MILLISECONDS)) {
        log.log(Level.SEVERE, "Could not acquire Vert.x platform in interval.");
        throw new RuntimeException(
            "Could not acquire Vert.x platform in interval");
      }
    } catch (Exception ignore) {
    }
  }
1010106
function (config) {
    config = config || {};

    // Calling base constructor
    LifeCycle.call(this);

    /**
     * Appender config
     */
    this.name = config.name;

    /**
     * Underlying layout
     */
    this.layout = config.layout;

    /**
     * Appender filter
     */
    this.filter = config.filter;

    /**
     * Trace level
     */
    this.level = config.level || 'all';

    /**
     * Function used to determine whether a level is below the
     * trace level of the Appender
     */
    this.isBelow = config.isLogLevelBelow || function () {
      return true;
    };
  }
896067
public void init(ServletConfig config) throws ServletException
    {
        super.init(config);
        ServletTask.initServlet(this, BasicServlet.SERVLET_TYPE.PROXY);
        
        m_servletTask = this.createProxyTask();
    }
718987
public static synchronized void init(LogProviderConfig config) {
        if (config == null)
            throw new NullPointerException("LogProviderConfig must not be null");

        if (loggingConfig.compareAndSet(null, config)) {
            // Only initialize FFDC once -- all subsequent changes go through update
            // The synchronization of this method is gratuitous (just makes us feel better), 
            // it is called while the system is single threaded at startup. 

            // config.getTrDelegate() must not return null -- it should either
            // return a dummy/disabled delegate, or throw an exception so that startup
            // does not proceed.
            delegate = config.getFfdcDelegate();
            if (delegate == null)
                throw new NullPointerException("LogProviderConfig must provide a FFDCFilterService delegate");

            delegate.init(config);
        }
    }
180303
@Autowired ( required = false )
  public void register(OAuthTokenLifecycleListener... lifecycleListeners) {
    if (lifecycleListeners != null) {
      this.lifecycleListeners.addAll(Arrays.asList(lifecycleListeners));
    }
  }
816896
@SuppressWarnings("unchecked")
    private String checkForListeners(WebAppConfig config) {
        String listenerFound = NO_LISTENER_REGISTERED_STRING;
        if (config != null) {
            List listeners = config.getListeners();
            for (Object listener : listeners) {
                String listenerClassname;
                /*
                 * if(listener instanceof JavaClassImpl)
                 * listenerClassname = ((JavaClassImpl)listener).getQualifiedName();
                 * else
                 */if (listener instanceof String)
                    listenerClassname = (String) listener;
                else
                    continue; //skip this listener
                if (listenerClassname.equals(SUN_CONFIGURE_LISTENER_CLASSNAME)) {
                    listenerFound = SUN_LISTENER_REGISTERED_STRING;
                    break;
                } else if (listenerClassname.equals(MYFACES_LIFECYCLE_LISTENER_CLASSNAME)) {
                    listenerFound = MYFACES_LISTENER_REGISTERED_STRING;
                    break;
                }
            }
        }
        return listenerFound;
    }
134945
public static Xml exports(LayerableConfig config)
    {
        Check.notNull(config);

        final Xml node = new Xml(NODE_LAYERABLE);
        node.writeInteger(ATT_REFRESH, config.getLayerRefresh());
        node.writeInteger(ATT_DISPLAY, config.getLayerDisplay());

        return node;
    }
154109
public void makeConfigParserLive() {

    if(stagedConfigParser != null) {
      notifyListeners(listeners, stagedConfigParser, log);
      
      liveConfigParser = stagedConfigParser;
      latch.countDown();
    }
  }
819363
@Override
    public synchronized void chainStarted(ChainData chainData) {
        chainState.set(ChainState.STARTED.val);

        final ActiveConfiguration cfg = currentConfig;
        final int port = cfg.getActivePort();

        if (port > 0) {
            // HOORAY! we have a bound listener.
            // Notify listeners that the chain was started.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "New configuration started " + cfg);
            }

            VirtualHostMap.notifyStarted(owner, cfg.resolvedHost, port, isHttps);

            // Post an endpoint started event to anyone listening
            String topic = owner.getEventTopic() + HttpServiceConstants.ENDPOINT_STARTED;
            postEvent(topic, cfg, null);
        }
    }
545083
public static void configure(String xmlConfig, File voltroot) {
        try {
            Class<?> loggerClz = Class.forName("org.voltcore.logging.VoltLog4jLogger");
            assert(loggerClz != null);
            Method configureMethod = loggerClz.getMethod("configure", String.class, File.class);
            configureMethod.invoke(null, xmlConfig, voltroot);
        } catch (Exception e) {}
    }
13443
public synchronized static CFMLEngine getInstance(final ServletConfig config) throws ServletException {

	if (singelton != null) {
	    if (factory == null) factory = singelton.getCFMLEngineFactory(); // not sure if this ever is done, but it does not hurt
	    return singelton;
	}

	if (factory == null) factory = new CFMLEngineFactory(config);

	// read init param from config
	factory.readInitParam(config);

	factory.initEngineIfNecessary();
	singelton.addServletConfig(config);

	// add listener for update
	// factory.addListener(singelton);
	return singelton;
    }
1143285
private boolean registerListener(IServletContext webapp, String listenerClassName, ClassLoader classLoader) {
        try {
            ServletContextListener listener = (ServletContextListener) Class.forName(listenerClassName, true, classLoader).newInstance();
            webapp.addLifecycleListener(listener);
        } catch (Exception e) {
            if (log.isLoggable(Level.WARNING)) {
                log.logp(Level.WARNING, CLASS_NAME, "registerListener", FacesMessages.getMsg("jsf.warn.exception.during.listener", new Object[] { listenerClassName,
                                                                                                                                                 applicationName }), e);
            }
            return false;
        }
        return true;
    }
744577
public void start(EJBRuntimeConfig config) throws CSIException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "start");

        ivContainer = config.getContainer();
        ivEJBMDOrchestrator = config.getEJBMDOrchestrator();

        // Check system property to determine if the deferred EJB initialization option has been disabled
        // The initializeEJBsAtStartup system property has 3 possible values:
        // (True) - all EJBs will be initialized during application start.
        // (False) - all EJBs (except MDBs and Startupbeans) will have their initialization deferred.
        // (Not Set) - The property is not set and therefore deferred initialization will be determined
        //             on a bean-by-bean basis.
        // Moved from processBean via defect 294477
        String ias = ContainerProperties.InitializeEJBsAtStartup; // 391302
        if (ias != null) {
            ivInitAtStartupSet = true;
            ivInitAtStartup = ias.equalsIgnoreCase("true");
        }

        //PK15508: make uowCrtl a global variable.  Change from: UOWControl ivUOWControl = cef.getUOWControl(tx); to:
        ContainerExtensionFactory cef = config.getContainerExtensionFactory();
        ivUOWControl = cef.getUOWControl(getUserTransaction()); // LIDB4171-35.03 F84120
        EJBSecurityCollaborator<?> securityCollaborator = config.getSecurityCollaborator();

        StatefulPassivator statefulPassivator = config.getStatefulPassivator();
        EJBPMICollaboratorFactory pmiFactory = config.getPmiBeanFactory();
        PassivationPolicy passivationpolicy = config.getPassivationPolicy();
        ivSfFailoverCache = config.getSfFailoverCache();

        ivDefaultDataSourceJNDIName = config.getDefaultDataSourceJNDIName();

        long cacheSize = config.getCacheSize();
        long cacheSweepInterval = config.getCacheSweepInterval();

        ScheduledExecutorService ivScheduledExecutorService = this.getScheduledExecutorService(); // F73234
        ScheduledExecutorService deferrableScheduledExecutorService = this.getDeferrableScheduledExecutorService();

        PoolManager poolMgr = PoolManager.newInstance();
        poolMgr.setDrainInterval(config.getInactivePoolCleanupInterval());
        poolMgr.setScheduledExecutorService(ivScheduledExecutorService);

        Cache ejbCache = new Cache("EJB Cache", cacheSize, false);
        BackgroundLruEvictionStrategy evictor = new BackgroundLruEvictionStrategy(ejbCache, (int) cacheSize, cacheSweepInterval, ivScheduledExecutorService, deferrableScheduledExecutorService); // F73234
        ejbCache.setEvictionStrategy(evictor);
        evictor.start();

        Cache wrapperCache = new Cache("Wrapper Cache", 2 * cacheSize, true);
        SweepLruEvictionStrategy wrapperEvictor = new SweepLruEvictionStrategy(wrapperCache, (int) (2
                                                                                                    * cacheSize), 3
                                                                                                                  * cacheSweepInterval, ivScheduledExecutorService, deferrableScheduledExecutorService); // d118138, F73234
        wrapperCache.setEvictionStrategy(wrapperEvictor);
        wrapperEvictor.start();

        WrapperManager wrapperManager = config.getWrapperManager();
        wrapperManager.initialize(wrapperCache);

        EJBRequestCollaborator<?>[] afterActivationCollaborators = config.getAfterActivationCollaborators();
        EJBRequestCollaborator<?>[] beforeActivationCollaborators = config.getBeforeActivationCollaborators();
        EJBRequestCollaborator<?> beforeActivationAfterCompletionCollaborators[] = config.getBeforeActivationAfterCompletionCollaborators();

        J2EENameFactory j2eeNameFactory = config.getJ2EENameFactory();
        StatefulSessionKeyFactory sessionKeyFactory = config.getStatefulSessionKeyFactory();
        ivWebServicesHandlerResolver = config.getWSEJBHandlerResolver();

        // -------------------------------------------------------------------------
        // Initialize EJSContainer with configuration values...
        // -------------------------------------------------------------------------
        ContainerConfig containerConfig = new ContainerConfig(this, null, config.getName(), ejbCache, wrapperManager, passivationpolicy, // LIDB2775-23.4
                        config.getPersisterFactory(), config.getEntityHelper(), pmiFactory, securityCollaborator, statefulPassivator, sessionKeyFactory, // LIDB2775-23.7
                        config.getStatefulSessionHandleFactory(), // F743-13024
                        poolMgr, j2eeNameFactory, config.getObjectCopier(), // RTC102299
                        config.getOrbUtils(), // F743-13024
                        ivUOWControl, afterActivationCollaborators, beforeActivationCollaborators, beforeActivationAfterCompletionCollaborators, cef, // 125942
                        config.getStatefulBeanEnqDeq(), // d646413.2
                        config.getDispatchEventListenerManager(), // d646413.2
                        ivSfFailoverCache, // LIDB2018-1
                        config.isSFSBFailoverEnabled()); // LIDB2018-1

        ivContainer.initialize(containerConfig);

        InjectionEngine injectionEngine = getInjectionEngine();

        try {
            // Register ObjectFactory for EJBContext and subinterfaces.      F48603
            injectionEngine.registerObjectFactory(Resource.class, EntityContext.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, EntityContextExtension.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, EJBContext.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, EJBContextExtension.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, SessionContext.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, SessionContextExtension.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, MessageDrivenContext.class, EJBContextObjectFactory.class, false, null, false);
            injectionEngine.registerObjectFactory(Resource.class, MessageDrivenContextExtension.class, EJBContextObjectFactory.class, false, null, false);

            // Register ObjectFactory to handle TimerService refs.           F48603
            injectionEngine.registerObjectFactory(Resource.class, TimerService.class, TimerServiceObjectFactory.class, false, null, false);
        } catch (InjectionException ex) {
            throw new CSIException("Failed to register injection engine object factories", ex);
        }

        // Register to bind java:comp/EJBContext, etc.                      F48603
        injectionEngine.registerInjectionMetaDataListener(this);

        // Override default managed bean auto link reference factory.    d698540.1
        injectionEngine.registerManagedBeanReferenceFactory(new MBLinkReferenceFactoryImpl());

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "start");
    }
1118072
public static JavaPlatform register(Config config) {
    // guard against multiple-registration (only in headless mode because this can happen when
    // running tests in Maven; in non-headless mode, we want to fail rather than silently ignore
    // erroneous repeated registration)
    if (config.headless && testInstance != null) {
      return testInstance;
    }
    JavaPlatform instance = new JavaPlatform(config);
    if (config.headless) {
      testInstance = instance;
    }
    PlayN.setPlatform(instance);
    return instance;
  }
81985
@Override
	public void start(LeaderRetrievalListener listener) {
		checkNotNull(listener, "Listener must not be null.");

		synchronized (startStopLock) {
			checkState(!started, "StandaloneLeaderRetrievalService can only be started once.");
			started = true;

			// directly notify the listener, because we already know the leading JobManager's address
			listener.notifyLeaderAddress(leaderAddress, leaderId);
		}
	}
297505
private void initialiseLifecycleObserver(Application application) {
        LifeCycleController.registerLifeCycleObserver(application, new LifecycleListener() {
            @Override
            public void onForegrounded(Context context) {
                for (LifecycleListener listener : lifecycleListeners) {
                    listener.onForegrounded(context);
                }
            }

            @Override
            public void onBackgrounded(Context context) {
                for (LifecycleListener listener : lifecycleListeners) {
                    listener.onBackgrounded(context);
                }
            }
        });
    }
22995
public void init(ServletConfig config)
         throws ServletException
    {
        super.init(config);

        Enumeration enm = config.getInitParameterNames();
        while (enm.hasMoreElements())
        {
            String path=(String)enm.nextElement();
            String forward=config.getInitParameter(path);
            _forwardMap.put(path,forward);
        }

    }