01: /*
02: * $Id: MessageDispatching.java 10961 2008-02-22 19:01:02Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.transport;
12:
13: import org.mule.api.MuleEvent;
14: import org.mule.api.MuleMessage;
15:
16: /**
17: * Define generic methods for dispatching events.
18: * The exact behaviour of the action is defined by the implementing class.
19: *
20: * @see org.mule.api.endpoint.OutboundEndpoint
21: * @see org.mule.api.transport.MessageDispatcher
22: */
23: public interface MessageDispatching {
24: long RECEIVE_WAIT_INDEFINITELY = 0;
25: long RECEIVE_NO_WAIT = -1;
26:
27: /**
28: * Dispatches an event from the endpoint to the external system
29: *
30: * @param event The event to dispatch
31: * @throws DispatchException if the event fails to be dispatched
32: */
33: void dispatch(MuleEvent event) throws DispatchException;
34:
35: /**
36: * Sends an event from the endpoint to the external system
37: *
38: * @param event The event to send
39: * @return event the response form the external system wrapped in a MuleEvent
40: * @throws DispatchException if the event fails to be dispatched
41: */
42: MuleMessage send(MuleEvent event) throws DispatchException;
43:
44: }
|