1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.access.spi;
15
16 import java.util.Iterator;
17 import java.util.List;
18
19 import ch.qos.logback.core.Appender;
20 import ch.qos.logback.core.ContextBase;
21 import ch.qos.logback.core.filter.Filter;
22 import ch.qos.logback.core.spi.AppenderAttachable;
23 import ch.qos.logback.core.spi.AppenderAttachableImpl;
24 import ch.qos.logback.core.spi.FilterAttachable;
25 import ch.qos.logback.core.spi.FilterAttachableImpl;
26 import ch.qos.logback.core.spi.FilterReply;
27
28
29
30
31
32
33
34 public class AccessContext extends ContextBase implements
35 AppenderAttachable<IAccessEvent>, FilterAttachable<IAccessEvent> {
36
37 AppenderAttachableImpl<IAccessEvent> aai = new AppenderAttachableImpl<IAccessEvent>();
38 FilterAttachableImpl<IAccessEvent> fai = new FilterAttachableImpl<IAccessEvent>();
39
40 public void callAppenders(IAccessEvent event) {
41 aai.appendLoopOnAppenders(event);
42 }
43
44 public void addAppender(Appender<IAccessEvent> newAppender) {
45 aai.addAppender(newAppender);
46 }
47
48 public void detachAndStopAllAppenders() {
49 aai.detachAndStopAllAppenders();
50 }
51
52 public boolean detachAppender(Appender<IAccessEvent> appender) {
53 return aai.detachAppender(appender);
54 }
55
56 public boolean detachAppender(String name) {
57 return aai.detachAppender(name);
58 }
59
60 public Appender<IAccessEvent> getAppender(String name) {
61 return aai.getAppender(name);
62 }
63
64 public boolean isAttached(Appender<IAccessEvent> appender) {
65 return aai.isAttached(appender);
66 }
67
68 public Iterator<Appender<IAccessEvent>> iteratorForAppenders() {
69 return aai.iteratorForAppenders();
70 }
71
72 public void addFilter(Filter<IAccessEvent> newFilter) {
73 fai.addFilter(newFilter);
74 }
75
76 public void clearAllFilters() {
77 fai.clearAllFilters();
78 }
79
80 public List<Filter<IAccessEvent>> getCopyOfAttachedFiltersList() {
81 return fai.getCopyOfAttachedFiltersList();
82 }
83
84 public FilterReply getFilterChainDecision(IAccessEvent event) {
85 return fai.getFilterChainDecision(event);
86 }
87 }