{@inheritDoc}

TODO this gets moved into ConfigurablePortletApplicationContext
498785
@Override
    public void setEnvironment(ConfigurableEnvironment environment) {
        Assert.isInstanceOf(ConfigurablePortletEnvironment.class, environment,
                "ContribDispatcherPortlet environment must be of type " +
                "ConfigurablePortletEnvironment");
        
        super.setEnvironment(environment);
    }
582421
protected void initExportObject() {

        try {
            if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
                // create a new list
                m_reasons = new HashMap();
            } else {
                Map objects = (Map)getSettings().getDialogObject();
                if (objects == null) {
                    // using hashtable as most efficient version of a synchronized map
                    objects = new Hashtable();
                    getSettings().setDialogObject(objects);
                }
                m_reasons = (Map)objects.get(getClass().getName());
            }
        } catch (Exception e) {
            // create a new list
            m_reasons = new HashMap();
        }
    }
209390
@SuppressWarnings("rawtypes")
    private static void inject(final Class c, final IPluginInterface plugin, final IJNRPEExecutionContext context) throws IllegalAccessException {

        final Field[] fields = c.getDeclaredFields();

        for (final Field f : fields) {
            final Annotation an = f.getAnnotation(Inject.class);
            if (an != null) {
                final boolean isAccessible = f.isAccessible();

                if (!isAccessible) {
                    // Change accessible flag if necessary
                    f.setAccessible(true);
                }

                f.set(plugin, context);

                if (!isAccessible) {
                    // Restore accessible flag if necessary
                    f.setAccessible(false);
                }
            }
        }
    }
1221927
@Override
    public IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefinitionId) {
        Validate.notNull(portletDefinitionId, "portletDefinitionId can not be null");

        return this.portletDefinitionDao.getPortletDefinition(portletDefinitionId);
    }
902970
@Override
    public Object getValue(final ELContext context, final Object base, final Object property)
        throws NullPointerException, PropertyNotFoundException, ELException
    {
        if (EL_CLASS != null && EL_CLASS_CONSTRUCTOR != null 
                        && GET_IMPORT_HANDLER_METHOD != null && IMPORT_HANDLER_RESOLVE_CLASS_METHOD != null ) 
        {
            Object importHandler = null;
            try 
            {
                // In an EL 3+ environment, the ELContext will have a getImportHandler() method
                importHandler = GET_IMPORT_HANDLER_METHOD.invoke(context);
                if (importHandler != null) 
                {
                    Class<?> clazz;
                    clazz = (Class<?>) IMPORT_HANDLER_RESOLVE_CLASS_METHOD
                        .invoke(importHandler, property.toString());
                    if (clazz != null) 
                    {
                        context.setPropertyResolved(true);
                        return EL_CLASS_CONSTRUCTOR.newInstance(clazz);
                    }
                }
            } 
            catch (IllegalAccessException ex) 
            {
                //No op
            } 
            catch (IllegalArgumentException ex) 
            {
                //No op
            } 
            catch (InvocationTargetException ex) 
            {
                //No op
            } 
            catch (SecurityException ex) 
            {
                //No op
            } 
            catch (InstantiationException e) 
            {
                //No op
            }
        }
        return null;
    }
