public interface ResourceEntry<T> extends SharedResourceFactoryResponse<T>
SharedResourceFactoryResponse containing a instance of a resource.| Modifier and Type | Method and Description |
|---|---|
T |
getResource() |
default T |
getResourceIfValid()
This method should guarantee that if all callers accessing the resource using this method then the object is
returned atomically with respect to any validity state change.
|
boolean |
isValid() |
void |
onInvalidate()
This method will be called when the entry is invalidated.
|
T getResource()
boolean isValid()
SharedResourceFactory.void onInvalidate()
SharedResourceFactory wishes to provide (e.g. whether already
acquired objects should be closed).
Note that for consistency, the broker runs this method synchronously before a new instance is created for the same
key, blocking all requests for that key. As suck, this method should be reasonably fast.default T getResourceIfValid()