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