ch.qos.logback.access.spi
Class AccessContext

java.lang.Object
  extended by ch.qos.logback.core.ContextBase
      extended by ch.qos.logback.access.spi.AccessContext
All Implemented Interfaces:
Context, AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent>, PropertyContainer

public class AccessContext
extends ContextBase
implements AppenderAttachable<AccessEvent>, FilterAttachable<AccessEvent>

A minimal context implementation used by certain logback-access components, mainly SocketServer.

Author:
Sébastien Pennec

Constructor Summary
AccessContext()
           
 
Method Summary
 void addAppender(Appender<AccessEvent> newAppender)
          Add an appender.
 void addFilter(Filter<AccessEvent> newFilter)
          Add a filter.
 void callAppenders(AccessEvent event)
           
 void clearAllFilters()
           
 void detachAndStopAllAppenders()
          Detach and stop all previously added appenders.
 boolean detachAppender(Appender<AccessEvent> appender)
          Detach the appender passed as parameter from the list of appenders.
 boolean detachAppender(java.lang.String name)
          Detach the appender with the name passed as parameter from the list of appenders.
 Appender<AccessEvent> getAppender(java.lang.String name)
          Get an appender by name.
 java.util.List<Filter<AccessEvent>> getCopyOfAttachedFiltersList()
          Get a copy of all the filters contained within this FilterAttachable object.
 FilterReply getFilterChainDecision(AccessEvent event)
          Loop through the filters in the chain.
 Filter<AccessEvent> getFirstFilter()
          Get first filter in the chain.
 boolean isAttached(Appender<AccessEvent> appender)
          Returns true if the specified appender is in list of attached attached, false otherwise.
 java.util.Iterator<Appender<AccessEvent>> iteratorForAppenders()
          Get an iterator for appenders contained in the parent object.
 
Methods inherited from class ch.qos.logback.core.ContextBase
getBithTime, getConfigurationLock, getCopyOfPropertyMap, getName, getObject, getProperty, getStatusManager, putObject, putProperty, reset, setName, setStatusManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessContext

public AccessContext()
Method Detail

callAppenders

public void callAppenders(AccessEvent event)

addAppender

public void addAppender(Appender<AccessEvent> newAppender)
Description copied from interface: AppenderAttachable
Add an appender.

Specified by:
addAppender in interface AppenderAttachable<AccessEvent>

detachAndStopAllAppenders

public void detachAndStopAllAppenders()
Description copied from interface: AppenderAttachable
Detach and stop all previously added appenders.

Specified by:
detachAndStopAllAppenders in interface AppenderAttachable<AccessEvent>

detachAppender

public boolean detachAppender(Appender<AccessEvent> appender)
Description copied from interface: AppenderAttachable
Detach the appender passed as parameter from the list of appenders.

Specified by:
detachAppender in interface AppenderAttachable<AccessEvent>

detachAppender

public boolean detachAppender(java.lang.String name)
Description copied from interface: AppenderAttachable
Detach the appender with the name passed as parameter from the list of appenders.

Specified by:
detachAppender in interface AppenderAttachable<AccessEvent>

getAppender

public Appender<AccessEvent> getAppender(java.lang.String name)
Description copied from interface: AppenderAttachable
Get an appender by name.

Specified by:
getAppender in interface AppenderAttachable<AccessEvent>

isAttached

public boolean isAttached(Appender<AccessEvent> appender)
Description copied from interface: AppenderAttachable
Returns true if the specified appender is in list of attached attached, false otherwise.

Specified by:
isAttached in interface AppenderAttachable<AccessEvent>

iteratorForAppenders

public java.util.Iterator<Appender<AccessEvent>> iteratorForAppenders()
Description copied from interface: AppenderAttachable
Get an iterator for appenders contained in the parent object.

Specified by:
iteratorForAppenders in interface AppenderAttachable<AccessEvent>

addFilter

public void addFilter(Filter<AccessEvent> newFilter)
Description copied from interface: FilterAttachable
Add a filter.

Specified by:
addFilter in interface FilterAttachable<AccessEvent>

clearAllFilters

public void clearAllFilters()
Specified by:
clearAllFilters in interface FilterAttachable<AccessEvent>

getCopyOfAttachedFiltersList

public java.util.List<Filter<AccessEvent>> getCopyOfAttachedFiltersList()
Description copied from interface: FilterAttachable
Get a copy of all the filters contained within this FilterAttachable object.

Specified by:
getCopyOfAttachedFiltersList in interface FilterAttachable<AccessEvent>
Returns:
all attached filters as a list

getFilterChainDecision

public FilterReply getFilterChainDecision(AccessEvent event)
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 interface FilterAttachable<AccessEvent>

getFirstFilter

public Filter<AccessEvent> getFirstFilter()
Description copied from interface: FilterAttachable
Get first filter in the chain.

Specified by:
getFirstFilter in interface FilterAttachable<AccessEvent>


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