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.spi.Provider;
25
26
27
28
29
30
31 public abstract class AbstractPlugin implements Plugin {
32
33
34 private final Set<Class<? extends Provider>> supportedServices = new LinkedHashSet<Class<? extends Provider>>();
35
36
37
38
39
40
41
42 protected void support(final Class<? extends Provider> service) {
43 supportedServices.add(service);
44 }
45
46
47
48
49
50
51
52
53
54 protected boolean isSupport(final Class<? extends Provider> service) {
55 return supportedServices.contains(service);
56 }
57
58
59
60
61 public void initialize(final ServletContext servletContext)
62 throws Exception {
63 }
64
65
66
67
68 public Set<Class<? extends Provider>> getSupportedServices() {
69 return supportedServices;
70 }
71
72
73
74
75 public <S extends Provider> S getProvider(final Class<S> service) {
76 return null;
77 }
78
79
80
81
82 public void ready() throws Exception {
83 }
84
85
86
87
88 public void destroy() {
89 }
90
91
92
93
94 public void invokeRequestProcessing(
95 final RequestProcessingInvocation invocation) throws Exception {
96 invocation.proceed();
97 }
98
99
100
101
102 public ActionResult invokeAction(final ActionInvocation invocation)
103 throws Exception {
104 return invocation.proceed();
105 }
106
107
108
109
110 public void invokeActionResult(final ActionResultInvocation invocation)
111 throws Exception {
112 invocation.proceed();
113 }
114
115 }