Package com.liferay.faces.bridge.bean

Examples of com.liferay.faces.bridge.bean.BeanManagerFactory


          }
        }
      }

      // Discover Factories
      BeanManagerFactory beanManagerFactory = null;
      BridgeRequestScopeManagerFactory bridgeRequestScopeManagerFactory = null;

      try {
        beanManagerFactory = (BeanManagerFactory) FactoryExtensionFinder.getFactory(BeanManagerFactory.class);
        bridgeRequestScopeManagerFactory = (BridgeRequestScopeManagerFactory) FactoryExtensionFinder.getFactory(
            BridgeRequestScopeManagerFactory.class);
      }
      catch (BridgeException e) {
        logger.debug("Unable to discover factories because portlet never received a RenderRequest");
      }

      if ((beanManagerFactory != null) && (bridgeRequestScopeManagerFactory != null)) {

        // Cleanup instances of BridgeRequestScope that are associated with the expiring session.
        HttpSession httpSession = httpSessionEvent.getSession();
        BridgeRequestScopeManager bridgeRequestScopeManager =
          bridgeRequestScopeManagerFactory.getBridgeRequestScopeManager();
        bridgeRequestScopeManager.removeBridgeRequestScopesBySession(httpSession);

        // For each session attribute:
        String appConfigAttrName = ApplicationConfig.class.getName();
        ServletContext servletContext = httpSession.getServletContext();
        ApplicationConfig applicationConfig = (ApplicationConfig) servletContext.getAttribute(
            appConfigAttrName);
        BeanManager beanManager = beanManagerFactory.getBeanManager(applicationConfig.getFacesConfig());

        try {

          Enumeration<String> attributeNames = (Enumeration<String>) httpSession.getAttributeNames();
View Full Code Here


        if (mapEntries != null) {

          String appConfigAttrName = ApplicationConfig.class.getName();
          Map<String, Object> applicationMap = externalContext.getApplicationMap();
          ApplicationConfig applicationConfig = (ApplicationConfig) applicationMap.get(appConfigAttrName);
          BeanManagerFactory beanManagerFactory = (BeanManagerFactory) FactoryExtensionFinder.getFactory(
              BeanManagerFactory.class);
          BeanManager beanManager = beanManagerFactory.getBeanManager(applicationConfig.getFacesConfig());

          for (Map.Entry<String, Object> mapEntry : mapEntries) {
            String potentialManagedBeanName = mapEntry.getKey();
            Object potentialManagedBeanValue = mapEntry.getValue();
View Full Code Here

  public SessionScopeMap(BridgeContext bridgeContext, int scope) {

    String appConfigAttrName = ApplicationConfig.class.getName();
    PortletContext portletContext = bridgeContext.getPortletContext();
    ApplicationConfig applicationConfig = (ApplicationConfig) portletContext.getAttribute(appConfigAttrName);
    BeanManagerFactory beanManagerFactory = (BeanManagerFactory) FactoryExtensionFinder.getFactory(
        BeanManagerFactory.class);
    this.beanManager = beanManagerFactory.getBeanManager(applicationConfig.getFacesConfig());

    PortletRequest portletRequest = bridgeContext.getPortletRequest();
    this.portletSession = portletRequest.getPortletSession();

    // Determines whether or not methods annotated with the @PreDestroy annotation are preferably invoked
View Full Code Here

  private PortletContext portletContext;
  private boolean preferPreDestroy;

  public ApplicationScopeMap(BridgeContext bridgeContext) {

    BeanManagerFactory beanManagerFactory = (BeanManagerFactory) FactoryExtensionFinder.getFactory(
        BeanManagerFactory.class);
    this.portletContext = bridgeContext.getPortletContext();

    String appConfigAttrName = ApplicationConfig.class.getName();
    ApplicationConfig applicationConfig = (ApplicationConfig) this.portletContext.getAttribute(appConfigAttrName);
    this.beanManager = beanManagerFactory.getBeanManager(applicationConfig.getFacesConfig());

    // Determines whether or not methods annotated with the @PreDestroy annotation are preferably invoked
    // over the @BridgePreDestroy annotation.
    PortletConfig portletConfig = bridgeContext.getPortletConfig();
    this.preferPreDestroy = PortletConfigParam.PreferPreDestroy.getBooleanValue(portletConfig);
View Full Code Here

  public RequestScopeMap(BridgeContext bridgeContext) {

    String appConfigAttrName = ApplicationConfig.class.getName();
    PortletContext portletContext = bridgeContext.getPortletContext();
    ApplicationConfig applicationConfig = (ApplicationConfig) portletContext.getAttribute(appConfigAttrName);
    BeanManagerFactory beanManagerFactory = (BeanManagerFactory) FactoryExtensionFinder.getFactory(
        BeanManagerFactory.class);
    this.beanManager = beanManagerFactory.getBeanManager(applicationConfig.getFacesConfig());

    // Determines whether or not JSF @ManagedBean classes annotated with @RequestScoped should be distinct for
    // each portlet when running under Liferay Portal.
    boolean distinctRequestScopedManagedBeans = false;
View Full Code Here

TOP

Related Classes of com.liferay.faces.bridge.bean.BeanManagerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.