Package com.sun.faces.application

Examples of com.sun.faces.application.ApplicationAssociate


            return false;
        }
        try {
            ExpressionFactory factory = (ExpressionFactory)
                    Util.loadClass(elFactoryType, this).newInstance();
            ApplicationAssociate associate =
                    ApplicationAssociate.getInstance(sc);
            if (associate != null) {
                associate.setExpressionFactory(factory);
            }
            return true;
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.SEVERE)) {
                LOGGER.severe(MessageFormat.format("Unable to instantiate ExpressionFactory ''{0}''",
View Full Code Here


        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

    @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

        FacesContext fc = FacesContext.getCurrentInstance();
        if (fc.getPartialViewContext().isAjaxRequest()) {
            return new AjaxExceptionHandlerImpl(new ExceptionHandlerImpl(Boolean.TRUE));
        }
        ApplicationAssociate associate = getAssociate(fc);
        return new ExceptionHandlerImpl(((associate != null) ? associate.isErrorPagePresent() : Boolean.TRUE));

    }
View Full Code Here

    // --------------------------------------------------------- Private Methods


    private static BeanManager getBeanManager() {

        ApplicationAssociate associate = ApplicationAssociate.getCurrentInstance();
        return ((associate != null) ? associate.getBeanManager() : null);

    }
View Full Code Here

     * @see ConfigProcessor#process(org.w3c.dom.Document[])
     */
    public void process(Document[] documents)
    throws Exception {

        ApplicationAssociate associate =
              ApplicationAssociate.getInstance(FacesContext.getCurrentInstance().getExternalContext());
        assert (associate != null);
        Compiler compiler = associate.getCompiler();

        for (int i = 0, length = documents.length; i < length; i++) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE,
                           MessageFormat.format(
View Full Code Here

     * <code>Lifecycle</code> instances.
     */
    public synchronized void afterPhase(PhaseEvent event) {

        if (!postInitCompleted && PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) {
            ApplicationAssociate associate =
                 ApplicationAssociate.getInstance(
                      event.getFacesContext().getExternalContext());
            associate.setRequestServiced();
            LifecycleFactory factory = (LifecycleFactory)
                  FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
            // remove ourselves from the list of listeners maintained by
            // the lifecycle instances
            for(Iterator<String> i = factory.getLifecycleIds(); i.hasNext(); ) {
View Full Code Here

     *
     * @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

    private Class<?> loadBeanClass() {
        if (beanClass == null) {
           String className = beanInfo.getClassName();
            Class<?> clazz = loadClass(className);
            ApplicationAssociate associate =
                  ApplicationAssociate.getCurrentInstance();

            if (!associate.isDevModeEnabled()) {
                beanClass = clazz;
            }

            // validate the bean class is public and has a public
            // no-arg ctor
View Full Code Here

     */
    public void process(Document[] documents)
    throws Exception {

        Application app = getApplication();
        ApplicationAssociate associate =
              ApplicationAssociate.getInstance(
                    FacesContext.getCurrentInstance().getExternalContext());
        LinkedHashMap<String,Node> viewHandlers = new LinkedHashMap<String,Node>();
        LinkedHashSet<String> defaultValidatorIds = null;
        for (int i = 0; i < documents.length; i++) {
View Full Code Here

TOP

Related Classes of com.sun.faces.application.ApplicationAssociate

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.