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