1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.annotations;
20
21 import java.util.List;
22
23 import org.eclipse.jetty.annotations.AnnotationParser.Value;
24 import org.eclipse.jetty.util.log.Log;
25 import org.eclipse.jetty.util.log.Logger;
26 import org.eclipse.jetty.webapp.DiscoveredAnnotation;
27 import org.eclipse.jetty.webapp.WebAppContext;
28
29 public class WebListenerAnnotationHandler extends AbstractDiscoverableAnnotationHandler
30 {
31 private static final Logger LOG = Log.getLogger(WebListenerAnnotationHandler.class);
32
33 public WebListenerAnnotationHandler (WebAppContext context)
34 {
35 super(context);
36 }
37
38 public WebListenerAnnotationHandler (WebAppContext context, List<DiscoveredAnnotation> list)
39 {
40 super(context, list);
41 }
42
43
44
45
46 public void handleClass(String className, int version, int access, String signature, String superName, String[] interfaces, String annotation,
47 List<Value> values)
48 {
49 WebListenerAnnotation wlAnnotation = new WebListenerAnnotation(_context, className, _resource);
50 addAnnotation(wlAnnotation);
51 }
52
53 public void handleField(String className, String fieldName, int access, String fieldType, String signature, Object value, String annotation,
54 List<Value> values)
55 {
56 LOG.warn ("@WebListener is not applicable to fields: "+className+"."+fieldName);
57 }
58
59 public void handleMethod(String className, String methodName, int access, String params, String signature, String[] exceptions, String annotation,
60 List<Value> values)
61 {
62 LOG.warn ("@WebListener is not applicable to methods: "+className+"."+methodName+" "+signature);
63 }
64
65 @Override
66 public String getAnnotationName()
67 {
68 return "javax.servlet.annotation.WebListener";
69 }
70
71 }