Package ch.qos.logback.access.spi
Class AccessContext
java.lang.Object
ch.qos.logback.core.ContextBase
ch.qos.logback.access.spi.AccessContext
- All Implemented Interfaces:
Context
,AppenderAttachable<IAccessEvent>
,FilterAttachable<IAccessEvent>
,LifeCycle
,PropertyContainer
public class AccessContext
extends ContextBase
implements AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent>
A minimal context implementation used by certain logback-access components,
mainly SocketServer.
- Author:
- Sébastien Pennec
-
Field Summary
Fields inherited from class ch.qos.logback.core.ContextBase
scheduledFutures
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAppender
(Appender<IAccessEvent> newAppender) Add an appender.void
addFilter
(Filter<IAccessEvent> newFilter) Add a filter.void
callAppenders
(IAccessEvent event) void
void
Detach and processPriorToRemoval all previously added appenders.boolean
detachAppender
(Appender<IAccessEvent> appender) Detach the appender passed as parameter from the list of appenders.boolean
detachAppender
(String name) Detach the appender with the name passed as parameter from the list of appenders.getAppender
(String name) Get an appender by name.Get a copy of all the filters contained within this FilterAttachable object.Loop through the filters in the chain.boolean
isAttached
(Appender<IAccessEvent> appender) Returnstrue
if the specified appender is in list of attached,false
otherwise.Get an iterator for appenders contained in the parent object.Methods inherited from class ch.qos.logback.core.ContextBase
addScheduledFuture, getBirthTime, getConfigurationLock, getCopyOfPropertyMap, getCopyOfScheduledFutures, getExecutorService, getName, getObject, getProperty, getScheduledExecutorService, getScheduledFutures, getSequenceNumberGenerator, getStatusManager, initCollisionMaps, isStarted, putObject, putProperty, register, removeObject, reset, setName, setSequenceNumberGenerator, setStatusManager, start, stop, toString
-
Constructor Details
-
AccessContext
public AccessContext()
-
-
Method Details
-
callAppenders
-
addAppender
Description copied from interface:AppenderAttachable
Add an appender.- Specified by:
addAppender
in interfaceAppenderAttachable<IAccessEvent>
-
detachAndStopAllAppenders
Description copied from interface:AppenderAttachable
Detach and processPriorToRemoval all previously added appenders.- Specified by:
detachAndStopAllAppenders
in interfaceAppenderAttachable<IAccessEvent>
-
detachAppender
Description copied from interface:AppenderAttachable
Detach the appender passed as parameter from the list of appenders.- Specified by:
detachAppender
in interfaceAppenderAttachable<IAccessEvent>
-
detachAppender
Description copied from interface:AppenderAttachable
Detach the appender with the name passed as parameter from the list of appenders.- Specified by:
detachAppender
in interfaceAppenderAttachable<IAccessEvent>
-
getAppender
Description copied from interface:AppenderAttachable
Get an appender by name.- Specified by:
getAppender
in interfaceAppenderAttachable<IAccessEvent>
-
isAttached
Description copied from interface:AppenderAttachable
Returnstrue
if the specified appender is in list of attached,false
otherwise.- Specified by:
isAttached
in interfaceAppenderAttachable<IAccessEvent>
-
iteratorForAppenders
Description copied from interface:AppenderAttachable
Get an iterator for appenders contained in the parent object.- Specified by:
iteratorForAppenders
in interfaceAppenderAttachable<IAccessEvent>
-
addFilter
Description copied from interface:FilterAttachable
Add a filter.- Specified by:
addFilter
in interfaceFilterAttachable<IAccessEvent>
-
clearAllFilters
- Specified by:
clearAllFilters
in interfaceFilterAttachable<IAccessEvent>
-
getCopyOfAttachedFiltersList
Description copied from interface:FilterAttachable
Get a copy of all the filters contained within this FilterAttachable object.- Specified by:
getCopyOfAttachedFiltersList
in interfaceFilterAttachable<IAccessEvent>
- Returns:
- all attached filters as a list
-
getFilterChainDecision
Description copied from interface:FilterAttachable
Loop through the filters in the chain. As soon as a filter decides on ACCEPT or DENY, then that value is returned. If all of the filters return NEUTRAL, then NEUTRAL is returned.- Specified by:
getFilterChainDecision
in interfaceFilterAttachable<IAccessEvent>
-