public class ImmediatelyInvalidResourceEntry<T> extends ResourceInstance<T>
ResourceEntry that expires immediately. The resource is not closed on invalidation since the lifetime of
the object cannot be determined by the cache, so the recipient of the resource needs to close it.| Constructor and Description |
|---|
ImmediatelyInvalidResourceEntry(T resource) |
| Modifier and Type | Method and Description |
|---|---|
T |
getResource()
This method returns the resource, but may have logic before the return.
|
T |
getResourceIfValid()
This method is synchronized so that the validity check and validity change is atomic for callers of this method.
|
boolean |
isValid() |
void |
onInvalidate() |
public ImmediatelyInvalidResourceEntry(T resource)
public T getResource()
ResourceInstancegetResource in interface ResourceEntry<T>getResource in class ResourceInstance<T>public boolean isValid()
isValid in interface ResourceEntry<T>isValid in class ResourceInstance<T>public void onInvalidate()
onInvalidate in interface ResourceEntry<T>onInvalidate in class ResourceInstance<T>public T getResourceIfValid()