org.x4juli.filter
Class AndFilter

java.lang.Object
  extended byorg.x4juli.global.components.AbstractComponent
      extended byorg.x4juli.global.components.AbstractFilter
          extended byorg.x4juli.filter.AndFilter
All Implemented Interfaces:
Component, ExtendedFilter, java.util.logging.Filter, OptionHandler

public class AndFilter
extends AbstractFilter

A filter that 'and's the results of any number of contained filters together. For the filter to process events, all contained filters must return Filter.ACCEPT. If the contained filters do not return ExtendedFilter.X4JULI_ACCEPT, ExtendedFilter.X4JULI_NEUTRAL is returned. If acceptOnMatch is set to true, ExtendedFilter.X4JULI_ACCEPT is returned. If acceptOnMatch is set to false, @link ExtendedFilter#X4JULI_DENY} is returned.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Scott Deboy. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
(package private)  boolean acceptOnMatch
           
(package private)  AbstractFilter headFilter
           
(package private)  AbstractFilter tailFilter
           
 
Fields inherited from class org.x4juli.global.components.AbstractFilter
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Fields inherited from interface org.x4juli.global.spi.ExtendedFilter
ACCEPT, DENY, X4JULI_ACCEPT, X4JULI_DENY, X4JULI_NEUTRAL
 
Constructor Summary
AndFilter()
           
 
Method Summary
 void addFilter(AbstractFilter filter)
           
 int decide(ExtendedLogRecord record)
           If the decision is DENY, then the event will be dropped.
 boolean getAcceptOnMatch()
           
 void setAcceptOnMatch(boolean acceptOnMatch)
           
 
Methods inherited from class org.x4juli.global.components.AbstractFilter
activateOptions, getNext, isLoggable, setNext
 
Methods inherited from class org.x4juli.global.components.AbstractComponent
getLogger, getLoggerRepository, getMessageProperties, getNonFloodingLogger, getProperty, getProperty, getProperty, getProperty, resetErrorCount, setObjectStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headFilter

AbstractFilter headFilter

tailFilter

AbstractFilter tailFilter

acceptOnMatch

boolean acceptOnMatch
Constructor Detail

AndFilter

public AndFilter()
Method Detail

decide

public int decide(ExtendedLogRecord record)
Description copied from class: AbstractFilter

If the decision is DENY, then the event will be dropped. If the decision is NEUTRAL, then the next filter, if any, will be invoked. If the decision is ACCEPT then the event will be logged without consulting with other filters in the chain.

Specified by:
decide in interface ExtendedFilter
Specified by:
decide in class AbstractFilter
Parameters:
record - The LoggingEvent to decide upon.
Since:
0.5
See Also:
AbstractFilter.decide(org.x4juli.global.spi.ExtendedLogRecord)

addFilter

public void addFilter(AbstractFilter filter)
Parameters:
filter - to add
Since:
0.5

setAcceptOnMatch

public void setAcceptOnMatch(boolean acceptOnMatch)
Parameters:
acceptOnMatch - whether to accept or not
Since:
0.5

getAcceptOnMatch

public boolean getAcceptOnMatch()
Returns:
whether matches or not
Since:
0.5


${license_html}