- All Superinterfaces:
PropertyContainer
- All Known Implementing Classes:
ContextBase,LoggerContext
A context is the main anchorage point of all logback components.
- Author:
- Ceki Gulcu
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aConfigurationEventListenerto this context.voidaddScheduledFuture(ScheduledFuture<?> scheduledFuture) Add scheduledFuture parameter to the list of known futures.voidfireConfigurationEvent(ConfigurationEvent configurationEvent) FireConfigurationEventby invokingregistered listeners.default ExecutorServiceReturn an alternateExecutorServiceused for one task per thread execution.longThe time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).Object used for synchronization purposes.Get a copy of the property mapEvery context has an ExecutorService which be invoked to execute certain tasks in a separate thread.getName()Contexts are named objects.A Context can act as a store for various objects used by LOGBack components.getProperty(String key) Get the property of this context.Returns the ScheduledExecutorService for this context.Return the StatusManager instance in use.voidStore an object under 'key'.voidputProperty(String key, String value) Set a property of this context.voidRegister a component that participates in the context's life cycle.default voidRemove an existing ConfigurationEventListenervoidThe name of the context can be set only once.voidsetSequenceNumberGenerator(SequenceNumberGenerator sequenceNumberGenerator) Methods inherited from interface ch.qos.logback.core.spi.PropertyContainer
addSubstitutionProperties, addSubstitutionProperty
-
Method Details
-
getStatusManager
Return the StatusManager instance in use.- Returns:
- the
StatusManagerinstance in use.
-
getObject
-
putObject
-
getProperty
Get the property of this context.- Specified by:
getPropertyin interfacePropertyContainer
-
putProperty
Set a property of this context. -
getCopyOfPropertyMap
Get a copy of the property map- Specified by:
getCopyOfPropertyMapin interfacePropertyContainer- Returns:
- Since:
- 0.9.20
-
getName
-
setName
-
getBirthTime
long getBirthTime()The time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).- Returns:
- The time as measured when this class was created.
-
getConfigurationLock
Object used for synchronization purposes. INTENDED FOR INTERNAL USAGE. -
getScheduledExecutorService
Returns the ScheduledExecutorService for this context.- Returns:
- ScheduledExecutorService
- Since:
- 1.1.7
-
getExecutorService
Every context has an ExecutorService which be invoked to execute certain tasks in a separate thread.- Returns:
- the executor for this context.
- Since:
- 1.0.00 (undeprecated in 1.4.7)
-
getAlternateExecutorService
Return an alternateExecutorServiceused for one task per thread execution.- Returns:
- ExecutorService
-
register
-
addScheduledFuture
Add scheduledFuture parameter to the list of known futures.- Parameters:
scheduledFuture-
-
getSequenceNumberGenerator
-
setSequenceNumberGenerator
-
addConfigurationEventListener
Add aConfigurationEventListenerto this context.Configuration events are supposed to be rare and listeners to such events rarer still.
The propagation of
configuration eventsis intended for internal testing as well as some coordination between configurators.- Parameters:
listener-- Since:
- 1.3.6/1.4.6
-
removeConfigurationEventListener
Remove an existing ConfigurationEventListener- Parameters:
listener-- Since:
- 1.5.7
-
fireConfigurationEvent
FireConfigurationEventby invokingregistered listeners.Note that it is the role of configurators to invoke this method as a context does not necessarily know when it is being configured.
- Parameters:
configurationEvent-- Since:
- 1.3.6/1.4.6
-