001: /*
002: * <copyright>
003: *
004: * Copyright 1997-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026:
027: /* @generated Thu Sep 27 15:21:47 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/glm/src/org/cougaar/glm/ldm/asset/alpprops.def - DO NOT HAND EDIT */
028: /** Primary client interface for GroundVehiclePG.
029: * @see NewGroundVehiclePG
030: * @see GroundVehiclePGImpl
031: **/package org.cougaar.glm.ldm.asset;
032:
033: import org.cougaar.planning.ldm.measure.*;
034: import org.cougaar.planning.ldm.asset.*;
035: import org.cougaar.planning.ldm.plan.*;
036: import java.util.*;
037:
038: import org.cougaar.glm.ldm.plan.*;
039: import org.cougaar.glm.ldm.oplan.*;
040: import org.cougaar.glm.ldm.policy.*;
041: import org.cougaar.core.mts.MessageAddress;
042: import org.cougaar.glm.execution.common.InventoryReport;
043:
044: public interface GroundVehiclePG extends PropertyGroup,
045: org.cougaar.planning.ldm.dq.HasDataQuality {
046: /** Poorest road surface tolerable by the vehicle (unpaved, dirt, gravel, etc.) **/
047: String getRoadSurfaceRequirements();
048:
049: /** Used for estimating repair requirements **/
050: Distance getMeanDistanceBetweenRepairs();
051:
052: String getVehicleType();
053:
054: long getCrewRequirements();
055:
056: // introspection and construction
057: /** the method of factoryClass that creates this type **/
058: String factoryMethod = "newGroundVehiclePG";
059: /** the (mutable) class type returned by factoryMethod **/
060: String mutableClass = "org.cougaar.glm.ldm.asset.NewGroundVehiclePG";
061: /** the factory class **/
062: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
063: /** the (immutable) class type returned by domain factory **/
064: Class primaryClass = org.cougaar.glm.ldm.asset.GroundVehiclePG.class;
065: String assetSetter = "setGroundVehiclePG";
066: String assetGetter = "getGroundVehiclePG";
067: /** The Null instance for indicating that the PG definitely has no value **/
068: GroundVehiclePG nullPG = new Null_GroundVehiclePG();
069:
070: /** Null_PG implementation for GroundVehiclePG **/
071: final class Null_GroundVehiclePG implements GroundVehiclePG,
072: Null_PG {
073: public String getRoadSurfaceRequirements() {
074: throw new UndefinedValueException();
075: }
076:
077: public Distance getMeanDistanceBetweenRepairs() {
078: throw new UndefinedValueException();
079: }
080:
081: public String getVehicleType() {
082: throw new UndefinedValueException();
083: }
084:
085: public long getCrewRequirements() {
086: throw new UndefinedValueException();
087: }
088:
089: public boolean equals(Object object) {
090: throw new UndefinedValueException();
091: }
092:
093: public Object clone() throws CloneNotSupportedException {
094: throw new CloneNotSupportedException();
095: }
096:
097: public NewPropertyGroup unlock(Object key) {
098: return null;
099: }
100:
101: public PropertyGroup lock(Object key) {
102: return null;
103: }
104:
105: public PropertyGroup lock() {
106: return null;
107: }
108:
109: public PropertyGroup copy() {
110: return null;
111: }
112:
113: public Class getPrimaryClass() {
114: return primaryClass;
115: }
116:
117: public String getAssetGetMethod() {
118: return assetGetter;
119: }
120:
121: public String getAssetSetMethod() {
122: return assetSetter;
123: }
124:
125: public Class getIntrospectionClass() {
126: return GroundVehiclePGImpl.class;
127: }
128:
129: public boolean hasDataQuality() {
130: return false;
131: }
132:
133: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
134: return null;
135: }
136: }
137:
138: /** Future PG implementation for GroundVehiclePG **/
139: final class Future implements GroundVehiclePG, Future_PG {
140: public String getRoadSurfaceRequirements() {
141: waitForFinalize();
142: return _real.getRoadSurfaceRequirements();
143: }
144:
145: public Distance getMeanDistanceBetweenRepairs() {
146: waitForFinalize();
147: return _real.getMeanDistanceBetweenRepairs();
148: }
149:
150: public String getVehicleType() {
151: waitForFinalize();
152: return _real.getVehicleType();
153: }
154:
155: public long getCrewRequirements() {
156: waitForFinalize();
157: return _real.getCrewRequirements();
158: }
159:
160: public boolean equals(Object object) {
161: waitForFinalize();
162: return _real.equals(object);
163: }
164:
165: public Object clone() throws CloneNotSupportedException {
166: throw new CloneNotSupportedException();
167: }
168:
169: public NewPropertyGroup unlock(Object key) {
170: return null;
171: }
172:
173: public PropertyGroup lock(Object key) {
174: return null;
175: }
176:
177: public PropertyGroup lock() {
178: return null;
179: }
180:
181: public PropertyGroup copy() {
182: return null;
183: }
184:
185: public Class getPrimaryClass() {
186: return primaryClass;
187: }
188:
189: public String getAssetGetMethod() {
190: return assetGetter;
191: }
192:
193: public String getAssetSetMethod() {
194: return assetSetter;
195: }
196:
197: public Class getIntrospectionClass() {
198: return GroundVehiclePGImpl.class;
199: }
200:
201: public synchronized boolean hasDataQuality() {
202: return (_real != null) && _real.hasDataQuality();
203: }
204:
205: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
206: return (_real == null) ? null : (_real.getDataQuality());
207: }
208:
209: // Finalization support
210: private GroundVehiclePG _real = null;
211:
212: public synchronized void finalize(PropertyGroup real) {
213: if (real instanceof GroundVehiclePG) {
214: _real = (GroundVehiclePG) real;
215: notifyAll();
216: } else {
217: throw new IllegalArgumentException(
218: "Finalization with wrong class: " + real);
219: }
220: }
221:
222: private synchronized void waitForFinalize() {
223: while (_real == null) {
224: try {
225: wait();
226: } catch (InterruptedException _ie) {
227: // We should really let waitForFinalize throw InterruptedException
228: Thread.interrupted();
229: }
230: }
231: }
232: }
233: }
|