1 package nmp.util;
2
3 /***
4 * Abstraction for representing results of asynchronous services
5 */
6 public interface Promise
7 {
8 /***
9 * Returns true if the result of invocation is already known
10 */
11 public boolean isResultAvailable();
12
13 /***
14 * Gets the result of the preformed operation. This method blocks until the result
15 * is received.
16 */
17 public Object getResult();
18
19 /***
20 * Waits (a given time) until the result of the operation is available.
21 *
22 * @param mills The maximum time to wait in miliseconds. 0 - means waiting forever.
23 * @return Returns true if result ifavailable
24 */
25 public boolean waitForResult( long mills);
26 }
This page was automatically generated by Maven