View Javadoc

1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 2000-2009, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.core.spi;
11  
12  import java.util.List;
13  
14  import ch.qos.logback.core.filter.Filter;
15  
16  /**
17   * Interface for attaching filters to objects.
18   * 
19   * @author Ceki Gülcü
20   */
21  public interface FilterAttachable<E> {
22    /**
23     * Add a filter.
24     */
25    public void addFilter(Filter<E> newFilter);
26  
27    /**
28     * Get first filter in the chain.
29     * 
30     * @deprecated This method will be removed in future versions. Please use
31     *             {@link #getCopyOfAttachedFiltersList()} method instead.
32     */
33    public Filter getFirstFilter();
34  
35    public void clearAllFilters();
36  
37    /**
38     * Get a copy of all the filters contained within this FilterAttachable
39     * object.
40     * 
41     * @return all attached filters as a list
42     */
43    public List<Filter<E>> getCopyOfAttachedFiltersList();
44  
45    /**
46     * Loop through the filters in the chain. As soon as a filter decides on
47     * ACCEPT or DENY, then that value is returned. If all of the filters return
48     * NEUTRAL, then NEUTRAL is returned.
49     */
50    public FilterReply getFilterChainDecision(E event);
51  }