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 protected AnnotationIntrospector _introspector = new AnnotationIntrospector();
32
33
34
35
36 public AnnotationDecorator(WebAppContext context)
37 {
38 registerHandlers(context);
39 }
40
41 public void registerHandlers (WebAppContext context)
42 {
43 _introspector.registerHandler(new ResourceAnnotationHandler(context));
44 _introspector.registerHandler(new ResourcesAnnotationHandler(context));
45 _introspector.registerHandler(new RunAsAnnotationHandler(context));
46 _introspector.registerHandler(new PostConstructAnnotationHandler(context));
47 _introspector.registerHandler(new PreDestroyAnnotationHandler(context));
48 _introspector.registerHandler(new DeclareRolesAnnotationHandler(context));
49 _introspector.registerHandler(new MultiPartConfigAnnotationHandler(context));
50 _introspector.registerHandler(new ServletSecurityAnnotationHandler(context));
51 }
52
53
54
55
56
57
58
59
60
61
62
63
64 protected void introspect (Object o)
65 {
66 _introspector.introspect(o.getClass());
67 }
68
69 @Override
70 public Object decorate(Object o)
71 {
72 introspect(o);
73 return o;
74 }
75
76 @Override
77 public void destroy(Object o)
78 {
79
80 }
81 }