|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.qos.logback.core.spi.AbstractComponentTracker<C>
C - component typepublic abstract class AbstractComponentTracker<C>
An abstract implementation of the ComponentTracker interface. Derived classes must implement
buildComponent(String), processPriorToRemoval(Object), and isComponentStale(Object)
methods as appropriate for their component type.
| Field Summary | |
|---|---|
static long |
LINGERING_TIMEOUT
|
protected int |
maxComponents
|
protected long |
timeout
|
static long |
WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS
The minimum amount of time that has to elapse between successive removal iterations. |
| Fields inherited from interface ch.qos.logback.core.spi.ComponentTracker |
|---|
DEFAULT_MAX_COMPONENTS, DEFAULT_TIMEOUT |
| Constructor Summary | |
|---|---|
AbstractComponentTracker()
|
|
| Method Summary | |
|---|---|
Collection<C> |
allComponents()
Returns the collection of all components tracked by this instance. |
Set<String> |
allKeys()
Set of all keys in this tracker in no particular order. |
protected abstract C |
buildComponent(String key)
Build a component based on the key. |
void |
endOfLife(String key)
Mark component identified by 'key' as having reached its end-of-life. |
C |
find(String key)
Find the component identified by 'key', without updating the timestamp. |
int |
getComponentCount()
Returns the number of components tracked. |
int |
getMaxComponents()
|
C |
getOrCreate(String key,
long timestamp)
Get the component identified by 'key', updating its timestamp in the process. |
long |
getTimeout()
|
protected abstract boolean |
isComponentStale(C c)
Components can declare themselves stale. |
protected abstract void |
processPriorToRemoval(C component)
Stop or clean the component. |
void |
removeStaleComponents(long now)
Clear (and detach) components which are stale. |
void |
setMaxComponents(int maxComponents)
|
void |
setTimeout(long timeout)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long LINGERING_TIMEOUT
public static final long WAIT_BETWEEN_SUCCESSIVE_REMOVAL_ITERATIONS
protected int maxComponents
protected long timeout
| Constructor Detail |
|---|
public AbstractComponentTracker()
| Method Detail |
|---|
protected abstract void processPriorToRemoval(C component)
component - protected abstract C buildComponent(String key)
key -
protected abstract boolean isComponentStale(C c)
c -
public int getComponentCount()
ComponentTracker
getComponentCount in interface ComponentTracker<C>public C find(String key)
Note that this method is synchronized.
find in interface ComponentTracker<C>key -
public C getOrCreate(String key,
long timestamp)
Note that this method is atomic, i.e. synchronized.
getOrCreate in interface ComponentTracker<C>key - timestamp -
public void endOfLife(String key)
endOfLife in interface ComponentTracker<C>key - public void removeStaleComponents(long now)
removeStaleComponents in interface ComponentTracker<C>now - public Set<String> allKeys()
ComponentTracker
allKeys in interface ComponentTracker<C>public 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||