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 TransportationPG.
029: * @see NewTransportationPG
030: * @see TransportationPGImpl
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 TransportationPG extends PropertyGroup,
045: org.cougaar.planning.ldm.dq.HasDataQuality {
046: /** The maximum number of containers that can be transported at one time **/
047: long getContainerCount();
048:
049: /** The maximum mass of non-containerized cargo that can be transported at one time **/
050: Volume getNonContainerCapacity();
051:
052: /** The maximum volume of water that can be transported at one time **/
053: Volume getWaterCapacity();
054:
055: /** The maximum volume of petroleum that can be transported at one time **/
056: Volume getPetroleumCapacity();
057:
058: /** The maximum mass of ammunition that can be transported at one time **/
059: Mass getAmmunitionCapacity();
060:
061: /** The maximum number of passengers that can be transported at one time **/
062: long getPassengerCapacity();
063:
064: // introspection and construction
065: /** the method of factoryClass that creates this type **/
066: String factoryMethod = "newTransportationPG";
067: /** the (mutable) class type returned by factoryMethod **/
068: String mutableClass = "org.cougaar.glm.ldm.asset.NewTransportationPG";
069: /** the factory class **/
070: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
071: /** the (immutable) class type returned by domain factory **/
072: Class primaryClass = org.cougaar.glm.ldm.asset.TransportationPG.class;
073: String assetSetter = "setTransportationPG";
074: String assetGetter = "getTransportationPG";
075: /** The Null instance for indicating that the PG definitely has no value **/
076: TransportationPG nullPG = new Null_TransportationPG();
077:
078: /** Null_PG implementation for TransportationPG **/
079: final class Null_TransportationPG implements TransportationPG,
080: Null_PG {
081: public long getContainerCount() {
082: throw new UndefinedValueException();
083: }
084:
085: public Volume getNonContainerCapacity() {
086: throw new UndefinedValueException();
087: }
088:
089: public Volume getWaterCapacity() {
090: throw new UndefinedValueException();
091: }
092:
093: public Volume getPetroleumCapacity() {
094: throw new UndefinedValueException();
095: }
096:
097: public Mass getAmmunitionCapacity() {
098: throw new UndefinedValueException();
099: }
100:
101: public long getPassengerCapacity() {
102: throw new UndefinedValueException();
103: }
104:
105: public boolean equals(Object object) {
106: throw new UndefinedValueException();
107: }
108:
109: public Object clone() throws CloneNotSupportedException {
110: throw new CloneNotSupportedException();
111: }
112:
113: public NewPropertyGroup unlock(Object key) {
114: return null;
115: }
116:
117: public PropertyGroup lock(Object key) {
118: return null;
119: }
120:
121: public PropertyGroup lock() {
122: return null;
123: }
124:
125: public PropertyGroup copy() {
126: return null;
127: }
128:
129: public Class getPrimaryClass() {
130: return primaryClass;
131: }
132:
133: public String getAssetGetMethod() {
134: return assetGetter;
135: }
136:
137: public String getAssetSetMethod() {
138: return assetSetter;
139: }
140:
141: public Class getIntrospectionClass() {
142: return TransportationPGImpl.class;
143: }
144:
145: public boolean hasDataQuality() {
146: return false;
147: }
148:
149: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
150: return null;
151: }
152: }
153:
154: /** Future PG implementation for TransportationPG **/
155: final class Future implements TransportationPG, Future_PG {
156: public long getContainerCount() {
157: waitForFinalize();
158: return _real.getContainerCount();
159: }
160:
161: public Volume getNonContainerCapacity() {
162: waitForFinalize();
163: return _real.getNonContainerCapacity();
164: }
165:
166: public Volume getWaterCapacity() {
167: waitForFinalize();
168: return _real.getWaterCapacity();
169: }
170:
171: public Volume getPetroleumCapacity() {
172: waitForFinalize();
173: return _real.getPetroleumCapacity();
174: }
175:
176: public Mass getAmmunitionCapacity() {
177: waitForFinalize();
178: return _real.getAmmunitionCapacity();
179: }
180:
181: public long getPassengerCapacity() {
182: waitForFinalize();
183: return _real.getPassengerCapacity();
184: }
185:
186: public boolean equals(Object object) {
187: waitForFinalize();
188: return _real.equals(object);
189: }
190:
191: public Object clone() throws CloneNotSupportedException {
192: throw new CloneNotSupportedException();
193: }
194:
195: public NewPropertyGroup unlock(Object key) {
196: return null;
197: }
198:
199: public PropertyGroup lock(Object key) {
200: return null;
201: }
202:
203: public PropertyGroup lock() {
204: return null;
205: }
206:
207: public PropertyGroup copy() {
208: return null;
209: }
210:
211: public Class getPrimaryClass() {
212: return primaryClass;
213: }
214:
215: public String getAssetGetMethod() {
216: return assetGetter;
217: }
218:
219: public String getAssetSetMethod() {
220: return assetSetter;
221: }
222:
223: public Class getIntrospectionClass() {
224: return TransportationPGImpl.class;
225: }
226:
227: public synchronized boolean hasDataQuality() {
228: return (_real != null) && _real.hasDataQuality();
229: }
230:
231: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
232: return (_real == null) ? null : (_real.getDataQuality());
233: }
234:
235: // Finalization support
236: private TransportationPG _real = null;
237:
238: public synchronized void finalize(PropertyGroup real) {
239: if (real instanceof TransportationPG) {
240: _real = (TransportationPG) real;
241: notifyAll();
242: } else {
243: throw new IllegalArgumentException(
244: "Finalization with wrong class: " + real);
245: }
246: }
247:
248: private synchronized void waitForFinalize() {
249: while (_real == null) {
250: try {
251: wait();
252: } catch (InterruptedException _ie) {
253: // We should really let waitForFinalize throw InterruptedException
254: Thread.interrupted();
255: }
256: }
257: }
258: }
259: }
|