| org.cougaar.yp.YPFuture
All known Subclasses: org.cougaar.yp.YPFutureImpl,
YPFuture | public interface YPFuture (Code) | | An outstanding YP response object, returned from all of the YPProxy
methods.
A consumer of the YP information would issue a query, then
watch the returned YPFuture object until
isReady returns true.
|
Inner Class :interface YPComplete | |
Inner Class :interface Callback extends YPComplete | |
Inner Class :interface ResponseCallback extends YPComplete | |
Method Summary | |
Object | get() gets the response value as an object, blocking if need be. | Object | get(long msecs) gets the response value as an object, blocking if need be for up to the
specified millis.
If still not ready at the end, will return null, e.g. | Element | getElement() | Object | getFinalContext() | Object | getInitialContext() In which context was this query issued
Object is either a MessageAddress or a Community. | int | getSearchMode() Search mode to be used in resolving this query. | boolean | isInquiry() | boolean | isReady() Indicate when a response has been recieved (or a failure indicated). | void | setCallback(YPComplete callable) Clients may set a callback here to be invoked when
the response is ready. |
get | Object get() throws UDDIException(Code) | | gets the response value as an object, blocking if need be.
|
get | Object get(long msecs) throws UDDIException(Code) | | gets the response value as an object, blocking if need be for up to the
specified millis.
If still not ready at the end, will return null, e.g. if finished due to
timeout or thread interruption.
May also throw a runtimeException if the query returns an exception.
The actual exception is the value of getCause of the RuntimeException thrown.
If msecs is specified as 0 then it will wait forever.
|
getElement | Element getElement()(Code) | | Access the XML element describing the query *
|
getFinalContext | Object getFinalContext()(Code) | | In which context was this query resolved
Object is either a MessageAddress or a Community |
getInitialContext | Object getInitialContext()(Code) | | In which context was this query issued
Object is either a MessageAddress or a Community. |
getSearchMode | int getSearchMode()(Code) | | Search mode to be used in resolving this query.
int is one of the values defined by YPProxy.SearchMode |
isInquiry | boolean isInquiry()(Code) | | Is the message a query? *
|
isReady | boolean isReady()(Code) | | Indicate when a response has been recieved (or a failure indicated).
If true, then the get methods will return immediately.
|
setCallback | void setCallback(YPComplete callable)(Code) | | Clients may set a callback here to be invoked when
the response is ready. Most clients will use the Blackboard
interation pattern and look for publishChange events rather
than registering for explicit callbacks.
Only Callback and Callable instances are actually accepted.
Callers are STRONGLY encouraged to use OneShotMachine
instead of direct callbacks if the callback requires significant
processing or if there is a chance that the callback will block.
|
|
|