|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| FulfilledPromise.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
package nmp.util;
|
|
| 2 |
|
|
| 3 |
/**
|
|
| 4 |
* Represents a promise for which the result is already known
|
|
| 5 |
*/
|
|
| 6 |
public class FulfilledPromise |
|
| 7 |
implements Promise
|
|
| 8 |
{
|
|
| 9 |
Object result; |
|
| 10 |
|
|
| 11 | 0 |
public FulfilledPromise( Object result) {
|
| 12 | 0 |
this.result = result;
|
| 13 |
} |
|
| 14 |
|
|
| 15 |
/**
|
|
| 16 |
* Returns true if the result of invocation is already known
|
|
| 17 |
*/
|
|
| 18 | 0 |
public boolean isResultAvailable() { |
| 19 | 0 |
return true; |
| 20 |
} |
|
| 21 |
|
|
| 22 |
/**
|
|
| 23 |
* Gets the result of the preformed operation. This method blocks until the result
|
|
| 24 |
* is received.
|
|
| 25 |
*/
|
|
| 26 | 0 |
public Object getResult() {
|
| 27 | 0 |
return result;
|
| 28 |
} |
|
| 29 |
|
|
| 30 |
/**
|
|
| 31 |
* Waits (a given time) until the result of the operation is available.
|
|
| 32 |
* May throw the exception(error) "OperationNotAvailableException" if server could
|
|
| 33 |
* not be contacted
|
|
| 34 |
* @param mills The maximum time to wait in miliseconds. 0 - means waiting forever.
|
|
| 35 |
* @return Returns true if result ifavailable
|
|
| 36 |
*/
|
|
| 37 | 0 |
public boolean waitForResult( long mills) { |
| 38 | 0 |
return true; |
| 39 |
} |
|
| 40 |
} |
|
| 41 |
|
|
||||||||||