All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openbp.config.context.PersistedTokenConfigBase Maven / Gradle / Ivy

There is a newer version: 0.9.11
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy