01: /*
02: * Copyright 2004, 2005, 2006 Odysseus Software GmbH
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package de.odysseus.calyxo.base.access;
17:
18: import javax.servlet.http.HttpServletRequest;
19:
20: import de.odysseus.calyxo.base.ModuleContext;
21:
22: /**
23: * This accessor acts as a base class for static accessors which are beans.
24: * Static means "does not need the request", just the module context.
25: *
26: * @author Christoph Beck
27: */
28: public abstract class StaticBeanAccessor implements Accessor {
29: public final ModuleContext context;
30:
31: /**
32: * Constructor.
33: * @param context the module context we're in
34: */
35: public StaticBeanAccessor(ModuleContext context) {
36: this .context = context;
37: }
38:
39: /**
40: * @return <code>this</code>
41: */
42: public final Object get(HttpServletRequest request) {
43: return this ;
44: }
45:
46: /**
47: * @return <code>true</code>
48: */
49: public boolean isCacheable() {
50: return true;
51: }
52: }
|