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 org.eclipse.jetty.servlet.ServletContextHandler.Decorator;
22 import org.eclipse.jetty.webapp.WebAppContext;
23
24
25
26
27
28
29 public class AnnotationDecorator implements Decorator
30 {
31 AnnotationIntrospector _introspector = new AnnotationIntrospector();
32
33
34
35
36 public AnnotationDecorator(WebAppContext context)
37 {
38 _introspector.registerHandler(new ResourceAnnotationHandler(context));
39 _introspector.registerHandler(new ResourcesAnnotationHandler(context));
40 _introspector.registerHandler(new RunAsAnnotationHandler(context));
41 _introspector.registerHandler(new PostConstructAnnotationHandler(context));
42 _introspector.registerHandler(new PreDestroyAnnotationHandler(context));
43 _introspector.registerHandler(new DeclareRolesAnnotationHandler(context));
44 _introspector.registerHandler(new MultiPartConfigAnnotationHandler(context));
45 _introspector.registerHandler(new ServletSecurityAnnotationHandler(context));
46 }
47
48
49
50
51
52
53
54
55
56
57
58
59 protected void introspect (Object o)
60 {
61 _introspector.introspect(o.getClass());
62 }
63
64 @Override
65 public Object decorate(Object o)
66 {
67 introspect(o);
68 return o;
69 }
70
71 @Override
72 public void destroy(Object o)
73 {
74
75 }
76 }