|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AsyncResourceRequest<V>
Interface for asynchronous requests for resources. Exactly one of useResource, handleTimeout, or handleException expected to be invoked before, or soon after, deadline specified by getDeadlineNs. Ideally, useResource is only invoked before the deadline. Ideally, handleTimeout is invoked soon after the deadline. If owners of an object with this interface need to take action after some specified timeout, then the owner needs to set their own timer.
Method Summary | |
---|---|
long |
getDeadlineNs()
|
void |
handleException(java.lang.Exception e)
Invoked upon exception trying to process resource request. |
void |
handleTimeout()
Invoked sometime (soon) after deadline. |
void |
useResource(V resource)
To be invoked with resource to use before deadline. |
Method Detail |
---|
void useResource(V resource)
resource
- resource should not be null.void handleTimeout()
void handleException(java.lang.Exception e)
e
- long getDeadlineNs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |