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

org.ioc.commons.flowcontrol.common.Receiver Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.2.1
Show newest version
package org.ioc.commons.flowcontrol.common;

import java.util.Set;

import javax.validation.ConstraintViolation;

/**
 * Interface for callbacks on asynchronous calls.
 * 
 * @author Jesús Lunar Pérez
 * 
 * @param 	On success object type.
 */
public interface Receiver extends HasSuccess, HasFailure {
	/**
	 * The first method called when data has been received.
	 * 
	 * @param success
	 *            true if the data was received OK; false otherwise.
	 */
	void onEnd(boolean success);

	/**
	 * Invoked when the asynchronous call has been completed successfuly.
	 * 
	 * @param result	The result object.
	 */
	public void success(S result);

	/**
	 * Invoked when the asynchronous call has been completed with a failure.

	 * @param failure	The failure object.
	 */
	public void failure(Throwable failure);

	/**
	 * Method called when some constraints have been violated trying to make the
	 * DAO operation.
	 * 
	 * @param violations
	 */
	void constraintViolation(Set> violations);
}