1100582
@Trivial
    protected void activate(ComponentContext context) throws Exception {
        Dictionary<String, ?> props = context.getProperties();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "activate", props);

        resourceAdapterID = (String) props.get("id");
        contextProviders.activate(context);
        bvalRef.activate(context);
        tranInflowManagerRef.activate(context);
        tranSyncRegistryRef.activate(context);
        jcaSecurityContextRef.activate(context);
        componentContext = context;
        properties = props;
        raMetaData = resourceAdapterSvc.getResourceAdapterMetaData();
        myAppName = raMetaData != null ? raMetaData.getJ2EEName().getApplication() : null;

        Object svc = bvalRef.getService();
        if (svc != null) {
            // Isolate and dynamic load BeanValidationHelpImpl class to avoid javax.validation bundle dependency
            //  when beanValidation feature is not deployed.
            if (System.getSecurityManager() == null)
                bvalHelper = (BeanValidationHelper) componentContext.getBundleContext().getBundle().loadClass("com.ibm.ws.jca.internal.BeanValidationHelperImpl").newInstance();
            else
                bvalHelper = AccessController.doPrivileged(new PrivilegedExceptionAction<BeanValidationHelper>() {
                    @Override
                    public BeanValidationHelper run() throws IllegalAccessException, ClassNotFoundException, InstantiationException {
                        return (BeanValidationHelper) componentContext.getBundleContext().getBundle().loadClass("com.ibm.ws.jca.internal.BeanValidationHelperImpl").newInstance();
                    }
                });
            bvalHelper.setBeanValidationSvc(svc);
        }

        resourceAdapter = configureResourceAdapter();
        if (resourceAdapter != null) {
            propagateThreadContext = !"(service.pid=com.ibm.ws.context.manager)".equals(properties.get("contextService.target"));
            workManager = new WorkManagerImpl(this);

            // Normally it's a bad practice to do this in activate. But here we have a requirement to keep the
            // reference count until some subsequent processing occurs after deactivate.
            contextSvc = Utils.priv.getService(componentContext, contextSvcRef);

            jcasu = new JcaServiceUtilities();
            raThreadContextDescriptor = captureRaThreadContext(contextSvc);
            raClassLoader = resourceAdapterSvc.getClassLoader();
            raClassLoader = raClassLoader == null ? null : classLoadingSvc.createThreadContextClassLoader(raClassLoader);

            ArrayList<ThreadContext> threadContext = startTask(raThreadContextDescriptor);
            try {
                beginContext(raMetaData);
                try {
                    ClassLoader previousClassLoader = jcasu.beginContextClassLoader(raClassLoader);
                    try {
                        resourceAdapter.start(this);
                    } finally {
                        jcasu.endContextClassLoader(raClassLoader, previousClassLoader);
                    }
                } finally {
                    endContext(raMetaData);
                }
            } finally {
                stopTask(raThreadContextDescriptor, threadContext);
            }
        }

        latches.put(resourceAdapterID, latch); // only add latch if activate is successful
    }
1234916
static PortComponent getPortComponentByServletLink(String servletLink, Adaptable containerToAdapt) throws UnableToAdaptException {
        return getHighLevelElementByServiceImplBean(servletLink, containerToAdapt, PortComponent.class, LinkType.SERVLET);
    }
417106
public AbstractEndpointBuilder<T> applicationContext(ApplicationContext applicationContext) {
        if (getEndpoint() instanceof ApplicationContextAware) {
            ((ApplicationContextAware) getEndpoint()).setApplicationContext(applicationContext);
        }

        if (getEndpoint() instanceof BeanFactoryAware) {
            ((BeanFactoryAware) getEndpoint()).setBeanFactory(applicationContext);
        }

        return this;
    }
1155532
@Override
    public Tuple<String, String> getPortletDescriptorKeys(IPortletDefinition portletDefinition) {

        final String portletApplicationId;
        if (portletDefinition.getPortletDescriptorKey().isFrameworkPortlet()) {
            portletApplicationId = this.servletContext.getContextPath();
        } else {
            portletApplicationId = portletDefinition.getPortletDescriptorKey().getWebAppName();
        }

        final String portletName = portletDefinition.getPortletDescriptorKey().getPortletName();

        return new Tuple<String, String>(portletApplicationId, portletName);
    }
453426
@Override
    public PortletDelegationDispatcher createRequestDispatcher(
            PortletRequest portletRequest, IPortletDefinitionId delegatePortletDefinitionId) {
        final HttpServletRequest request =
                this.portalRequestUtils.getPortletHttpRequest(portletRequest);

        final String windowID = portletRequest.getWindowID();
        final IPortletWindowId parentPortletWindowId =
                this.portletWindowRegistry.getPortletWindowId(request, windowID);

        final IPortletEntity delegatePortletEntity =
                this.portletEntityRegistry.getOrCreateDelegatePortletEntity(
                        request, parentPortletWindowId, delegatePortletDefinitionId);
        final IPortletEntityId delegatePortletEntityId = delegatePortletEntity.getPortletEntityId();

        final IPortletWindow delegatePortletWindow =
                this.portletWindowRegistry.createDelegatePortletWindow(
                        request, delegatePortletEntityId, parentPortletWindowId);

        final IPerson person = this.personManager.getPerson(request);
        final int userId = person.getID();

        return new PortletDelegationDispatcherImpl(
                delegatePortletWindow,
                userId,
                portalRequestUtils,
                personManager,
                portletRenderer,
                portalUrlProvider,
                portletDelegationManager);
    }
