Examples of ApplicationAssociate


Examples of com.sun.faces.application.ApplicationAssociate

    }
   
    void publishInstanceToApplication() {
        ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
        if (null != extContext) {
            ApplicationAssociate associate = ApplicationAssociate.getInstance(extContext);
            if (null != associate) {
                associate.setJSFVersionTracker(this);
            }
        }
    }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

     * {@link #populateFacesELResolverForJsp(javax.faces.context.FacesContext)}.<p/>
     */

    public synchronized void beforePhase(PhaseEvent event) {
        if (!preInitCompleted) {
            ApplicationAssociate associate =
                 ApplicationAssociate.getInstance(
                      FacesContext.getCurrentInstance().getExternalContext());
            associate.setRequestServiced();
            populateFacesELResolverForJsp(event.getFacesContext());
            preInitCompleted = true;

        }
    }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

     *
     * @param context - the <code>FacesContext</code> for the current request
     */
    protected void populateFacesELResolverForJsp(FacesContext context) {

        ApplicationAssociate appAssociate =
              ApplicationAssociate.getInstance(context.getExternalContext());
        CompositeELResolver compositeELResolverForJsp =
              appAssociate.getFacesELResolverForJsp();
        if (compositeELResolverForJsp == null) {
            if (LOGGER.isLoggable(Level.INFO)) {
                LOGGER.log(Level.INFO,
                           "jsf.lifecycle.initphaselistener.resolvers_not_registered",
                           new Object[] { appAssociate.getContextName() });
            }
            return;
        }

        ELUtils.buildJSPResolver(compositeELResolverForJsp, appAssociate);

        // somewhat of a hack, but since we're here, trigger the creation
        // of the FacesResolvers as well by calling Application.getELResolver()
        // to avoid a sync block on that method.
        context.getApplication().getELResolver();

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.log(Level.FINE,
                       "jsf.lifecycle.initphaselistener.resolvers_registered",
                       new Object[] { appAssociate.getContextName() });
        }
    }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

        // add the bean to the managed bean stack.
        beanList.add(managedBean.getManagedBeanName());

        // populate the bean with its contents
        try {
            ApplicationAssociate associate = getAssociate(context);
            InjectionProvider injectionProvider =
                  associate.getInjectionProvider();
           
            // Perform resource injection first
            if (injectable) {
                injectionProvider.inject(bean);   
            }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

            || externalContext.getApplicationMap().containsKey(property)) {
            return null;
        }

        // if it's a managed bean, try to create it
        ApplicationAssociate associate = ApplicationAssociate
                    .getInstance(facesContext.getExternalContext());
        if (null != associate) {
            result = associate.createAndMaybeStoreManagedBeans(facesContext,
                                                               ((String)property));
            if ( result != null) {
                context.setPropertyResolved(true);
            }
        }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

        ArrayList<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();

        FacesContext facesContext =
            (FacesContext) context.getContext(FacesContext.class);
        ApplicationAssociate associate =
            ApplicationAssociate.getInstance(facesContext.getExternalContext());
        Map mbMap = associate.getManagedBeanFactoryMap();
        if (mbMap == null) {
            return list.iterator();
        }
        // iterate over the list of managed beans
        for (Iterator i = mbMap.entrySet().iterator(); i.hasNext(); ) {
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

        ArrayList<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();
      
        FacesContext facesContext =
            (FacesContext) context.getContext(FacesContext.class);
        ApplicationAssociate associate =
            ApplicationAssociate.getInstance(facesContext.getExternalContext());
        Map<String,ResourceBundleBean> rbMap = associate.getResourceBundleBeanMap();
        if (rbMap == null) {
            return list.iterator();
        }
        // iterate over the list of managed beans
        for (Iterator<Map.Entry<String,ResourceBundleBean>> i = rbMap.entrySet().iterator(); i.hasNext(); ) {
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Building View: " + view.getViewId());
        }
        if (faceletFactory == null) {
            ApplicationAssociate associate = ApplicationAssociate.getInstance(ctx.getExternalContext());
            faceletFactory = associate.getFaceletFactory();
            assert (faceletFactory != null);
        }
        RequestStateManager.set(ctx,
                                RequestStateManager.FACELET_FACTORY,
                                faceletFactory);
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

    @Override
    public boolean viewExists(FacesContext context,
                              String viewId) {
        if (handlesViewId(viewId)) {
            if (faceletFactory == null) {
                ApplicationAssociate associate = ApplicationAssociate.getInstance(context.getExternalContext());
                faceletFactory = associate.getFaceletFactory();
                assert (faceletFactory != null);
            }
          
            return faceletFactory.getResourceResolver().resolveUrl(viewId) != null;
        }
View Full Code Here

Examples of com.sun.faces.application.ApplicationAssociate

                    }
                    LOGGER.severe(sb.toString());
                }              
            }
            registerELResolverAndListenerWithJsp(context, false);
            ApplicationAssociate associate =
                 ApplicationAssociate.getInstance(context);
            if (associate != null) {
                associate.setContextName(getServletContextIdentifier(context));
            }
            RenderKitUtils.loadSunJsfJs(initContext.getExternalContext());
           
        } finally {
            Verifier.setCurrentInstance(null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.