chapters.appenders.mail
Class CounterBasedEvaluator

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by chapters.appenders.mail.CounterBasedEvaluator
All Implemented Interfaces:
EventEvaluator, ContextAware, LifeCycle

public class CounterBasedEvaluator
extends ContextAwareBase
implements EventEvaluator

A simple EventEvaluator implementation that triggers email transmission after 1024 events regardless of event level.


Field Summary
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
CounterBasedEvaluator()
           
 
Method Summary
 boolean evaluate(Object event)
          Evaluates whether the event passed as parameter matches some user-specified criteria.
 String getName()
          Evaluators are named entities.
 boolean isStarted()
           
 void setName(String name)
          Evaluators are named entities.
 void start()
           
 void stop()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Constructor Detail

CounterBasedEvaluator

public CounterBasedEvaluator()
Method Detail

evaluate

public boolean evaluate(Object event)
                 throws NullPointerException,
                        EvaluationException
Description copied from interface: EventEvaluator
Evaluates whether the event passed as parameter matches some user-specified criteria.

The Evaluator is free to evaluate the event as it pleases. In particular, the evaluation results may depend on previous events.

Specified by:
evaluate in interface EventEvaluator
Parameters:
event - The event to evaluate
Returns:
true if there is a match, false otherwise.
Throws:
NullPointerException - can be thrown in presence of null values
EvaluationException - may be thrown during faulty evaluation

getName

public String getName()
Description copied from interface: EventEvaluator
Evaluators are named entities.

Specified by:
getName in interface EventEvaluator
Returns:
The name of this evaluator.

setName

public void setName(String name)
Description copied from interface: EventEvaluator
Evaluators are named entities.

Specified by:
setName in interface EventEvaluator

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle

start

public void start()
Specified by:
start in interface LifeCycle

stop

public void stop()
Specified by:
stop in interface LifeCycle


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