Package org.jboss.util
Interface TimedCachePolicy.TimedEntry
-
- All Known Implementing Classes:
TimedCachePolicy.DefaultTimedEntry
- Enclosing class:
- TimedCachePolicy
public static interface TimedCachePolicy.TimedEntry
The interface that cache entries support.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
Notify the entry that it has been removed from the cache.java.lang.Object
getValue()
void
init(long now)
Initializes an entry with the current cache time.boolean
isCurrent(long now)
Is the entry still valid basis the current timeboolean
refresh()
Attempt to extend the entry lifetime by refreshing it.
-
-
-
Method Detail
-
init
void init(long now)
Initializes an entry with the current cache time. This is called when the entry is first inserted into the cache so that entries do not have to know the absolute system time.- Parameters:
now
-
-
isCurrent
boolean isCurrent(long now)
Is the entry still valid basis the current time- Parameters:
now
-- Returns:
- true if the entry is within its lifetime, false if it is expired.
-
refresh
boolean refresh()
Attempt to extend the entry lifetime by refreshing it.- Returns:
- true if the entry was refreshed successfully, false otherwise.
-
destroy
void destroy()
Notify the entry that it has been removed from the cache.
-
getValue
java.lang.Object getValue()
- Returns:
- the value component of the TimedEntry. This may or may not be the TimedEntry implementation.
-
-