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: import de.odysseus.calyxo.base.util.MapFacade;
22:
23: /**
24: * This static accessor also directly implements a map.
25: * Static means "does not need the request".
26: *
27: * @author Christoph Beck
28: */
29: public abstract class StaticMapAccessor extends MapFacade implements
30: Accessor {
31: public final ModuleContext context;
32:
33: /**
34: * Constructor.
35: * @param context the module context we're in
36: */
37: public StaticMapAccessor(ModuleContext context) {
38: this .context = context;
39: }
40:
41: /**
42: * @return <code>this</code>
43: */
44: public final Object get(HttpServletRequest request) {
45: return this ;
46: }
47:
48: /**
49: * @return <code>true</code>
50: */
51: public boolean isCacheable() {
52: return true;
53: }
54:
55: /* (non-Javadoc)
56: * @see java.util.Map#get(java.lang.Object)
57: */
58: public abstract Object get(Object key);
59:
60: }
|