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