org.openbp.config.context.InMemoryTokenConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openbp-server Show documentation
Show all versions of openbp-server Show documentation
The OpenBP process engine (main module)
package org.openbp.config.context;
import org.openbp.server.context.TokenContextService;
import org.openbp.server.context.TransientTokenContextService;
import org.openbp.server.persistence.PersistenceContextProvider;
import org.openbp.server.persistence.dummy.DummyPersistenceContextProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Spring configuration supporting transient (in-memory only) token context management.
* Supports running tokens in memory for processes that do not need to persist their state in the database
* (i. e. do not require wait states or error recovery).
*/
@Configuration
public class InMemoryTokenConfig
{
@Bean
public TokenContextService tokenContextService()
{
return new TransientTokenContextService();
}
@Bean
public PersistenceContextProvider persistenceContextProvider()
{
return new DummyPersistenceContextProvider();
}
}