| Constructor and Description |
|---|
ContextBase()
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBirthTime()
The time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).
|
Object |
getConfigurationLock()
Object used for synchronization purposes.
|
Map |
getCopyOfPropertyMap()
Get a copy of the property map
|
ExecutorService |
getExecutorService()
Every context has an ExecutorService which be invoked to execute certain tasks in a separate thread.
|
String |
getName()
Contexts are named objects.
|
Object |
getObject(String
A Context can act as a store for various objects used by LOGBack components.
|
String |
getProperty(String
Given a key, return the corresponding property value.
|
StatusManager |
getStatusManager()
Return the StatusManager instance in use.
|
boolean |
isStarted()
|
void |
putObject(String
Store an object under 'key'.
|
void |
putProperty(String
Set a property of this context.
|
void |
register(LifeCycle
Register a component that participates in the context's life cycle.
|
void |
removeObject(String
|
void |
reset()
Clear the internal objectMap and all properties.
|
void |
setName(String
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
Set the
StatusManager for this context.
|
void |
start()
|
void |
stop()
|
String |
toString()
|
public StatusManagergetStatusManager()
Context
getStatusManager in interface
Context
StatusManager instance in use.
public void setStatusManager(StatusManagerstatusManager)
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 manager
public Map<String ,String > getCopyOfPropertyMap()
Context
public void putProperty(Stringkey, String val)
Context
public StringgetProperty(String key)
getProperty in interface
Context
getProperty in interface
PropertyContainer
key -
public ObjectgetObject(String key)
Context
public void putObject(Stringkey, Object value)
Context
public void removeObject(Stringkey)
public StringgetName()
Context
public void start()
public void stop()
public boolean isStarted()
public void reset()
public void setName(Stringname) throws IllegalStateException
setName in interface
Context
IllegalStateException - if the context already has a name, other than "default".
public long getBirthTime()
Context
getBirthTime in interface
Context
public ObjectgetConfigurationLock()
Context
public ExecutorServicegetExecutorService()
Context
getExecutorService in interface
Context
public void register(LifeCyclecomponent)
Context
All components registered via this method will be stopped and removed from the context when the context is reset.
public StringtoString()