1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.seasar.cubby.plugin;
18
19 import java.util.LinkedHashSet;
20 import java.util.Set;
21
22 import javax.servlet.ServletContext;
23
24 import org.seasar.cubby.action.ActionResult;
25 import org.seasar.cubby.routing.PathInfo;
26 import org.seasar.cubby.spi.Provider;
27
28
29
30
31
32
33 public abstract class AbstractPlugin implements Plugin {
34
35
36 private final Set<Class<? extends Provider>> supportedServices = new LinkedHashSet<Class<? extends Provider>>();
37
38
39
40
41
42
43
44 protected void support(final Class<? extends Provider> service) {
45 supportedServices.add(service);
46 }
47
48
49
50
51
52
53
54
55
56 protected boolean isSupport(final Class<? extends Provider> service) {
57 return supportedServices.contains(service);
58 }
59
60
61
62
63 public void initialize(final ServletContext servletContext)
64 throws Exception {
65 }
66
67
68
69
70 public Set<Class<? extends Provider>> getSupportedServices() {
71 return supportedServices;
72 }
73
74
75
76
77 public <S extends Provider> S getProvider(final Class<S> service) {
78 return null;
79 }
80
81
82
83
84 public void ready() throws Exception {
85 }
86
87
88
89
90 public void destroy() {
91 }
92
93
94
95
96 public PathInfo invokeRouting(final RoutingInvocation invocation)
97 throws Exception {
98 return invocation.proceed();
99 }
100
101
102
103
104 public void invokeRequestProcessing(
105 final RequestProcessingInvocation invocation) throws Exception {
106 invocation.proceed();
107 }
108
109
110
111
112 public ActionResult invokeAction(final ActionInvocation invocation)
113 throws Exception {
114 return invocation.proceed();
115 }
116
117
118
119
120 public ActionResult invokeValidation(final ValidationInvocation invocation)
121 throws Exception {
122 return invocation.proceed();
123 }
124
125
126
127
128 public void invokeActionResult(final ActionResultInvocation invocation)
129 throws Exception {
130 invocation.proceed();
131 }
132
133 }