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