Package org.apache.myfaces.extensions.cdi.core.api.projectstage

Examples of org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage


            ProjectStageProducer psp = JsfProjectStageProducer.getInstance();
            Assert.assertNotNull(psp);

            ProjectStageProducer.setProjectStage(null);

            ProjectStage ps = psp.getProjectStage();
            Assert.assertNotNull(ps);
            Assert.assertEquals(ps, ProjectStage.SystemTest);
            Assert.assertTrue(ps == ProjectStage.SystemTest);
        }
        finally
View Full Code Here


    private boolean isInProjectStage(Class<? extends ProjectStage>[] activatedIn)
    {
        if (activatedIn != null && activatedIn.length > 0)
        {
            ProjectStage ps = ProjectStageProducer.getInstance().getProjectStage();
            for (Class<? extends ProjectStage> activated : activatedIn)
            {
                if (ProjectStage.class.getName().equals(activated.getName()))
                {
                    throw new IllegalStateException(
                            "Using " + ProjectStage.class.getName() + " directly isn't allowed.");
                }

                if (ps.getClass().equals(activated))
                {
                    return true;
                }
            }
        }
View Full Code Here

        // first manually reset the ProjectStage
        ProjectStageProducer.setProjectStage(null);

        psp.determineProjectStage();

        ProjectStage ps = psp.getProjectStage();
        Assert.assertNotNull(ps);
        Assert.assertEquals(ps, ProjectStage.Production);
        Assert.assertTrue(ps == ProjectStage.Production);
    }
View Full Code Here

            // we need to do this manually because there is no dependency injection in place
            // at this time
            ProjectStageProducer psp = ProjectStageProducer.getInstance();

            psp.determineProjectStage();
            ProjectStage projectStage = psp.getProjectStage();

            if (projectStage == ProjectStage.UnitTest)
            {
                // for unit tests, we use the mock context
                afterBeanDiscovery.addContext(new MockViewScopedContext());
View Full Code Here

public class Jsf2ProjectStageProducer extends ProjectStageProducer
{
    @Override
    protected ProjectStage determineCustomProjectStage()
    {
        ProjectStage codiProjectStage = null;

        javax.faces.application.ProjectStage jsfProjectStage =
                FacesContext.getCurrentInstance().getApplication().getProjectStage();

        if (jsfProjectStage != null)
View Full Code Here

        return null;
    }

    protected ProjectStage getProjectStageFromJNDI()
    {
        ProjectStage ps = null;
        String stageName = null;

        try
        {
            stageName = JndiUtils.lookup(PROJECT_STAGE_JNDI_NAME, String.class);
View Full Code Here

    private boolean isInProjectStage(Class<? extends ProjectStage>[] activatedIn)
    {
        if (activatedIn != null && activatedIn.length > 0)
        {
            ProjectStage ps = getProjectStage();
            for (Class<? extends ProjectStage> activated : activatedIn)
            {
                if (ps.getClass().equals(activated))
                {
                    return true;
                }
            }
        }
View Full Code Here

        return null;
    }

    private void logConvertedBean(AnnotatedType annotatedType, Class<? extends Annotation> jsf2ScopeAnnotation)
    {
        ProjectStage projectStage = getCurrentProjectStage();

        if (projectStage == ProjectStage.Development)
        {
            logger.info("JSF2 bean was converted to a CDI bean. type: " + annotatedType.getJavaClass().getName() +
                    " original scope: " + jsf2ScopeAnnotation.getName());
View Full Code Here

        ManagedBean managedBeanAnnotation = beanClass.getAnnotation(ManagedBean.class);

        if(managedBeanAnnotation.eager())
        {
            ProjectStage projectStage = getCurrentProjectStage();

            if (projectStage == ProjectStage.Development)
            {
                logger.warning("Bean of type " + beanClass.getName() + " uses @" + ManagedBean.class.getName() +
                        " in combination with #eager = true. That's not supported with CDI. " +
View Full Code Here

    private final static String JSF_PROJECT_STAGE_SYSTEM_PROPERTY_NAME = "faces.PROJECT_STAGE";

    @Override
    protected ProjectStage resolveProjectStage()
    {
        ProjectStage projectStage = super.resolveProjectStage();

        if(projectStage != null)
        {
            return projectStage;
        }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStage

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.