synchronized void loadFlows(FacesContext context, FlowHandler flowHandler) throws IOException { BeanManager beanManager = getCdiBeanManager(context); Bean<?> extensionImpl = beanManager.resolve(beanManager.getBeans(FlowDiscoveryCDIExtension.class)); if (extensionImpl == null) { if (LOGGER.isLoggable(SEVERE)) { LOGGER.log(SEVERE, "Unable to obtain {0} from CDI implementation. Flows described with {1} are unavailable.", new String[] { FlowDiscoveryCDIExtension.class.getName(), FlowDefinition.class.getName() }); } return; } CreationalContext<?> creationalContext = beanManager.createCreationalContext(extensionImpl); FlowDiscoveryCDIExtension myExtension = (FlowDiscoveryCDIExtension) beanManager.getReference(extensionImpl, FlowDiscoveryCDIExtension.class, creationalContext); List<Producer<Flow>> flowProducers = myExtension.getFlowProducers(); WebConfiguration config = WebConfiguration.getInstance(); if (!flowProducers.isEmpty()) { enableClientWindowModeIfNecessary(context); } for (Producer<Flow> flowProducer : flowProducers) { Flow toAdd = flowProducer.produce(beanManager.<Flow>createCreationalContext(null)); if (null == toAdd) { LOGGER.log(SEVERE, "Flow producer method {0}() returned null. Ignoring.", flowProducer.toString()); } else { flowHandler.addFlow(context, toAdd); config.setHasFlows(true); } } }
synchronized void loadFlows(FacesContext context, FlowHandler flowHandler) throws IOException { BeanManager beanManager = getCdiBeanManager(context); Bean<?> extensionImpl = beanManager.resolve(beanManager.getBeans(FlowDiscoveryCDIExtension.class)); if (extensionImpl == null) { if (LOGGER.isLoggable(SEVERE)) { LOGGER.log(SEVERE, "Unable to obtain {0} from CDI implementation. Flows described with {1} are unavailable.", new String[] { FlowDiscoveryCDIExtension.class.getName(), FlowDefinition.class.getName() }); } return; } CreationalContext<?> creationalContext = beanManager.createCreationalContext(extensionImpl); FlowDiscoveryCDIExtension myExtension = (FlowDiscoveryCDIExtension) beanManager.getReference(extensionImpl, FlowDiscoveryCDIExtension.class, creationalContext); List<Producer<Flow>> flowProducers = myExtension.getFlowProducers(); WebConfiguration config = WebConfiguration.getInstance(); if (!flowProducers.isEmpty()) { enableClientWindowModeIfNecessary(context); } for (Producer<Flow> flowProducer : flowProducers) { Flow toAdd = flowProducer.produce(beanManager.<Flow>createCreationalContext(null)); if (null == toAdd) { LOGGER.log(SEVERE, "Flow producer method {0}() returned null. Ignoring.", flowProducer.toString()); } else { flowHandler.addFlow(context, toAdd); config.setHasFlows(true); } } }
LOGGER.log(Level.SEVERE, "Flow producer method {0}() returned null. Ignoring.", cur.toString()); } else { flowHandler.addFlow(context, toAdd); config.setHasFlows(true);
synchronized void loadFlows(FacesContext context, FlowHandler flowHandler) throws IOException { BeanManager beanManager = getCdiBeanManager(context); Bean<?> extensionImpl = beanManager.resolve(beanManager.getBeans(FlowDiscoveryCDIExtension.class)); if (extensionImpl == null) { if (LOGGER.isLoggable(SEVERE)) { LOGGER.log(SEVERE, "Unable to obtain {0} from CDI implementation. Flows described with {1} are unavailable.", new String[] { FlowDiscoveryCDIExtension.class.getName(), FlowDefinition.class.getName() }); } return; } CreationalContext<?> creationalContext = beanManager.createCreationalContext(extensionImpl); FlowDiscoveryCDIExtension myExtension = (FlowDiscoveryCDIExtension) beanManager.getReference(extensionImpl, FlowDiscoveryCDIExtension.class, creationalContext); List<Producer<Flow>> flowProducers = myExtension.getFlowProducers(); WebConfiguration config = WebConfiguration.getInstance(); if (!flowProducers.isEmpty()) { enableClientWindowModeIfNecessary(context); } for (Producer<Flow> flowProducer : flowProducers) { Flow toAdd = flowProducer.produce(beanManager.<Flow>createCreationalContext(null)); if (null == toAdd) { LOGGER.log(SEVERE, "Flow producer method {0}() returned null. Ignoring.", flowProducer.toString()); } else { flowHandler.addFlow(context, toAdd); config.setHasFlows(true); } } }
public static void configureAnnotatedFlows(FacesContext facesContext) { FacesFlowProviderFactory factory = FacesFlowProviderFactory.getFacesFlowProviderFactory(facesContext.getExternalContext()); FacesFlowProvider provider = factory.getFacesFlowProvider(facesContext.getExternalContext()); Iterator<Flow> it = provider.getAnnotatedFlows(facesContext); if (it != null) { if (it.hasNext()) { FacesConfigurator.enableDefaultWindowMode(facesContext); } while (it.hasNext()) { Flow flow = it.next(); if (flow instanceof FlowImpl) { ((FlowImpl)flow).freeze(); } facesContext.getApplication().getFlowHandler().addFlow(facesContext, flow); } } } }
flowBuilder.viewNode(flowId, "/" + flowId + "/" + flowId + ".xhtml").markAsStartNode(); flowHandler.addFlow(context, flowBuilder.getFlow());
flowBuilder.viewNode(flowId, "/" + flowId + "/" + flowId + ".xhtml").markAsStartNode(); flowHandler.addFlow(context, flowBuilder.getFlow());
flowBuilder.viewNode(flowId, "/" + flowId + "/" + flowId + ".xhtml").markAsStartNode(); flowHandler.addFlow(context, flowBuilder.getFlow());
flowBuilder.viewNode(flowId, "/" + flowId + "/" + flowId + ".xhtml").markAsStartNode(); flowHandler.addFlow(context, flowBuilder.getFlow());
application.getFlowHandler().addFlow(facesContext, flow);