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

org.ioc.commons.integration.common.RequestManager 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.integration.common;

import org.ioc.commons.flowcontrol.common.Receiver;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.flowcontrol.operationmanager.OperationManagerTrigger;

public interface RequestManager {
	/**
	 * Specifies the objet which will receive the data
	 * 
	 * @param callback
	 *            The callback receiver
	 * @return A request manager to continue managing the operation.
	 */
	RequestManager to(Receiver callback);

	/**
	 * Handle the beginning and the end of the operation through an
	 * {@link OperationManagerTrigger}
	 * 
	 * @param operation
	 *            Operation to be managed during the service operation.
	 * @param operationManager
	 *            Trigger for managing the beginning and the end of the
	 *            operation.
	 * @return A request manager to continue managing the operation.
	 */
	> RequestManager performing(O operation,
			OperationManagerTrigger operationManager);

	/**
	 * Specifies the minimum required properties (accesible attributes of the T
	 * class through getters) to be filled in the T object when it is received.
	 * 
	 * @param requiredProperties
	 *            A set of properfies from T
	 * @return A request manager to continue managing the operation.
	 */
	RequestManager with(String... requiredProperties);

	/**
	 * Put this operation in a named queue.
	 * 
	 * The operations put on a named queue will be executed consecutively as a
	 * FIFO queue. A queue is created internally when is used the first time.
	 * 
	 * @param queueName
	 *            Name of the queue
	 * @return A request manager to continue managing the operation.
	 */
	RequestManager queue(String queueName);

	/**
	 * Some implementations need to track down which instance made the request
	 * (i.e. Android implentation for getting the proper context). Call it
	 * passing "this" as parameter in order to ensure your implementation
	 * receives the caller if is needed. For others implementation which do not
	 * require it, this call will be ignored.
	 * 
	 * @param Who
	 *            is calling this request. Should be "this" at the moment of the
	 *            call.
	 */
	RequestManager caller(Object thisCaller);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy