If the deployment has a module attached it will ask the module to load the ServiceActivator services.

@param phaseContext the deployment unit context
540944
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (servicesAttachment == null || servicesAttachment.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
            return; // Skip it if it has not been marked
        }
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        if (module == null) {
            return; // Skip deployments with no module
        }

        AttachmentList<DeploymentUnit> duList = deploymentUnit.getAttachment(Attachments.SUB_DEPLOYMENTS);
        List<String> serviceAcitvatorList = new ArrayList<String>();
        if (duList!=null && !duList.isEmpty()) {
            for (DeploymentUnit du : duList) {
                ServicesAttachment duServicesAttachment = du.getAttachment(Attachments.SERVICES);
                for (String serv : duServicesAttachment.getServiceImplementations(ServiceActivator.class.getName())) {
                    serviceAcitvatorList.add(serv);
                }
            }
        }

        ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
        if (WildFlySecurityManager.isChecking()) {
            //service registry allows you to modify internal server state across all deployments
            //if a security manager is present we use a version that has permission checks
            serviceRegistry = new SecuredServiceRegistry(serviceRegistry);
        }
        final ServiceActivatorContext serviceActivatorContext = new ServiceActivatorContextImpl(phaseContext.getServiceTarget(), serviceRegistry);

        final ClassLoader current = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();

        try {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
            for (ServiceActivator serviceActivator : module.loadService(ServiceActivator.class)) {
                try {
                    for (String serv : servicesAttachment.getServiceImplementations(ServiceActivator.class.getName())) {
                        if (serv.compareTo(serviceActivator.getClass().getName()) == 0 && !serviceAcitvatorList.contains(serv)) {
                            serviceActivator.activate(serviceActivatorContext);
                            break;
                        }
                    }
                } catch (ServiceRegistryException e) {
                    throw new DeploymentUnitProcessingException(e);
                }
            }
        } finally {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(current);
        }
    }
260392
@Trivial
    protected void activate(ComponentContext componentContext) {
        Dictionary<String, ?> properties = componentContext.getProperties();
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "activate", properties);

        contextSvcRef.activate(componentContext);

        String jndiName = (String) properties.get(JNDI_NAME);
        name = jndiName == null ? (String) properties.get(CONFIG_ID) : jndiName;

        defaultExecutionProperties = new TreeMap<String, String>();
        defaultExecutionProperties.put(WSContextService.DEFAULT_CONTEXT, WSContextService.UNCONFIGURED_CONTEXT_TYPES);
        defaultExecutionProperties.put(WSContextService.TASK_OWNER, name);

        createDaemonThreads = (Boolean) properties.get(CREATE_DAEMON_THREADS);
        defaultPriority = (Integer) properties.get(DEFAULT_PRIORITY);
        Integer maxPriority = (Integer) properties.get(MAX_PRIORITY);
        threadGroup = AccessController.doPrivileged(new CreateThreadGroupAction(name + " Thread Group", maxPriority), threadGroupTracker.serverAccessControlContext);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "activate");
    }
579704
@Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        if (context == null) {
            synchronized (ApplicationContextHolder.class) {
                if (context == null) {
                    ApplicationContextHolder.context = applicationContext;
                }
            }
        }
    }
1229583
protected void createSessionContext(DeployedModule moduleConfig) throws Throwable {
        try {
            // added sessionIdListeners for Servlet 3.1
            ArrayList sessionRelatedListeners[] = new ArrayList[] { sessionListeners, sessionAttrListeners, sessionIdListeners }; // cmd
            // PQ81253
            this.sessionCtx = ((WebGroup) parent).getSessionContext(moduleConfig, this, sessionRelatedListeners); // cmd
            // PQ81253
        } catch (Throwable th) {
            // pk435011
            logger.logp(Level.SEVERE, CLASS_NAME, "createSessionContext", "error.obtaining.session.context", th);
            throw new WebAppNotLoadedException(th.getMessage());
        }

    }
