public class ContextBase extends java.lang.Object implements Context, LifeCycle
| Constructor and Description |
|---|
ContextBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
addScheduledFuture(java.util.concurrent.ScheduledFuture<?> scheduledFuture) |
long |
getBirthTime()
The time at which this context was created, expressed in
millisecond elapsed since the epoch (1.1.1970).
|
java.lang.Object |
getConfigurationLock()
Object used for synchronization purposes.
|
java.util.Map<java.lang.String,java.lang.String> |
getCopyOfPropertyMap()
Get a copy of the property map
|
java.util.concurrent.ExecutorService |
getExecutorService()
Every context has an ExecutorService which be invoked to execute certain
tasks in a separate thread.
|
java.lang.String |
getName()
Contexts are named objects.
|
java.lang.Object |
getObject(java.lang.String key)
A Context can act as a store for various objects used by LOGBack
components.
|
java.lang.String |
getProperty(java.lang.String key)
Given a key, return the corresponding property value.
|
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutorService()
Returns the ScheduledExecutorService for this context.
|
java.util.List<java.util.concurrent.ScheduledFuture<?>> |
getScheduledFutures() |
StatusManager |
getStatusManager()
Return the StatusManager instance in use.
|
boolean |
isStarted() |
void |
putObject(java.lang.String key,
java.lang.Object value)
Store an object under 'key'.
|
void |
putProperty(java.lang.String key,
java.lang.String val)
Set a property of this context.
|
void |
register(LifeCycle component)
Register a component that participates in the context's life cycle.
|
void |
removeObject(java.lang.String key) |
void |
reset()
Clear the internal objectMap and all properties.
|
void |
setName(java.lang.String name)
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.
|
void |
setStatusManager(StatusManager statusManager)
Set the
StatusManager for this context. |
void |
start() |
void |
stop() |
java.lang.String |
toString() |
public StatusManager getStatusManager()
ContextgetStatusManager in interface ContextStatusManager instance in use.public void setStatusManager(StatusManager statusManager)
StatusManager for this context. Note that by default this
context is initialized with a BasicStatusManager. 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.
statusManager - the new status managerpublic java.util.Map<java.lang.String,java.lang.String> getCopyOfPropertyMap()
ContextgetCopyOfPropertyMap in interface ContextgetCopyOfPropertyMap in interface PropertyContainerpublic void putProperty(java.lang.String key,
java.lang.String val)
ContextputProperty in interface Contextpublic java.lang.String getProperty(java.lang.String key)
getProperty in interface ContextgetProperty in interface PropertyContainerkey - public java.lang.Object getObject(java.lang.String key)
Contextpublic void putObject(java.lang.String key,
java.lang.Object value)
Contextpublic void removeObject(java.lang.String key)
public java.lang.String getName()
Contextpublic void reset()
public void setName(java.lang.String name)
throws java.lang.IllegalStateException
public long getBirthTime()
ContextgetBirthTime in interface Contextpublic java.lang.Object getConfigurationLock()
ContextgetConfigurationLock in interface Contextpublic java.util.concurrent.ExecutorService getExecutorService()
ContextgetExecutorService in interface Contextpublic java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
ContextgetScheduledExecutorService in interface Contextpublic void register(LifeCycle component)
ContextAll components registered via this method will be stopped and removed from the context when the context is reset.
public java.lang.String toString()
toString in class java.lang.Objectpublic void addScheduledFuture(java.util.concurrent.ScheduledFuture<?> scheduledFuture)
addScheduledFuture in interface Contextpublic java.util.List<java.util.concurrent.ScheduledFuture<?>> getScheduledFutures()
Copyright © 2010 - 2023 Adobe. All Rights Reserved