Top Description Methods
ch.qos.logback.core

public Interface Context

extends PropertyContainer
Known Direct Implementers
ch.qos.logback.core.ContextBase
Imports
java.util.Map, java.util.concurrent.ExecutorService, .ScheduledExecutorService, .ScheduledFuture, .ThreadPoolExecutor, ch.qos.logback.core.spi.ConfigurationEvent, .ConfigurationEventListener, .LifeCycle, .PropertyContainer, .SequenceNumberGenerator, ch.qos.logback.core.status.StatusManager

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

Method Summary

Modifier and TypeMethod and Description
public void
public void
addScheduledFuture(ScheduledFuture<?> scheduledFuture)

Add scheduledFuture parameter to the list of known futures.

public void
public default ExecutorService

Returns:

ExecutorService
getAlternateExecutorService
()

Return an alternate ExecutorService used for one task per thread execution.

public long

Returns:

The time as measured when this class was created.
getBirthTime
()

The time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).

public Object
getConfigurationLock()

Object used for synchronization purposes.

public Map<String, String>
public ExecutorService

Returns:

the executor for this context.
getExecutorService
()

Every context has an ExecutorService which be invoked to execute certain tasks in a separate thread.

public String

Returns:

the name for this context
getName
()

Contexts are named objects.

public Object

Returns:

The object stored under 'key'.
getObject
(String key)

A Context can act as a store for various objects used by LOGBack components.

public String
getProperty(String key)

Redeclares ch.qos.logback.core.spi.PropertyContainer.getProperty.

Get the property of this context.
public ScheduledExecutorService

Returns:

ScheduledExecutorService
getScheduledExecutorService
()

Returns the ScheduledExecutorService for this context.

public SequenceNumberGenerator
public StatusManager

Returns:

the StatusManager instance in use.
getStatusManager
()

Return the StatusManager instance in use.

public void
putObject(String key, Object value)

Store an object under 'key'.

public void
putProperty(String key, String value)

Set a property of this context.

public void
register(LifeCycle
the subject component
component
)

Register a component that participates in the context's life cycle.

public void
setName(String name)

The name of the context can be set only once.

public void
Inherited from ch.qos.logback.core.spi.PropertyContainer:
addSubstitutionPropertiesaddSubstitutionProperty

Method Detail

addConfigurationEventListenerback to summary
public void addConfigurationEventListener(ConfigurationEventListener listener)

Add a ConfigurationEventListener to this context.

Configuration events are supposed to be rare and listeners to such events rarer still.

The propagation of configuration events is intended for internal testing as well as some coordination between configurators.

Since
1.3.6/1.4.6
addScheduledFutureback to summary
public void addScheduledFuture(ScheduledFuture<?> scheduledFuture)

Add scheduledFuture parameter to the list of known futures.

fireConfigurationEventback to summary
public void fireConfigurationEvent(ConfigurationEvent configurationEvent)

Fire ConfigurationEvent by invoking registered listeners.

Note that it is the role of configurators to invoke this method as a context does not necessarily know when it is being configured.

Since
1.3.6/1.4.6
getAlternateExecutorServiceback to summary
public default ExecutorService getAlternateExecutorService()

Return an alternate ExecutorService used for one task per thread execution.

Returns:ExecutorService

ExecutorService

getBirthTimeback to summary
public long getBirthTime()

The time at which this context was created, expressed in millisecond elapsed since the epoch (1.1.1970).

Returns:long

The time as measured when this class was created.

getConfigurationLockback to summary
public Object getConfigurationLock()

Object used for synchronization purposes. INTENDED FOR INTERNAL USAGE.

getCopyOfPropertyMapback to summary
public Map<String, String> getCopyOfPropertyMap()

Redeclares ch.qos.logback.core.spi.PropertyContainer.getCopyOfPropertyMap.

Get a copy of the property map

Since
0.9.20
getExecutorServiceback to summary
public ExecutorService getExecutorService()

Every context has an ExecutorService which be invoked to execute certain tasks in a separate thread.

Returns:ExecutorService

the executor for this context.

Since
1.0.00 (undeprecated in 1.4.7)
getNameback to summary
public String getName()

Contexts are named objects.

Returns:String

the name for this context

getObjectback to summary
public Object getObject(String key)

A Context can act as a store for various objects used by LOGBack components.

Returns:Object

The object stored under 'key'.

getPropertyback to summary
public String getProperty(String key)

Redeclares ch.qos.logback.core.spi.PropertyContainer.getProperty.

Get the property of this context.

getScheduledExecutorServiceback to summary
public ScheduledExecutorService getScheduledExecutorService()

Returns the ScheduledExecutorService for this context.

Returns:ScheduledExecutorService

ScheduledExecutorService

Since
1.1.7
getSequenceNumberGeneratorback to summary
public SequenceNumberGenerator getSequenceNumberGenerator()
getStatusManagerback to summary
public StatusManager getStatusManager()

Return the StatusManager instance in use.

Returns:StatusManager

the StatusManager instance in use.

putObjectback to summary
public void putObject(String key, Object value)

Store an object under 'key'. If no object can be found, null is returned.

putPropertyback to summary
public void putProperty(String key, String value)

Set a property of this context.

registerback to summary
public 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:LifeCycle

the subject component

setNameback to summary
public void setName(String name)

The name of the context can be set only once.

setSequenceNumberGeneratorback to summary
public void setSequenceNumberGenerator(SequenceNumberGenerator sequenceNumberGenerator)