org.openbp.config.context.PersistedTokenConfigBase 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.PersistentTokenContextService;
import org.openbp.server.context.TokenContextService;
import org.openbp.server.persistence.PersistenceContextProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Spring configuration supporting persistent (database-related) token context management.
* Supports saving and loading tokens to/from a database in order to support wait states, workflows and error recovery.
*/
@Configuration
public abstract class PersistedTokenConfigBase
{
/** Transactionality flag */
private boolean transactional;
@Bean
public TokenContextService tokenContextService()
{
// Also possible if you require information on running, uncommitted contexts (e. g. progress information),
// use the session-aware persistant token context service.
// return new SessionAwarePersistentTokenContextService();
return new PersistentTokenContextService();
}
@Bean
public abstract PersistenceContextProvider persistenceContextProvider();
/**
* Gets the transactionality flag.
*/
public boolean isTransactional()
{
return transactional;
}
/**
* Sets the transactionality flag.
*/
public void setTransactional(boolean transactional)
{
this.transactional = transactional;
}
}