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 VolumetricStockagePG.
029: * representation of Stockage parameters that are measured by volume
030: * @see NewVolumetricStockagePG
031: * @see VolumetricStockagePGImpl
032: **/package org.cougaar.glm.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.glm.ldm.plan.*;
040: import org.cougaar.glm.ldm.oplan.*;
041: import org.cougaar.glm.ldm.policy.*;
042: import org.cougaar.core.mts.MessageAddress;
043: import org.cougaar.glm.execution.common.InventoryReport;
044:
045: public interface VolumetricStockagePG extends PropertyGroup,
046: org.cougaar.planning.ldm.dq.HasDataQuality {
047: /** volume level at which you are allowed to reorder. **/
048: Volume getReorderLevel();
049:
050: /** minimum volume you can order. Should be less than or equal to reorder level. **/
051: Volume getMinReorderVolume();
052:
053: /** Quantity of materiel which cannot be used. E.g. fuel which cannot be pumped out of a tank. **/
054: Volume getUnobtainable();
055:
056: // introspection and construction
057: /** the method of factoryClass that creates this type **/
058: String factoryMethod = "newVolumetricStockagePG";
059: /** the (mutable) class type returned by factoryMethod **/
060: String mutableClass = "org.cougaar.glm.ldm.asset.NewVolumetricStockagePG";
061: /** the factory class **/
062: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
063: /** the (immutable) class type returned by domain factory **/
064: Class primaryClass = org.cougaar.glm.ldm.asset.VolumetricStockagePG.class;
065: String assetSetter = "setVolumetricStockagePG";
066: String assetGetter = "getVolumetricStockagePG";
067: /** The Null instance for indicating that the PG definitely has no value **/
068: VolumetricStockagePG nullPG = new Null_VolumetricStockagePG();
069:
070: /** Null_PG implementation for VolumetricStockagePG **/
071: final class Null_VolumetricStockagePG implements
072: VolumetricStockagePG, Null_PG {
073: public Volume getReorderLevel() {
074: throw new UndefinedValueException();
075: }
076:
077: public Volume getMinReorderVolume() {
078: throw new UndefinedValueException();
079: }
080:
081: public Volume getUnobtainable() {
082: throw new UndefinedValueException();
083: }
084:
085: public boolean equals(Object object) {
086: throw new UndefinedValueException();
087: }
088:
089: public Object clone() throws CloneNotSupportedException {
090: throw new CloneNotSupportedException();
091: }
092:
093: public NewPropertyGroup unlock(Object key) {
094: return null;
095: }
096:
097: public PropertyGroup lock(Object key) {
098: return null;
099: }
100:
101: public PropertyGroup lock() {
102: return null;
103: }
104:
105: public PropertyGroup copy() {
106: return null;
107: }
108:
109: public Class getPrimaryClass() {
110: return primaryClass;
111: }
112:
113: public String getAssetGetMethod() {
114: return assetGetter;
115: }
116:
117: public String getAssetSetMethod() {
118: return assetSetter;
119: }
120:
121: public Class getIntrospectionClass() {
122: return VolumetricStockagePGImpl.class;
123: }
124:
125: public boolean hasDataQuality() {
126: return false;
127: }
128:
129: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
130: return null;
131: }
132: }
133:
134: /** Future PG implementation for VolumetricStockagePG **/
135: final class Future implements VolumetricStockagePG, Future_PG {
136: public Volume getReorderLevel() {
137: waitForFinalize();
138: return _real.getReorderLevel();
139: }
140:
141: public Volume getMinReorderVolume() {
142: waitForFinalize();
143: return _real.getMinReorderVolume();
144: }
145:
146: public Volume getUnobtainable() {
147: waitForFinalize();
148: return _real.getUnobtainable();
149: }
150:
151: public boolean equals(Object object) {
152: waitForFinalize();
153: return _real.equals(object);
154: }
155:
156: public Object clone() throws CloneNotSupportedException {
157: throw new CloneNotSupportedException();
158: }
159:
160: public NewPropertyGroup unlock(Object key) {
161: return null;
162: }
163:
164: public PropertyGroup lock(Object key) {
165: return null;
166: }
167:
168: public PropertyGroup lock() {
169: return null;
170: }
171:
172: public PropertyGroup copy() {
173: return null;
174: }
175:
176: public Class getPrimaryClass() {
177: return primaryClass;
178: }
179:
180: public String getAssetGetMethod() {
181: return assetGetter;
182: }
183:
184: public String getAssetSetMethod() {
185: return assetSetter;
186: }
187:
188: public Class getIntrospectionClass() {
189: return VolumetricStockagePGImpl.class;
190: }
191:
192: public synchronized boolean hasDataQuality() {
193: return (_real != null) && _real.hasDataQuality();
194: }
195:
196: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
197: return (_real == null) ? null : (_real.getDataQuality());
198: }
199:
200: // Finalization support
201: private VolumetricStockagePG _real = null;
202:
203: public synchronized void finalize(PropertyGroup real) {
204: if (real instanceof VolumetricStockagePG) {
205: _real = (VolumetricStockagePG) real;
206: notifyAll();
207: } else {
208: throw new IllegalArgumentException(
209: "Finalization with wrong class: " + real);
210: }
211: }
212:
213: private synchronized void waitForFinalize() {
214: while (_real == null) {
215: try {
216: wait();
217: } catch (InterruptedException _ie) {
218: // We should really let waitForFinalize throw InterruptedException
219: Thread.interrupted();
220: }
221: }
222: }
223: }
224: }
|