ch.qos.logback.core
Interface Context

All Superinterfaces:
PropertyContainer
All Known Implementing Classes:
ContextBase

public interface Context
extends PropertyContainer

A context is the main anchorage point of all logback components.

Author:
Ceki Gulcu

Method Summary
 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<String,String> 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 key)
          A Context can act as a store for various objects used by LOGBack components.
 String getProperty(String key)
          Get the property of this context.
 StatusManager getStatusManager()
          Return the StatusManager instance in use.
 void putObject(String key, Object value)
          Store an object under 'key'.
 void putProperty(String key, String value)
          Set a property of this context.
 void register(LifeCycle component)
          Register a component that participates in the context's life cycle.
 void setName(String name)
          The name of the context can be set only once.
 

Method Detail

getStatusManager

StatusManager getStatusManager()
Return the StatusManager instance in use.

Returns:
the StatusManager instance in use.

getObject

Object getObject(String key)
A Context can act as a store for various objects used by LOGBack components.

Returns:
The object stored under 'key'.

putObject

void putObject(String key,
               Object value)
Store an object under 'key'. If no object can be found, null is returned.

Parameters:
key -
value -

getProperty

String getProperty(String key)
Get the property of this context.

Specified by:
getProperty in interface PropertyContainer

putProperty

void putProperty(String key,
                 String value)
Set a property of this context.


getCopyOfPropertyMap

Map<String,String> getCopyOfPropertyMap()
Get a copy of the property map

Specified by:
getCopyOfPropertyMap in interface PropertyContainer
Returns:
Since:
0.9.20

getName

String getName()
Contexts are named objects.

Returns:
the name for this context

setName

void setName(String name)
The name of the context can be set only once.

Parameters:
name -

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 getConfigurationLock()
Object used for synchronization purposes. INTENDED FOR INTERNAL USAGE.


getExecutorService

ExecutorService 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.0

register

void register(LifeCycle component)
Register 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.

Parameters:
component - the subject component


Copyright © 2005-2013 QOS.ch. All Rights Reserved.