01: /*
02: * Copyright 2004-2006 the original author or authors.
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:
17: package org.compass.spring.web.mvc;
18:
19: import org.compass.gps.CompassGps;
20: import org.springframework.beans.factory.InitializingBean;
21: import org.springframework.web.servlet.mvc.AbstractCommandController;
22:
23: /**
24: * A general base class for Spring's MVC Command Controllers that use
25: * <code>CompassGps</code>.
26: * <p>
27: * Expects <code>CompassGps</code> instance to be injected, and provides
28: * access to it.
29: *
30: * @author kimchy
31: */
32: public abstract class AbstractCompassGpsCommandController extends
33: AbstractCommandController implements InitializingBean {
34:
35: private CompassGps compassGps;
36:
37: public void afterPropertiesSet() throws Exception {
38: if (compassGps == null) {
39: throw new IllegalArgumentException(
40: "Must set the compassGpd property");
41: }
42: }
43:
44: /**
45: * Returns the <code>CompassGps</code>.
46: *
47: * @return The Compass Gps
48: */
49: public CompassGps getCompassGps() {
50: return compassGps;
51: }
52:
53: /**
54: * Sets the <code>CompassGps</code>.
55: *
56: * @param compassGps
57: */
58: public void setCompassGps(CompassGps compassGps) {
59: this.compassGps = compassGps;
60: }
61:
62: }
|