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()
Context
getStatusManager
in interface Context
StatusManager
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()
Context
getCopyOfPropertyMap
in interface Context
getCopyOfPropertyMap
in interface PropertyContainer
public void putProperty(java.lang.String key, java.lang.String val)
Context
putProperty
in interface Context
public java.lang.String getProperty(java.lang.String key)
getProperty
in interface Context
getProperty
in interface PropertyContainer
key
- public java.lang.Object getObject(java.lang.String key)
Context
public void putObject(java.lang.String key, java.lang.Object value)
Context
public void removeObject(java.lang.String key)
public java.lang.String getName()
Context
public void reset()
public void setName(java.lang.String name) throws java.lang.IllegalStateException
public long getBirthTime()
Context
getBirthTime
in interface Context
public java.lang.Object getConfigurationLock()
Context
getConfigurationLock
in interface Context
public java.util.concurrent.ExecutorService getExecutorService()
Context
getExecutorService
in interface Context
public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
Context
getScheduledExecutorService
in interface Context
public void register(LifeCycle component)
Context
All 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.Object
public void addScheduledFuture(java.util.concurrent.ScheduledFuture<?> scheduledFuture)
addScheduledFuture
in interface Context
public java.util.List<java.util.concurrent.ScheduledFuture<?>> getScheduledFutures()
Copyright © 2010 - 2020 Adobe. All Rights Reserved