endOfLife(String) in which case they will linger for a few seconds
and then be removed.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_MAX_COMPONENTS
By default an unlimited number of elements can be tracked. |
| public static final int | DEFAULT_TIMEOUT
The default timeout duration is 30 minutes |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | Returns: collection of componentsReturns the collection of all components tracked by this instance. |
| public Set | |
| public void | |
| public C | |
| public int | |
| public C | getOrCreate(String key, long timestamp)
Get the component identified by 'key', updating its timestamp in the process. |
| public void | removeStaleComponents(long
current time in milliseconds now)Remove components which are deemed stale. |
| DEFAULT_MAX_COMPONENTS | back to summary |
|---|---|
| public static final int DEFAULT_MAX_COMPONENTS By default an unlimited number of elements can be tracked. | |
| DEFAULT_TIMEOUT | back to summary |
|---|---|
| public static final int DEFAULT_TIMEOUT The default timeout duration is 30 minutes | |
| allComponents | back to summary |
|---|---|
| public Collection Returns the collection of all components tracked by this instance.
| |
| allKeys | back to summary |
|---|---|
| public Set Set of all keys in this tracker in no particular order. | |
| endOfLife | back to summary |
|---|---|
| public void endOfLife(String key) Mark component identified by 'key' as having reached its end-of-life. End-of-lifed components will linger for a few more seconds before being removed. | |
| find | back to summary |
|---|---|
| public C find(String key) Find the component identified by 'key', without updating the timestamp. Returns null if no corresponding component could be found.
| |
| getComponentCount | back to summary |
|---|---|
| public int getComponentCount() Returns the number of components tracked.
| |
| getOrCreate | back to summary |
|---|---|
| public C getOrCreate(String key, long timestamp) Get the component identified by 'key', updating its timestamp in the process. If the corresponding component could not be found, it is created. | |
| removeStaleComponents | back to summary |
|---|---|
| public void removeStaleComponents(long now) Remove components which are deemed stale. Components which have not been accessed for more than a user-specified duration are deemed stale.
If the number of components exceeds, Depending on the component type, components will be cleared or stopped (as appropriate) right before removal.
| |