1 package pt.digitalis.dif.controller.interfaces; 2 3 import pt.digitalis.dif.controller.objects.DIFResponse; 4 import pt.digitalis.dif.exception.controller.BusinessFlowException; 5 import pt.digitalis.dif.exception.controller.ControllerException; 6 7 /** 8 * Defines a default interface for DIFDispatchers. 9 * 10 * @see pt.digitalis.dif.controller.AbstractDIFDispatcher 11 * 12 * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a> 13 * @created Dec 11, 2007 14 */ 15 public interface IDIFDispatcher { 16 17 /** 18 * This method serves as an interface between the AbstractDIFDispatcher and the calling AbstractChAL. It is invoked by the AbstractChAL on a 19 * AbstractDIFDispatcher object. The method verifies the request's integrity, generates the appropriate context and 20 * schedules the request for service. When the execution is finished it returns the response to the AbstractChAL. If some 21 * step on the execution flow doesn't happen as expected, an exception is raised. 22 * 23 * @param difRequest 24 * The AbstractChAL-originated DIFRequest object 25 * @return The response object to be delivered to the calling AbstractChAL 26 * @throws BusinessFlowException 27 * when an exception is thrown by the stage's init/execute steps 28 * @throws ControllerException 29 * when any runtime exception is thrown in a controller step 30 */ 31 public abstract DIFResponse dispatch(IDIFRequest difRequest) throws BusinessFlowException, ControllerException; 32 33 /** 34 * @return the ID of the Channel this AbstractChAL manages 35 */ 36 public String getChannelID(); 37 38 }