org.x4juli.filter
Class AndFilter
java.lang.Object
org.x4juli.global.components.AbstractComponent
org.x4juli.global.components.AbstractFilter
org.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
| Fields inherited from class org.x4juli.global.components.AbstractFilter |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
headFilter
AbstractFilter headFilter
tailFilter
AbstractFilter tailFilter
acceptOnMatch
boolean acceptOnMatch
AndFilter
public AndFilter()
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}