Activate the web container as a DS component.

Activate all child services.  Set the web container singleton.
Post a started event.

@param componentContext The component context of the activation.
@param properties Properties for the activation.
500205
public void activate(ComponentContext compcontext, Map<String, Object> properties) {
        String methodName = "activate";
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Activating the WebContainer bundle");
        }
        
        WebContainer.instance.set(this);

        this.context = compcontext;
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Default Port [ " + DEFAULT_PORT + " ]");
            Tr.debug(tc, methodName, "Default Virtual Host [ " + DEFAULT_VHOST_NAME + " ]");
        }        
        WebContainerConfiguration webconfig = new WebContainerConfiguration(DEFAULT_PORT);
        webconfig.setDefaultVirtualHostName(DEFAULT_VHOST_NAME);
        this.initialize(webconfig, properties);

        this.classLoadingSRRef.activate(context);
        this.sessionHelperSRRef.activate(context);
        this.cacheManagerSRRef.activate(context);
        this.injectionEngineSRRef.activate(context);
        this.managedObjectServiceSRRef.activate(context);
        this.servletContainerInitializers.activate(context);
        this.transferContextServiceRef.activate(context);
        
        this.webMBeanRuntimeServiceRef.activate(context);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Object mbeanService = context.locateService(REFERENCE_WEB_MBEAN_RUNTIME);
            Tr.debug(tc, methodName, "Web MBean Runtime [ " + mbeanService + " ]");
            
            Tr.debug(tc, methodName, "Web MBean Runtime Reference [ " + webMBeanRuntimeServiceRef.getReference() + " ]");
            Tr.debug(tc, methodName, "Web MBean Runtime Service [ " + webMBeanRuntimeServiceRef.getService() + " ]");            
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posting STARTED_EVENT");
        }
        Event event = this.eventService.createEvent(WebContainerConstants.STARTED_EVENT);
        this.eventService.postEvent(event);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posted STARTED_EVENT");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Activating the WebContainer bundle: Complete");
        }        
    }
1110898
@Activate
    protected void activate(ComponentContext context, Map<String, Object> props) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "MongoDBService activate: jndiName=" + props.get(JNDI_NAME) + ", database=" + props.get(DATABASE_NAME));

        // Register with the required MongoService to listen for changes and also
        // save the context to obtain the properties as needed. Since this service
        // has a modified method; the context properties may change.
        mongo.registerChangeListener(this);
        cctx.set(context);
    }
566774
@Modified
    protected void modify(ComponentContext cc, Map<String, Object> properties) {
        SibTr.entry(tc, CLASS_NAME + "modify", properties);

        this.properties = properties;
        populateDestinationPermissions();
        runtimeSecurityService.modifyMessagingServices(this);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, CLASS_NAME + "modify");
        }
    }
1336234
protected void deactivate(ComponentContext context) {
		log.info("deactivate");

		bundleContext = context.getBundleContext();
		bundleContext.removeServiceListener(sl);

		log.info("Deactivate successful");
	}
584697
protected synchronized void activate(ComponentContext cc) {
        pipelineRef.activate(cc);
        securityServiceRef.activate(cc);

        insertJMXSecurityFilter();
    }
188934
protected synchronized void activate(ComponentContext context) {
        cfwBundleRef.activate(context);
        scheduledExecSvcRef.activate(context);
        injectionServiceSRRef.activate(context);
        injectionService12SRRef.activate(context);
        executorServiceRef.activate(context);
        injectionEngineSRRef.activate(context);
    }
800398
protected void activate(ComponentContext compcontext) {
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "Activating " + this.getClass().getName());
        }
        setInstance(this);
        this.beanValidation.activate(compcontext);
    }
