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:26:05 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/albbn/src/org/cougaar/logistics/ldm/asset/consumerprops.def - DO NOT HAND EDIT */
028: /** Primary client interface for RationPG.
029: * Ration properties
030: * @see NewRationPG
031: * @see RationPGImpl
032: **/package org.cougaar.logistics.ldm.asset;
033:
034: import org.cougaar.planning.ldm.measure.*;
035: import org.cougaar.planning.ldm.asset.*;
036: import org.cougaar.planning.ldm.plan.*;
037: import java.util.*;
038:
039: import org.cougaar.logistics.ldm.MEIPrototypeProvider;
040: import org.cougaar.logistics.ldm.ClassIConsumerPrototypeProvider;
041: import org.cougaar.util.TimeSpan;
042:
043: public interface RationPG extends PropertyGroup,
044: org.cougaar.planning.ldm.dq.HasDataQuality {
045: /** Returns "BREAKFAST" or "LUNCH/DINNER" **/
046: String getMealType();
047:
048: /** Returns the short nomenclature: "MRE", "UGR-H&S", "UGR-A", "B-RATION" etc **/
049: String getRationType();
050:
051: String getUnitOfPack();
052:
053: HashMap getMandatorySupplement();
054:
055: // introspection and construction
056: /** the method of factoryClass that creates this type **/
057: String factoryMethod = "newRationPG";
058: /** the (mutable) class type returned by factoryMethod **/
059: String mutableClass = "org.cougaar.logistics.ldm.asset.NewRationPG";
060: /** the factory class **/
061: Class factoryClass = org.cougaar.logistics.ldm.asset.PropertyGroupFactory.class;
062: /** the (immutable) class type returned by domain factory **/
063: Class primaryClass = org.cougaar.logistics.ldm.asset.RationPG.class;
064: String assetSetter = "setRationPG";
065: String assetGetter = "getRationPG";
066: /** The Null instance for indicating that the PG definitely has no value **/
067: RationPG nullPG = new Null_RationPG();
068:
069: /** Null_PG implementation for RationPG **/
070: final class Null_RationPG implements RationPG, Null_PG {
071: public String getMealType() {
072: throw new UndefinedValueException();
073: }
074:
075: public String getRationType() {
076: throw new UndefinedValueException();
077: }
078:
079: public String getUnitOfPack() {
080: throw new UndefinedValueException();
081: }
082:
083: public HashMap getMandatorySupplement() {
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 RationPGImpl.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 RationPG **/
137: final class Future implements RationPG, Future_PG {
138: public String getMealType() {
139: waitForFinalize();
140: return _real.getMealType();
141: }
142:
143: public String getRationType() {
144: waitForFinalize();
145: return _real.getRationType();
146: }
147:
148: public String getUnitOfPack() {
149: waitForFinalize();
150: return _real.getUnitOfPack();
151: }
152:
153: public HashMap getMandatorySupplement() {
154: waitForFinalize();
155: return _real.getMandatorySupplement();
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 RationPGImpl.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 RationPG _real = null;
209:
210: public synchronized void finalize(PropertyGroup real) {
211: if (real instanceof RationPG) {
212: _real = (RationPG) 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: }
|