Package ch.qos.logback.core.spi
Interface ComponentTracker<C>
-
- All Known Implementing Classes:
AbstractComponentTracker
,AppenderTracker
,CyclicBufferTracker
@Deprecated(since="2022-01-27") public interface ComponentTracker<C>
Deprecated.This internal logback API is not supported by AEM as a Cloud Service.Interface for tracking various components by key. Components which have not been accessed for more than a user-specified duration are deemed stale and removed. Components can also be explicitly marked as having reached theirendOfLife(String)
in which case they will linger for a few seconds and then be removed.- Since:
- 1.0.12
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_COMPONENTS
Deprecated.By default an unlimited number of elements can be tracked.static int
DEFAULT_TIMEOUT
Deprecated.The default timeout duration is 30 minutes
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.Collection<C>
allComponents()
Deprecated.Returns the collection of all components tracked by this instance.java.util.Set<java.lang.String>
allKeys()
Deprecated.Set of all keys in this tracker in no particular order.void
endOfLife(java.lang.String key)
Deprecated.Mark component identified by 'key' as having reached its end-of-life.C
find(java.lang.String key)
Deprecated.Find the component identified by 'key', without updating the timestamp.int
getComponentCount()
Deprecated.Returns the number of components tracked.C
getOrCreate(java.lang.String key, long timestamp)
Deprecated.Get the component identified by 'key', updating its timestamp in the process.void
removeStaleComponents(long now)
Deprecated.Remove components which are deemed stale.
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
static final int DEFAULT_TIMEOUT
Deprecated.The default timeout duration is 30 minutes- See Also:
- Constant Field Values
-
DEFAULT_MAX_COMPONENTS
static final int DEFAULT_MAX_COMPONENTS
Deprecated.By default an unlimited number of elements can be tracked.- See Also:
- Constant Field Values
-
-
Method Detail
-
getComponentCount
int getComponentCount()
Deprecated.Returns the number of components tracked.- Returns:
- number of components
-
find
C find(java.lang.String key)
Deprecated.Find the component identified by 'key', without updating the timestamp. Returns null if no corresponding component could be found.- Parameters:
key
-- Returns:
- corresponding component, may be null
-
getOrCreate
C getOrCreate(java.lang.String key, long timestamp)
Deprecated.Get the component identified by 'key', updating its timestamp in the process. If the corresponding component could not be found, it is created.- Parameters:
key
-timestamp
-- Returns:
-
removeStaleComponents
void removeStaleComponents(long now)
Deprecated.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,
getComponentCount()
, components in excess will be removed.Depending on the component type, components will be cleared or stopped (as appropriate) right before removal.
- Parameters:
now
- current time in milliseconds
-
endOfLife
void endOfLife(java.lang.String key)
Deprecated.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.- Parameters:
key
-
-
allComponents
java.util.Collection<C> allComponents()
Deprecated.Returns the collection of all components tracked by this instance.- Returns:
- collection of components
-
allKeys
java.util.Set<java.lang.String> allKeys()
Deprecated.Set of all keys in this tracker in no particular order.- Returns:
-
-