Search in sources :

Example 1 with FlowExecutionImplFactory

use of org.springframework.webflow.engine.impl.FlowExecutionImplFactory in project cas by apereo.

the class CasWebflowContextConfiguration method flowExecutorViaClientFlowExecution.

@Bean
public FlowExecutor flowExecutorViaClientFlowExecution() {
    final FlowDefinitionRegistry loginFlowRegistry = loginFlowRegistry();
    final ClientFlowExecutionRepository repository = new ClientFlowExecutionRepository();
    repository.setFlowDefinitionLocator(loginFlowRegistry);
    repository.setTranscoder(loginFlowStateTranscoder());
    final FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    repository.setFlowExecutionFactory(factory);
    return new FlowExecutorImpl(loginFlowRegistry, factory, repository);
}
Also used : FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory) ClientFlowExecutionRepository(org.apereo.spring.webflow.plugin.ClientFlowExecutionRepository) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with FlowExecutionImplFactory

use of org.springframework.webflow.engine.impl.FlowExecutionImplFactory in project cas by apereo.

the class CasWebflowContextConfiguration method flowExecutorViaServerSessionBindingExecution.

@Bean
public FlowExecutor flowExecutorViaServerSessionBindingExecution() {
    final FlowDefinitionRegistry loginFlowRegistry = loginFlowRegistry();
    final SessionBindingConversationManager conversationManager = new SessionBindingConversationManager();
    conversationManager.setLockTimeoutSeconds(Long.valueOf(casProperties.getWebflow().getSession().getLockTimeout()).intValue());
    conversationManager.setMaxConversations(casProperties.getWebflow().getSession().getMaxConversations());
    final FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();
    final SerializedFlowExecutionSnapshotFactory flowExecutionSnapshotFactory = new SerializedFlowExecutionSnapshotFactory(executionFactory, loginFlowRegistry);
    flowExecutionSnapshotFactory.setCompress(casProperties.getWebflow().getSession().isCompress());
    final DefaultFlowExecutionRepository repository = new DefaultFlowExecutionRepository(conversationManager, flowExecutionSnapshotFactory);
    executionFactory.setExecutionKeyFactory(repository);
    return new FlowExecutorImpl(loginFlowRegistry, executionFactory, repository);
}
Also used : DefaultFlowExecutionRepository(org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository) SessionBindingConversationManager(org.springframework.webflow.conversation.impl.SessionBindingConversationManager) SerializedFlowExecutionSnapshotFactory(org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory) FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with FlowExecutionImplFactory

use of org.springframework.webflow.engine.impl.FlowExecutionImplFactory in project cas by apereo.

the class WebflowExecutorFactory method buildFlowExecutorViaServerSessionBindingExecution.

private FlowExecutor buildFlowExecutorViaServerSessionBindingExecution() {
    val conversationManager = new SessionBindingConversationManager();
    val session = webflowProperties.getSession();
    conversationManager.setLockTimeoutSeconds((int) Beans.newDuration(session.getLockTimeout()).getSeconds());
    conversationManager.setMaxConversations(session.getMaxConversations());
    val executionFactory = new FlowExecutionImplFactory();
    executionFactory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(executionListeners));
    val flowExecutionSnapshotFactory = new SerializedFlowExecutionSnapshotFactory(executionFactory, this.flowDefinitionRegistry);
    flowExecutionSnapshotFactory.setCompress(session.isCompress());
    val repository = new DefaultFlowExecutionRepository(conversationManager, flowExecutionSnapshotFactory);
    executionFactory.setExecutionKeyFactory(repository);
    return new FlowExecutorImpl(this.flowDefinitionRegistry, executionFactory, repository);
}
Also used : lombok.val(lombok.val) DefaultFlowExecutionRepository(org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository) SessionBindingConversationManager(org.springframework.webflow.conversation.impl.SessionBindingConversationManager) SerializedFlowExecutionSnapshotFactory(org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory) StaticFlowExecutionListenerLoader(org.springframework.webflow.execution.factory.StaticFlowExecutionListenerLoader) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory)

Example 4 with FlowExecutionImplFactory

use of org.springframework.webflow.engine.impl.FlowExecutionImplFactory in project cas by apereo.

the class WebflowExecutorFactory method buildFlowExecutorViaClientFlowExecution.

private FlowExecutor buildFlowExecutorViaClientFlowExecution() {
    val repository = new ClientFlowExecutionRepository();
    repository.setFlowDefinitionLocator(this.flowDefinitionRegistry);
    repository.setTranscoder(getWebflowStateTranscoder());
    val factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader());
    repository.setFlowExecutionFactory(factory);
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(executionListeners));
    return new FlowExecutorImpl(this.flowDefinitionRegistry, factory, repository);
}
Also used : lombok.val(lombok.val) StaticFlowExecutionListenerLoader(org.springframework.webflow.execution.factory.StaticFlowExecutionListenerLoader) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory)

Aggregations

FlowExecutionImplFactory (org.springframework.webflow.engine.impl.FlowExecutionImplFactory)4 FlowExecutorImpl (org.springframework.webflow.executor.FlowExecutorImpl)4 lombok.val (lombok.val)2 CipherBean (org.cryptacular.bean.CipherBean)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 Bean (org.springframework.context.annotation.Bean)2 SessionBindingConversationManager (org.springframework.webflow.conversation.impl.SessionBindingConversationManager)2 FlowDefinitionRegistry (org.springframework.webflow.definition.registry.FlowDefinitionRegistry)2 StaticFlowExecutionListenerLoader (org.springframework.webflow.execution.factory.StaticFlowExecutionListenerLoader)2 DefaultFlowExecutionRepository (org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository)2 SerializedFlowExecutionSnapshotFactory (org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory)2 ClientFlowExecutionRepository (org.apereo.spring.webflow.plugin.ClientFlowExecutionRepository)1