01: /*
02: * $Id: MessageRequesting.java 10489 2008-01-23 17:53:38Z 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.MuleMessage;
14:
15: /**
16: * Defines generic methods for receiving events.
17: * The exact behaviour of the action is defined by the implementing class.
18: *
19: * @see org.mule.api.endpoint.ImmutableEndpoint
20: * @see MessageRequester
21: */
22: public interface MessageRequesting {
23:
24: long REQUEST_WAIT_INDEFINITELY = 0;
25: long REQUEST_NO_WAIT = -1;
26:
27: /**
28: * Make a specific request to the underlying transport
29: *
30: * @param timeout the maximum time the operation should block before returning.
31: * The call should return immediately if there is data available. If
32: * no data becomes available before the timeout elapses, null will be
33: * returned
34: * @return the result of the request wrapped in a MuleMessage object. Null will be
35: * returned if no data was avaialable
36: * @throws Exception if the call to the underlying protocal causes an exception
37: */
38: MuleMessage request(long timeout) throws Exception;
39:
40: }
|