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 MidAirRefuelPG.
029: * @see NewMidAirRefuelPG
030: * @see MidAirRefuelPGImpl
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 MidAirRefuelPG extends PropertyGroup,
045: org.cougaar.planning.ldm.dq.HasDataQuality {
046: Distance getDistanceToAirbase();
047:
048: Duration getTimeToRefuel();
049:
050: // introspection and construction
051: /** the method of factoryClass that creates this type **/
052: String factoryMethod = "newMidAirRefuelPG";
053: /** the (mutable) class type returned by factoryMethod **/
054: String mutableClass = "org.cougaar.glm.ldm.asset.NewMidAirRefuelPG";
055: /** the factory class **/
056: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
057: /** the (immutable) class type returned by domain factory **/
058: Class primaryClass = org.cougaar.glm.ldm.asset.MidAirRefuelPG.class;
059: String assetSetter = "setMidAirRefuelPG";
060: String assetGetter = "getMidAirRefuelPG";
061: /** The Null instance for indicating that the PG definitely has no value **/
062: MidAirRefuelPG nullPG = new Null_MidAirRefuelPG();
063:
064: /** Null_PG implementation for MidAirRefuelPG **/
065: final class Null_MidAirRefuelPG implements MidAirRefuelPG, Null_PG {
066: public Distance getDistanceToAirbase() {
067: throw new UndefinedValueException();
068: }
069:
070: public Duration getTimeToRefuel() {
071: throw new UndefinedValueException();
072: }
073:
074: public boolean equals(Object object) {
075: throw new UndefinedValueException();
076: }
077:
078: public Object clone() throws CloneNotSupportedException {
079: throw new CloneNotSupportedException();
080: }
081:
082: public NewPropertyGroup unlock(Object key) {
083: return null;
084: }
085:
086: public PropertyGroup lock(Object key) {
087: return null;
088: }
089:
090: public PropertyGroup lock() {
091: return null;
092: }
093:
094: public PropertyGroup copy() {
095: return null;
096: }
097:
098: public Class getPrimaryClass() {
099: return primaryClass;
100: }
101:
102: public String getAssetGetMethod() {
103: return assetGetter;
104: }
105:
106: public String getAssetSetMethod() {
107: return assetSetter;
108: }
109:
110: public Class getIntrospectionClass() {
111: return MidAirRefuelPGImpl.class;
112: }
113:
114: public boolean hasDataQuality() {
115: return false;
116: }
117:
118: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
119: return null;
120: }
121: }
122:
123: /** Future PG implementation for MidAirRefuelPG **/
124: final class Future implements MidAirRefuelPG, Future_PG {
125: public Distance getDistanceToAirbase() {
126: waitForFinalize();
127: return _real.getDistanceToAirbase();
128: }
129:
130: public Duration getTimeToRefuel() {
131: waitForFinalize();
132: return _real.getTimeToRefuel();
133: }
134:
135: public boolean equals(Object object) {
136: waitForFinalize();
137: return _real.equals(object);
138: }
139:
140: public Object clone() throws CloneNotSupportedException {
141: throw new CloneNotSupportedException();
142: }
143:
144: public NewPropertyGroup unlock(Object key) {
145: return null;
146: }
147:
148: public PropertyGroup lock(Object key) {
149: return null;
150: }
151:
152: public PropertyGroup lock() {
153: return null;
154: }
155:
156: public PropertyGroup copy() {
157: return null;
158: }
159:
160: public Class getPrimaryClass() {
161: return primaryClass;
162: }
163:
164: public String getAssetGetMethod() {
165: return assetGetter;
166: }
167:
168: public String getAssetSetMethod() {
169: return assetSetter;
170: }
171:
172: public Class getIntrospectionClass() {
173: return MidAirRefuelPGImpl.class;
174: }
175:
176: public synchronized boolean hasDataQuality() {
177: return (_real != null) && _real.hasDataQuality();
178: }
179:
180: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
181: return (_real == null) ? null : (_real.getDataQuality());
182: }
183:
184: // Finalization support
185: private MidAirRefuelPG _real = null;
186:
187: public synchronized void finalize(PropertyGroup real) {
188: if (real instanceof MidAirRefuelPG) {
189: _real = (MidAirRefuelPG) real;
190: notifyAll();
191: } else {
192: throw new IllegalArgumentException(
193: "Finalization with wrong class: " + real);
194: }
195: }
196:
197: private synchronized void waitForFinalize() {
198: while (_real == null) {
199: try {
200: wait();
201: } catch (InterruptedException _ie) {
202: // We should really let waitForFinalize throw InterruptedException
203: Thread.interrupted();
204: }
205: }
206: }
207: }
208: }
|