Examples of RuntimeConfig


Examples of org.apache.myfaces.config.RuntimeConfig

    }

    private Map<String, List> getNavigationCases(FacesContext facesContext)
    {
        ExternalContext externalContext = facesContext.getExternalContext();
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);

        if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
        {
            synchronized(this)
            {
                if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
                {
                    Collection rules = runtimeConfig.getNavigationRules();
                    int rulesSize = rules.size();
                    Map<String, List> cases = new HashMap<String, List>(HashMapUtils.calcCapacity(rulesSize));
                    List<String> wildcardKeys = new ArrayList<String>();

                    for (Iterator iterator = rules.iterator(); iterator.hasNext();)
                    {
                        NavigationRule rule = (NavigationRule) iterator.next();
                        String fromViewId = rule.getFromViewId();

                        //specification 7.4.2 footnote 4 - missing fromViewId is allowed:
                        if (fromViewId == null)
                        {
                            fromViewId = ASTERISK;
                        }
                        else
                        {
                            fromViewId = fromViewId.trim();
                        }

                        List list = cases.get(fromViewId);
                        if (list == null)
                        {
                            list = new ArrayList(rule.getNavigationCases());
                            cases.put(fromViewId, list);
                            if (fromViewId.endsWith(ASTERISK))
                            {
                                wildcardKeys.add(fromViewId);
                            }
                        } else {
                            list.addAll(rule.getNavigationCases());
                        }

                    }
                    Collections.sort(wildcardKeys, new KeyComparator());

                    synchronized (cases)
                    {
                        // We do not really need this sychronization at all, but this
                        // gives us the peace of mind that some good optimizing compiler
                        // will not rearrange the execution of the assignment to an
                        // earlier time, before all init code completes
                        _navigationCases = cases;
                        _wildcardKeys = wildcardKeys;

                        runtimeConfig.setNavigationRulesChanged(false);
                    }
                }
            }
        }
        return _navigationCases;
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

            protected void initContainerIntegration(ServletContext servletContext,
                    ExternalContext externalContext)
            {
                ExpressionFactory expressionFactory = createExpressionFactory();

                RuntimeConfig runtimeConfig = buildConfiguration(servletContext, externalContext, expressionFactory);
            }
        });
        listener.contextInitialized(new ServletContextEvent(servletContext));
    }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        {
            if (_navigationCases == null)
            {
                FacesContext facesContext = FacesContext.getCurrentInstance();
                ExternalContext externalContext = facesContext.getExternalContext();
                RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
               
                calculateNavigationCases(runtimeConfig);
            }
            return _navigationCases;
        }
        else
        {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);

            if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
            {
                calculateNavigationCases(runtimeConfig);
            }
            return _navigationCases;
        }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        {
            if (_navigationCases == null)
            {
                FacesContext facesContext = FacesContext.getCurrentInstance();
                ExternalContext externalContext = facesContext.getExternalContext();
                RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
               
                calculateNavigationCases(facesContext, runtimeConfig);
            }
            return _navigationCases;
        }
        else
        {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);

            if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
            {
                calculateNavigationCases(facesContext, runtimeConfig);
            }
            return _navigationCases;
        }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        // create and configure our ApplicationImpl instance
        FactoryFinder.setFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY,
                MockViewDeclarationLanguageFactory.class.getName());
        FactoryFinder.setFactory(FactoryFinder.FACELET_CACHE_FACTORY,
                FaceletCacheFactoryImpl.class.getName());
        RuntimeConfig runtimeConfig = new RuntimeConfig();
        _testApplication = new TestApplicationWrapper(new ApplicationImpl(runtimeConfig));
        facesContext.setApplication(_testApplication);
    }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

     * @return the current runtime configuration
     */
    protected RuntimeConfig buildConfiguration(ServletContext servletContext,
            ExternalContext externalContext, ExpressionFactory expressionFactory)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
        runtimeConfig.setExpressionFactory(expressionFactory);
       
        ApplicationImpl.setInitializingRuntimeConfig(runtimeConfig);
       
        // And configure everything
        new FacesConfigurator(externalContext).configure();
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        {
            if (_navigationCases == null)
            {
                FacesContext facesContext = FacesContext.getCurrentInstance();
                ExternalContext externalContext = facesContext.getExternalContext();
                RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
               
                calculateNavigationCases(facesContext, runtimeConfig);
            }
            return _navigationCases;
        }
        else
        {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);

            if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
            {
                calculateNavigationCases(facesContext, runtimeConfig);
            }
            return _navigationCases;
        }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        }
    }
   
    private void _initializeContractMappings(ExternalContext context)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(context);
        List<String> prefixWildcardKeys = new ArrayList<String>();
        Map<String, List<String>> contractMappings = new HashMap<String, List<String>>();
       
        for (Map.Entry<String, List<String>> entry : runtimeConfig.getContractMappings().entrySet())
        {
            String urlPattern = entry.getKey().trim();
            if (urlPattern.endsWith(ASTERISK))
            {
                prefixWildcardKeys.add(urlPattern);
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        {
            if (_navigationCases == null)
            {
                FacesContext facesContext = FacesContext.getCurrentInstance();
                ExternalContext externalContext = facesContext.getExternalContext();
                RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
               
                calculateNavigationCases(runtimeConfig);
            }
            return _navigationCases;
        }
        else
        {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);

            if (_navigationCases == null || runtimeConfig.isNavigationRulesChanged())
            {
                calculateNavigationCases(runtimeConfig);
            }
            return _navigationCases;
        }
View Full Code Here

Examples of org.apache.myfaces.config.RuntimeConfig

        }
    }
   
    private void _initializeContractMappings(ExternalContext context)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(context);
        List<String> prefixWildcardKeys = new ArrayList<String>();
        Map<String, List<String>> contractMappings = new HashMap<String, List<String>>();
       
        for (Map.Entry<String, List<String>> entry : runtimeConfig.getContractMappings().entrySet())
        {
            String urlPattern = entry.getKey().trim();
            if (urlPattern.endsWith(ASTERISK))
            {
                prefixWildcardKeys.add(urlPattern);
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.