buildComponent(String),
processPriorToRemoval(Object), and isComponentStale(Object)
methods as appropriate for their component type.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private AbstractComponentTracker. | |
| private AbstractComponentTracker. | |
| private AbstractComponentTracker. | |
| pack-priv long | |
| pack-priv LinkedHashMap | |
| public static final long | |
| pack-priv LinkedHashMap | |
| protected int | |
| protected long | |
| public static final long | WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS
The minimum amount of time that has to elapse between successive removal iterations. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | allComponents()
Implements ch. |
| public Set | allKeys()
Implements ch. |
| protected abstract C | |
| public void | endOfLife(String key)
Implements ch. |
| public synchronized C | Returns: corresponding component, may be nullImplements ch. |
| private void | genericStaleComponentRemover(LinkedHashMap<String, AbstractComponentTracker.
|
| public int | getComponentCount()
Implements ch. |
| private AbstractComponentTracker. | |
| public int | |
| public synchronized C | getOrCreate(String key, long timestamp)
Implements ch. |
| public long | |
| protected abstract boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| protected abstract void | |
| private void | |
| public synchronized void | removeStaleComponents(long now)
Implements ch. |
| private void | |
| private void | |
| public void | |
| public void |
| ACCESS_ORDERED | back to summary |
|---|---|
| private static final boolean ACCESS_ORDERED | |
| byExcedent | back to summary |
|---|---|
| private AbstractComponentTracker. | |
| byLingering | back to summary |
|---|---|
| private AbstractComponentTracker. | |
| byTimeout | back to summary |
|---|---|
| private AbstractComponentTracker. | |
| lastCheck | back to summary |
|---|---|
| pack-priv long lastCheck | |
| lingerersMap | back to summary |
|---|---|
| pack-priv LinkedHashMap<String, AbstractComponentTracker. | |
| LINGERING_TIMEOUT | back to summary |
|---|---|
| public static final long LINGERING_TIMEOUT | |
| liveMap | back to summary |
|---|---|
| pack-priv LinkedHashMap<String, AbstractComponentTracker. | |
| maxComponents | back to summary |
|---|---|
| protected int maxComponents | |
| timeout | back to summary |
|---|---|
| protected long timeout | |
| WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS | back to summary |
|---|---|
| public static final long WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS The minimum amount of time that has to elapse between successive removal iterations. | |
| AbstractComponentTracker | back to summary |
|---|---|
| public AbstractComponentTracker() | |
| allComponents | back to summary |
|---|---|
| public Collection Implements ch. Doc from ch. Returns the collection of all components tracked by this instance.
| |
| allKeys | back to summary |
|---|---|
| public Set Implements ch. Doc from ch. Set of all keys in this tracker in no particular order. | |
| buildComponent | back to summary |
|---|---|
| protected abstract C buildComponent(String key) Build a component based on the key. | |
| endOfLife | back to summary |
|---|---|
| public void endOfLife(String key) Implements ch. Mark component identified by 'key' as having reached its end-of-life. | |
| find | back to summary |
|---|---|
| public synchronized C find(String key) Implements ch. Doc from ch. Find the component identified by 'key', without updating the timestamp. Returns null if no corresponding component could be found. Note that this method is synchronized.
| |
| genericStaleComponentRemover | back to summary |
|---|---|
| private void genericStaleComponentRemover(LinkedHashMap<String, AbstractComponentTracker. | |
| getComponentCount | back to summary |
|---|---|
| public int getComponentCount() Implements ch. Doc from ch. Returns the number of components tracked.
| |
| getFromEitherMap | back to summary |
|---|---|
| private AbstractComponentTracker. Get an entry from the liveMap, if not found search the lingerersMap. | |
| getMaxComponents | back to summary |
|---|---|
| public int getMaxComponents() | |
| getOrCreate | back to summary |
|---|---|
| public synchronized C getOrCreate(String key, long timestamp) Implements ch. Doc from ch. Get the component identified by 'key', updating its timestamp in the process. If the corresponding component could not be found, it is created. Note that this method is atomic, i.e. synchronized. | |
| getTimeout | back to summary |
|---|---|
| public long getTimeout() | |
| isComponentStale | back to summary |
|---|---|
| protected abstract boolean isComponentStale(C c) Components can declare themselves stale. Such components may be removed before they time out. | |
| isEntryDoneLingering | back to summary |
|---|---|
| private boolean isEntryDoneLingering(AbstractComponentTracker. | |
| isEntryStale | back to summary |
|---|---|
| private boolean isEntryStale(AbstractComponentTracker. | |
| isTooSoonForRemovalIteration | back to summary |
|---|---|
| private boolean isTooSoonForRemovalIteration(long now) | |
| processPriorToRemoval | back to summary |
|---|---|
| protected abstract void processPriorToRemoval(C component) Stop or clean the component. | |
| removeExcedentComponents | back to summary |
|---|---|
| private void removeExcedentComponents() | |
| removeStaleComponents | back to summary |
|---|---|
| public synchronized void removeStaleComponents(long now) Implements ch. Clear (and detach) components which are stale. Components which have not been accessed for more than a user-specified duration are deemed stale. | |
| removeStaleComponentsFromLingerersMap | back to summary |
|---|---|
| private void removeStaleComponentsFromLingerersMap(long now) | |
| removeStaleComponentsFromMainMap | back to summary |
|---|---|
| private void removeStaleComponentsFromMainMap(long now) | |
| setMaxComponents | back to summary |
|---|---|
| public void setMaxComponents(int maxComponents) | |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(long timeout) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv C | |
| pack-priv String | |
| pack-priv long |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public int | |
| public void | |
| public String |
| component | back to summary |
|---|---|
| pack-priv C component | |
| key | back to summary |
|---|---|
| pack-priv String key | |
| timestamp | back to summary |
|---|---|
| pack-priv long timestamp | |
| Entry | back to summary |
|---|---|
| pack-priv Entry(String k, C c, long timestamp) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| setTimestamp | back to summary |
|---|---|
| public void setTimestamp(long timestamp) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean |
| isSlatedForRemoval | back to summary |
|---|---|
| public boolean isSlatedForRemoval(AbstractComponentTracker. | |