Package ch.qos.logback.core
Class ContextBase
java.lang.Object
ch.qos.logback.core.ContextBase
- All Implemented Interfaces:
Context,LifeCycle,PropertyContainer
- Direct Known Subclasses:
LoggerContext
@Deprecated(since="2022-01-27")
public class ContextBase
extends Object
implements Context, LifeCycle
Deprecated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScheduledFuture(ScheduledFuture<?> scheduledFuture) Deprecated.longDeprecated.The time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).Deprecated.Object used for synchronization purposes.Deprecated.Get a copy of the property mapDeprecated.Every context has an ExecutorService which be invoked to execute certain tasks in a separate thread.getName()Deprecated.Contexts are named objects.Deprecated.A Context can act as a store for various objects used by LOGBack components.getProperty(String key) Deprecated.Given a key, return the corresponding property value.Deprecated.Returns the ScheduledExecutorService for this context.List<ScheduledFuture<?>> Deprecated.Deprecated.Return the StatusManager instance in use.booleanDeprecated.voidDeprecated.Store an object under 'key'.voidputProperty(String key, String val) Deprecated.Set a property of this context.voidDeprecated.Register a component that participates in the context's life cycle.voidremoveObject(String key) Deprecated.voidreset()Deprecated.Clear the internal objectMap and all properties.voidDeprecated.The context name can be set only if it is not already set, or if the current name is the default context name, namely "default", or if the current name and the old name are the same.voidsetStatusManager(StatusManager statusManager) Deprecated.Set theStatusManagerfor this context.voidstart()Deprecated.voidstop()Deprecated.toString()Deprecated.
-
Constructor Details
-
ContextBase
public ContextBase()Deprecated.
-
-
Method Details
-
getStatusManager
Deprecated.Description copied from interface:ContextReturn the StatusManager instance in use.- Specified by:
getStatusManagerin interfaceContext- Returns:
- the
StatusManagerinstance in use.
-
setStatusManager
Deprecated.Set theStatusManagerfor this context. Note that by default this context is initialized with aBasicStatusManager. A null value for the 'statusManager' argument is not allowed.A malicious attacker can set the status manager to a dummy instance, disabling internal error reporting.
- Parameters:
statusManager- the new status manager
-
getCopyOfPropertyMap
Deprecated.Description copied from interface:ContextGet a copy of the property map- Specified by:
getCopyOfPropertyMapin interfaceContext- Specified by:
getCopyOfPropertyMapin interfacePropertyContainer- Returns:
-
putProperty
Deprecated.Description copied from interface:ContextSet a property of this context.- Specified by:
putPropertyin interfaceContext
-
getProperty
Deprecated.Given a key, return the corresponding property value. If invoked with the special key "CONTEXT_NAME", the name of the context is returned.- Specified by:
getPropertyin interfaceContext- Specified by:
getPropertyin interfacePropertyContainer- Parameters:
key-- Returns:
-
getObject
Deprecated.Description copied from interface:ContextA Context can act as a store for various objects used by LOGBack components. -
putObject
Deprecated.Description copied from interface:ContextStore an object under 'key'. If no object can be found, null is returned. -
removeObject
Deprecated. -
getName
Deprecated.Description copied from interface:ContextContexts are named objects. -
start
public void start()Deprecated. -
stop
public void stop()Deprecated. -
isStarted
public boolean isStarted()Deprecated. -
reset
public void reset()Deprecated.Clear the internal objectMap and all properties. Removes registered shutdown hook -
setName
Deprecated.The context name can be set only if it is not already set, or if the current name is the default context name, namely "default", or if the current name and the old name are the same.- Specified by:
setNamein interfaceContext- Parameters:
name-- Throws:
IllegalStateException- if the context already has a name, other than "default".
-
getBirthTime
public long getBirthTime()Deprecated.Description copied from interface:ContextThe time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).- Specified by:
getBirthTimein interfaceContext- Returns:
- The time as measured when this class was created.
-
getConfigurationLock
Deprecated.Description copied from interface:ContextObject used for synchronization purposes. INTENDED FOR INTERNAL USAGE.- Specified by:
getConfigurationLockin interfaceContext
-
getExecutorService
Deprecated.Description copied from interface:ContextEvery context has an ExecutorService which be invoked to execute certain tasks in a separate thread.- Specified by:
getExecutorServicein interfaceContext- Returns:
- the executor for this context.
-
getScheduledExecutorService
Deprecated.Description copied from interface:ContextReturns the ScheduledExecutorService for this context.- Specified by:
getScheduledExecutorServicein interfaceContext- Returns:
-
register
Deprecated.Description copied from interface:ContextRegister a component that participates in the context's life cycle.All components registered via this method will be stopped and removed from the context when the context is reset.
-
toString
Deprecated. -
addScheduledFuture
Deprecated.- Specified by:
addScheduledFuturein interfaceContext
-
getScheduledFutures
Deprecated.
-