192708
protected synchronized void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Unregistering JNDIEntry " + serviceRegistration);
        }
        if (this.serviceRegistration != null) {
            this.serviceRegistration.unregister();
        }
    }
448303
@Override
    public void activate(ComponentContext context,
                         Map<String, Object> properties, ConfigurationAdmin configAdmin) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "activate", new Object[] { context, properties,
                                                      configAdmin });
        }
        try {
            // set ME state to starting
            _state = ME_STATE.STARTING.toString();

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                SibTr.debug(this, tc, "Starting the JMS server.");
            }

            // initilize config object
            initialize(context, properties, configAdmin);

            _jsMainImpl = new JsMainImpl(context.getBundleContext());
            _jsMainImpl.initialize(jsMEConfig);
            _jsMainImpl.start();

            // If its here it means all the components have started hence set
            // the state to STARTED
            _state = ME_STATE.STARTED.toString();
            SibTr.info(tc, "ME_STARTED_SIAS0108");
        } catch (InvalidFileStoreConfigurationException ifs) {
            // since there is exception in starting ME the state is set to
            // STOPPED
            _state = ME_STATE.STOPPED.toString();

            SibTr.error(tc, "ME_STOPPED_SIAS0109");
            SibTr.exception(tc, ifs);
            FFDCFilter.processException(ifs,
                                        "com.ibm.ws.messaging.service.JsMainAdminServiceImpl",
                                        "132", this);
        } catch (Exception e) {
            // since there is exception in starting ME the state is set to
            // STOPPED
            _state = ME_STATE.STOPPED.toString();

            SibTr.error(tc, "ME_STOPPED_SIAS0109");
            SibTr.exception(tc, e);
            FFDCFilter.processException(e,
                                        "com.ibm.ws.messaging.service.JsMainAdminServiceImpl",
                                        "139", this);

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "activate");
        }
    }
378290
protected final void configureWebAppContext(WebAppContext context,
			ServletContextInitializer... initializers) {
		Assert.notNull(context, "Context must not be null");
		context.setTempDirectory(getTempDirectory());
		if (this.resourceLoader != null) {
			context.setClassLoader(this.resourceLoader.getClassLoader());
		}
		String contextPath = getContextPath();
		context.setContextPath(StringUtils.hasLength(contextPath) ? contextPath : "/");
		context.setDisplayName(getDisplayName());
		configureDocumentRoot(context);
		if (isRegisterDefaultServlet()) {
			addDefaultServlet(context);
		}
		if (shouldRegisterJspServlet()) {
			addJspServlet(context);
			context.addBean(new JasperInitializer(context), true);
		}
		addLocaleMappings(context);
		ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);
		Configuration[] configurations = getWebAppContextConfigurations(context,
				initializersToUse);
		context.setConfigurations(configurations);
		context.setThrowUnavailableOnStartupException(true);
		configureSession(context);
		postProcessWebAppContext(context);
	}
284067
private static void bindService() {
        synchronized (Command.class) {
            if (!IS_BIND) {
                Context context = Cmd.getContext();
                if (context == null) {
                    throw new NullPointerException("Context not should null. Please call Cmd.init(Context)");
                } else {
                    // Cmd service
                    context.bindService(new Intent(context, CommandService.class), I_CONN, Context.BIND_AUTO_CREATE);
                    IS_BIND = true;
                }
            }
        }
    }
564393
public void submitContextAndService(final String evaluatorConfiguration,
                                      final String contextConfiguration,
                                      final String serviceConfiguration) {
    launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
        Optional.of(serviceConfiguration), Optional.<String>empty());
  }
593103
@Activate
    protected synchronized void activate(ComponentContext ctx, Map<String, Object> properties) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Activated: " + properties);
        }

        Set<String> installedFeatures = provisionerService.getInstalledFeatures();
        if (installedFeatures.contains("transportSecurity-1.0")) {
            transportSecurityEnabled = true;
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "transportSecurityEnable installed");
            }
        } else {
            transportSecurityEnabled = false;
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "transportSecurityEnable is not installed");
            }
        }

        super.activate(MY_ALIAS, properties);

        this.componentContext = (ExtComponentContext) ctx;

        processConfig(true);

    }