255248
private void setProperties(Properties properties) {
        Props props = new Props(properties);
        if(props.containsKey(ClientConfig.ENABLE_JMX_PROPERTY)) {
            this.setEnableJmx(props.getBoolean(ClientConfig.ENABLE_JMX_PROPERTY));
        }

        if(props.containsKey(ClientConfig.BOOTSTRAP_URLS_PROPERTY)) {
            List<String> urls = props.getList(ClientConfig.BOOTSTRAP_URLS_PROPERTY);
            if(urls.size() > 0) {
                setHttpBootstrapURL(urls.get(0));
            }
        }

        if(props.containsKey(ClientConfig.MAX_TOTAL_CONNECTIONS_PROPERTY)) {
            setMaxR2ConnectionPoolSize(props.getInt(ClientConfig.MAX_TOTAL_CONNECTIONS_PROPERTY,
                                                    maxR2ConnectionPoolSize));
        }

        if(props.containsKey(ClientConfig.ROUTING_TIMEOUT_MS_PROPERTY))
            this.setTimeoutMs(props.getLong(ClientConfig.ROUTING_TIMEOUT_MS_PROPERTY, timeoutMs),
                              TimeUnit.MILLISECONDS);

        // By default, make all the timeouts equal to routing timeout
        timeoutConfig = new TimeoutConfig(timeoutMs, false);

        if(props.containsKey(ClientConfig.GETALL_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_ALL_OP_CODE,
                                              props.getInt(ClientConfig.GETALL_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.GET_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_OP_CODE,
                                              props.getInt(ClientConfig.GET_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.PUT_ROUTING_TIMEOUT_MS_PROPERTY)) {
            long putTimeoutMs = props.getInt(ClientConfig.PUT_ROUTING_TIMEOUT_MS_PROPERTY);
            timeoutConfig.setOperationTimeout(VoldemortOpCode.PUT_OP_CODE, putTimeoutMs);
            // By default, use the same thing for getVersions() also
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_VERSION_OP_CODE, putTimeoutMs);
        }

        // of course, if someone overrides it, we will respect that
        if(props.containsKey(ClientConfig.GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.GET_VERSION_OP_CODE,
                                              props.getInt(ClientConfig.GET_VERSIONS_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.DELETE_ROUTING_TIMEOUT_MS_PROPERTY))
            timeoutConfig.setOperationTimeout(VoldemortOpCode.DELETE_OP_CODE,
                                              props.getInt(ClientConfig.DELETE_ROUTING_TIMEOUT_MS_PROPERTY));

        if(props.containsKey(ClientConfig.ALLOW_PARTIAL_GETALLS_PROPERTY))
            timeoutConfig.setPartialGetAllAllowed(props.getBoolean(ClientConfig.ALLOW_PARTIAL_GETALLS_PROPERTY));

    }
850575
@Trivial
    protected void activate(ComponentContext context) throws Exception {
        Dictionary<String, ?> props = context.getProperties();
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "activate", props);

        String sourcePID = (String) props.get("ibm.extends.source.pid"); // com.ibm.ws.jca.jmsQueueConnectionFactory_gen_3f3cb305-4146-41f9-8a57-b231d09013e6
        configElementName = sourcePID == null ? "connectionFactory" : sourcePID.substring(15, sourcePID.indexOf('_', 15));

        cfInterfaceNames = props.get("creates.objectClass");
        mcfImplClassName = (String) props.get(CONFIG_PROPS_PREFIX + "managedconnectionfactory-class");
        jndiName = (String) props.get(JNDI_NAME);
        id = (String) props.get("config.displayId");

        componentContext = context;
        isServerDefined = true; // We don't support app-defined connection factories yet

        //Integer trlevel = props.get("transactionSupport");
        if (props.get("transactionSupport") != null)
            connectionFactoryTransactionSupport = TransactionSupportLevel.valueOf((String) props.get("transactionSupport"));

        // filter out actual config properties for the connection factory
        for (Enumeration<String> keys = props.keys(); keys.hasMoreElements();) {
            String key = keys.nextElement();
            if (key.length() > CONFIG_PROPS_PREFIX_LENGTH && key.charAt(CONFIG_PROPS_PREFIX_LENGTH - 1) == '.' && key.startsWith(CONFIG_PROPS_PREFIX)) {
                String propName = key.substring(CONFIG_PROPS_PREFIX_LENGTH);
                if (propName.indexOf('.') < 0 && propName.indexOf('-') < 0)
                    properties.put(propName, props.get(key));
            }
        }

        bootstrapContextRef.activate(context);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "activate");
    }
794362
protected void activate(final ComponentContext context)
			throws InvalidSyntaxException {
		log.info("activate");

		bundleContext = context.getBundleContext();

		sl = new ServiceListener() {
			public void serviceChanged(ServiceEvent event) {
				if (event.getType() == ServiceEvent.UNREGISTERING) {
					cache.unregisterComponentBindingsProvider(event
							.getServiceReference());
				} else if (event.getType() == ServiceEvent.REGISTERED) {
					cache.registerComponentBindingsProvider(event
							.getServiceReference());
				}
			}
		};
		bundleContext.addServiceListener(sl, "(" + Constants.OBJECTCLASS + "="
				+ ComponentBindingsProvider.class.getName() + ")");
		reloadCache();
		log.info("Activation successful");
	}
725529
@Deactivate
    protected void deactivate(ComponentContext context) {
        lock.writeLock().lock();
        try {
            componentContext = null;
            properties = null;
            threadContextConfigurations = null;
        } finally {
            lock.writeLock().unlock();
        }
    }
