C
- component typepublic abstract class AbstractComponentTracker<C> extends java.lang.Object implements ComponentTracker<C>
buildComponent(String)
, processPriorToRemoval(Object)
, and isComponentStale(Object)
methods as appropriate for their component type.Modifier and Type | Field and Description |
---|---|
static long |
LINGERING_TIMEOUT |
static long |
WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS
The minimum amount of time that has to elapse between successive removal iterations.
|
DEFAULT_MAX_COMPONENTS, DEFAULT_TIMEOUT
Constructor and Description |
---|
AbstractComponentTracker() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<C> |
allComponents()
Returns the collection of all components tracked by this instance.
|
java.util.Set<java.lang.String> |
allKeys()
Set of all keys in this tracker in no particular order.
|
void |
endOfLife(java.lang.String key)
Mark component identified by 'key' as having reached its end-of-life.
|
C |
find(java.lang.String key)
Find the component identified by 'key', without updating the timestamp.
|
int |
getComponentCount()
Returns the number of components tracked.
|
int |
getMaxComponents() |
C |
getOrCreate(java.lang.String key,
long timestamp)
Get the component identified by 'key', updating its timestamp in the
process.
|
long |
getTimeout() |
void |
removeStaleComponents(long now)
Clear (and detach) components which are stale.
|
void |
setMaxComponents(int maxComponents) |
void |
setTimeout(long timeout) |
public static final long LINGERING_TIMEOUT
public static final long WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS
public int getComponentCount()
ComponentTracker
getComponentCount
in interface ComponentTracker<C>
public C find(java.lang.String key)
Note that this method is synchronized.
find
in interface ComponentTracker<C>
key
- public C getOrCreate(java.lang.String key, long timestamp)
Note that this method is atomic, i.e. synchronized.
getOrCreate
in interface ComponentTracker<C>
key
- timestamp
- public void endOfLife(java.lang.String key)
endOfLife
in interface ComponentTracker<C>
key
- public void removeStaleComponents(long now)
removeStaleComponents
in interface ComponentTracker<C>
now
- public java.util.Set<java.lang.String> allKeys()
ComponentTracker
allKeys
in interface ComponentTracker<C>
public java.util.Collection<C> allComponents()
ComponentTracker
allComponents
in interface ComponentTracker<C>
public long getTimeout()
public void setTimeout(long timeout)
public int getMaxComponents()
public void setMaxComponents(int maxComponents)
Copyright © 2010 - 2020 Adobe. All Rights Reserved