1322890
@Override
    public void setApplicationContext(ApplicationContext appContext) throws BeansException {
        if (this.appContext != null) {
            throw new ApplicationContextException("Attempt to reinitialize application context.");
        }
        
        this.appContext = appContext;
    }
194182
public void afterPropertiesSet() {

		ApplicationContext context = this.context;

		if (context == null) {
			throw new IllegalStateException("ApplicationContext not set!");
		}

		Class<?> type = this.type;

		if (type == null) {
			throw new IllegalStateException("No type configured!");
		}

		this.targetSource = new BeansOfTypeTargetSource(context, type, false, exclusions);
	}
786980
protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(this, tc, "activate", context);
        configAdminRef.activate(context);
        variableRegistryRef.activate(context);
        metaTypeServiceRef.activate(context);
        wsConfigurationHelperRef.activate(context);
        bundleContext = priv.getBundleContext(context);

    }
1284577
private ApplicationContext install(ApplicationContext wac, ModuleSorter.Sorted sorted, ServiceModuleInfo info) {
        // scan special modules, configuring and initializing PlatformAware objects as each module is loaded
        wac = install(wac, sorted.specials(), info, true);

        // scan regular modules, collecting all PlatformAware objects
        install(wac, sorted.regulars(), info, false);

        if (info.plcas.size() > 0) {
            _logger.info("configure PlatformAware objects in regular modules");
            for (Pair<String, PlatformAware> plca: info.plcas) {
                _logger.info("Configuring REGULAR PlatformAware " + plca.second.getClass().getName());
                plca.second.configure(_application, plca.first);
            }

            _logger.info("initialize PlatformAware objects in regular modules");
            for (Pair<String, PlatformAware> plca: info.plcas) {
                _logger.info("Initalizing REGULAR PlatformAware " + plca.second.getClass().getName());
                plca.second.initialize(_application, plca.first);
            }

            _plca.push(info.plcas);
            info.plcas = new ArrayList<Pair<String, PlatformAware>>();
        } else {
            _logger.info("No PlatformAware objects in regular modules");
        }

        return wac;
    }
340340
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {

    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

    if(!ProcessApplicationAttachments.isProcessApplication(deploymentUnit)) {
      return;
    }

    final Module module = deploymentUnit.getAttachment(MODULE);

    // read @ProcessApplication annotation of PA-component
    String[] deploymentDescriptors = getDeploymentDescriptors(deploymentUnit);

    // load all processes.xml files
    List<URL> deploymentDescriptorURLs = getDeploymentDescriptorUrls(module, deploymentDescriptors);

    for (URL processesXmlResource : deploymentDescriptorURLs) {
      VirtualFile processesXmlFile = getFile(processesXmlResource);

      // parse processes.xml metadata.
      ProcessesXml processesXml = null;
      if(isEmptyFile(processesXmlResource)) {
        processesXml = ProcessesXml.EMPTY_PROCESSES_XML;
      } else {
        processesXml = parseProcessesXml(processesXmlResource);
      }

      // add the parsed metadata to the attachment list
      ProcessApplicationAttachments.addProcessesXml(deploymentUnit, new ProcessesXmlWrapper(processesXml, processesXmlFile));
    }
  }
465959
public function init(ServerContextInterface $serverContext)
    {
        try {
            // set the servlet context
            $this->serverContext = $serverContext;

            // initialize the servlet engine
            $this->initValves();
            $this->initHandlers();
            $this->initApplications();

        } catch (\Exception $e) {
            throw new ModuleException($e);
        }
    }
584517
@Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        propertyProvider = new PropertyProvider(applicationContext);
        conversionService = DefaultConversionService.getSharedInstance();
        wireParams(this);
        afterInitialized();
    }