1204844
protected void activate(ComponentContext context, Map<String, Object> props) {
        configurationProperties = new HashMap<String, Object>(props);

        Object scheduleInvalidationFirstHour = configurationProperties.get("scheduleInvalidationFirstHour");
        Object scheduleInvalidationSecondHour = configurationProperties.get("scheduleInvalidationSecondHour");
        Object writeContents = configurationProperties.get("writeContents");
        Object writeFrequency = configurationProperties.get("writeFrequency");

        // httpSessionCache writeContents accepts ONLY_SET_ATTRIBUTES in place of ONLY_UPDATED_ATTRIBUTES to better reflect the behavior provided
        if (writeContents == null || "ONLY_SET_ATTRIBUTES".equals(writeContents))
            configurationProperties.put("writeContents", "ONLY_UPDATED_ATTRIBUTES");

        // default/disallow advanced properties from httpSessionDatabase
        configurationProperties.put("noAffinitySwitchBack", "TIME_BASED_WRITE".equals(writeFrequency));
        configurationProperties.put("onlyCheckInCacheDuringPreInvoke", false);
        configurationProperties.put("optimizeCacheIdIncrements", true);
        configurationProperties.put("scheduleInvalidation", scheduleInvalidationFirstHour != null || scheduleInvalidationSecondHour != null);
        configurationProperties.put("sessionPersistenceMode", "JCACHE");
        configurationProperties.put("useInvalidatedId", false);
        configurationProperties.put("useMultiRowSchema", true);
    }
513508
@Override
	public void render(final WComponent component, final RenderContext renderContext) {
		if (renderContext instanceof WebXmlRenderContext) {
			doRender(component, (WebXmlRenderContext) renderContext);
		} else {
			throw new SystemException("Unable to render web xml output to " + renderContext);
		}
	}
1022137
protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(this, tc, "deactivate", context);
        configAdminRef.deactivate(context);
        variableRegistryRef.deactivate(context);
        metaTypeServiceRef.deactivate(context);
        wsConfigurationHelperRef.deactivate(context);
    }
1067309
@Activate
    protected void activate(ComponentContext cc) throws Exception {

        RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
        //This is a workaroud to avoid invoking createWoodstoxFactory in org.apache.cxf.staxutils.StaxUtils.createXMLInputFactor
        AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>() {
            @Override
            public Boolean run()
                            throws Exception
            {
                System.setProperty(StaxUtils.ALLOW_INSECURE_PARSER, "1"); // sets the bla property without throwing an exception -> ok
                return Boolean.TRUE;
            }
        });
        ClassLoader orignalClassLoader = THREAD_CONTEXT_ACCESSOR.getContextClassLoader(Thread.currentThread());
        try {
            //Make sure the current ThreadContextClassLoader is not an App classloader
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), JaxRsServiceActivator.class.getClassLoader());
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put("org.apache.cxf.bus.id", "Default Bus");
            Bus defaultBus = LibertyApplicationBusFactory.getInstance().createBus(null, properties);
            LibertyApplicationBusFactory.setDefaultBus(defaultBus);
        } finally {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);
        }

    }
1040694
protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "deactivate", "deactivating service references");
        }
        embeddableWebSphereTransactionManagerRef.deactivate(context);
        localTransactionCurrentRef.deactivate(context);
        resourceConfigFactoryRef.deactivate(context);
        dataSourceFactoryRef.deactivate(context);
        uowCurrentRef.deactivate(context);
        userTransactionRef.deactivate(context);
        if (isCompletedPassivation()) { //START 128284
            serializationServiceRef.deactivate(context);
        } else {

            while (!isCompletedPassivation()){
                try {
                    Thread.sleep(100L); // sleep 1/10th of a second
                } catch (InterruptedException e) {
                    FFDCFilter.processException(e, this.getClass().getName(), "180");
                } finally {
                    serializationServiceRef.deactivate(context);
                }
            }
        } // END 128284

    }
14556
@FFDCIgnore(Exception.class)
    public void deactivate(ComponentContext componentContext) {
        String methodName = "deactivate";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Deactivating the WebContainer bundle");
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posting STOPPED_EVENT");
        }
        Event event = this.eventService.createEvent(WebContainerConstants.STOPPED_EVENT);
        this.eventService.postEvent(event);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posted STOPPED_EVENT");
        }

        this.classLoadingSRRef.deactivate(componentContext);
        this.sessionHelperSRRef.deactivate(componentContext);
        this.cacheManagerSRRef.deactivate(componentContext);
        this.injectionEngineSRRef.deactivate(componentContext);
        this.managedObjectServiceSRRef.deactivate(context);
        this.servletContainerInitializers.deactivate(componentContext);
        this.transferContextServiceRef.deactivate(componentContext);
        this.webMBeanRuntimeServiceRef.deactivate(componentContext);

        // will now purge each host as it becomes redundant rather than all here.
        //this.vhostManager.purge(); // Clear/purge all maps.

        WebContainer.instance.compareAndSet(this, null);
        extensionFactories.clear();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Deactivating the WebContainer bundle: Complete");
        }                
    }