680245
@Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (StringUtils.isEmpty(propertyFile)) {
            return;
        }

        for (String pf : propertyFile.split("\\,")) {
            loadAliases(applicationContext, pf);
        }

        if (fileCount > 0) {
            log.info("Loaded " + entryCount + " aliases from " + fileCount + " files.");
        }
    }
141060
private void addContext(
      final EvaluatorRuntimeProtocol.AddContextProto addContextProto)
      throws ContextClientCodeException {

    synchronized (this.contextStack) {
      try {

        final ContextRuntime currentTopContext = this.contextStack.peek();

        if (!currentTopContext.getIdentifier().equals(addContextProto.getParentContextId())) {
          throw new IllegalStateException("Trying to instantiate a child context on context with id `" +
              addContextProto.getParentContextId() + "` while the current top context id is `" +
              currentTopContext.getIdentifier() + "`");
        }

        final Configuration contextConfiguration =
            this.configurationSerializer.fromString(addContextProto.getContextConfiguration());

        final ContextRuntime newTopContext;
        if (addContextProto.hasServiceConfiguration()) {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration,
              this.configurationSerializer.fromString(addContextProto.getServiceConfiguration()));
        } else {
          newTopContext = currentTopContext.spawnChildContext(contextConfiguration);
        }

        this.contextStack.push(newTopContext);

      } catch (final IOException | BindException e) {
        throw new RuntimeException("Unable to read configuration.", e);
      }

    }
  }
358459
@Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext context = sce.getServletContext();
        String propertiesConfig = context.getInitParameter(PROPERTIES_CONFIG);
        if(propertiesConfig == null) {
            propertiesConfig = PROPERTIES_CONFIG_DEFAULT;
        }
        SystemProperties config = loadConfiguration(propertiesConfig, context);
        addProperties(config);
        if(config.getFile() != null) {
            addPropertiesFromFile(config, context);
        }
        
    }
1043283
public void eInit(XtendTypeDeclaration container, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlConstructor == null) {
			this.container = container;
			this.sarlConstructor = SarlFactory.eINSTANCE.createSarlConstructor();
			this.sarlConstructor.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendMember());
			container.getMembers().add(this.sarlConstructor);
		}
	}
268788
private static void parseContextParams(final ParamValueType contextParam, final WebApp webApp) {
		final WebAppInitParam initParam = new WebAppInitParam();
		initParam.setParamName(contextParam.getParamName().getValue());
		initParam.setParamValue(contextParam.getParamValue().getValue());
		webApp.addContextParam(initParam);
	}
1215269
protected function getTypoScriptConfigurationInstance(array $configurationArray = null, $contextPageId = null)
    {
        return GeneralUtility::makeInstance(
            TypoScriptConfiguration::class,
            /** @scrutinizer ignore-type */ $configurationArray,
            /** @scrutinizer ignore-type */ $contextPageId
        );
    }
492240
public void enableMvc(ConfigurableListableBeanFactory factory, BundleContext context) {
        if (factory == null) {
            throw new IllegalArgumentException("Method argument factory must not be null.");
        }
        if (context == null) {
            throw new IllegalArgumentException("Method argument context must not be null.");
        }

        BundleAwareServletConfig servletConfig = new BundleAwareServletConfig(context);

        factory.addBeanPostProcessor(new ServletContextAwareProcessor(this.servletContext, servletConfig));
        factory.ignoreDependencyInterface(ServletContextAware.class);
        factory.ignoreDependencyInterface(ServletConfigAware.class);

        final BundleSpecificDispatcherServlet dispatcherServlet = createBundleSpecificDispatcherServlet(factory, servletConfig);
        factory.registerSingleton(generateNameFor(BundleSpecificDispatcherServlet.class), dispatcherServlet);
        this.mvcCapableBundles.put(context.getBundle(), dispatcherServlet);
    }