org.ioc.commons.integration.dataaccess.dao.Tx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons Show documentation
Show all versions of ioc-commons Show documentation
This project defines a set of useful java interfaces for helping you in the definition of the structure of your developments in Java-projects which are designed using a Inversion-Of-Control (IOC) pattern. Useful for MVP-Pattern designs in applications coded on GWT, SWT, Android, etc.
package org.ioc.commons.integration.dataaccess.dao;
import org.ioc.commons.flowcontrol.common.Receiver;
import org.ioc.commons.integration.common.RequestManager;
/**
* A transaction opened from a Data manager
*
* @author Jesús Lunar Pérez
*
* @param
* Dao factory type
*/
public interface Tx {
public D daoFactory();
/**
* It fires all operations accumulated into the transaction.
*
* The transaction becomes invalid once the method
* {@link Receiver#onEnd(boolean)} will be fired in whichever of the
* accumulated operations, but never before that.
*
* In case a constraint violation happens, the transaction will remain valid
* and must be reused for firing the accumulated operations.
*/
public void fireTransaction();
/**
* It fires operations as {@link #fireTransaction()} but uses internally a queue for firing it.
*
* Read more about queue on {@link RequestManager#queue(String)}
*
* @param queueName
*/
public void fireOrQueueTransaction(String queueName);
/**
* Indica si una transacción puede ser lanzada.
*/
boolean canBeFired();
}