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 AssetConsumptionRatePG.
029: * @see NewAssetConsumptionRatePG
030: * @see AssetConsumptionRatePGImpl
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 AssetConsumptionRatePG extends PropertyGroup,
045: org.cougaar.planning.ldm.dq.HasDataQuality {
046: AssetConsumptionRate getAssetConsumptionRate(String assetType,
047: Service service, String theater);
048:
049: public static interface AssetConsumptionRateHandler {
050: AssetConsumptionRate getAssetConsumptionRate(String assetType,
051: Service service, String theater);
052:
053: void setAssetConsumptionRate(AssetConsumptionRate _value,
054: String assetType, Service service, String theater);
055: }
056:
057: // introspection and construction
058: /** the method of factoryClass that creates this type **/
059: String factoryMethod = "newAssetConsumptionRatePG";
060: /** the (mutable) class type returned by factoryMethod **/
061: String mutableClass = "org.cougaar.glm.ldm.asset.NewAssetConsumptionRatePG";
062: /** the factory class **/
063: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
064: /** the (immutable) class type returned by domain factory **/
065: Class primaryClass = org.cougaar.glm.ldm.asset.AssetConsumptionRatePG.class;
066: String assetSetter = "setAssetConsumptionRatePG";
067: String assetGetter = "getAssetConsumptionRatePG";
068: /** The Null instance for indicating that the PG definitely has no value **/
069: AssetConsumptionRatePG nullPG = new Null_AssetConsumptionRatePG();
070:
071: /** Null_PG implementation for AssetConsumptionRatePG **/
072: final class Null_AssetConsumptionRatePG implements
073: AssetConsumptionRatePG, Null_PG {
074: public AssetConsumptionRate getAssetConsumptionRate(
075: String assetType, Service service, String theater) {
076: throw new UndefinedValueException();
077: }
078:
079: public boolean equals(Object object) {
080: throw new UndefinedValueException();
081: }
082:
083: public Object clone() throws CloneNotSupportedException {
084: throw new CloneNotSupportedException();
085: }
086:
087: public NewPropertyGroup unlock(Object key) {
088: return null;
089: }
090:
091: public PropertyGroup lock(Object key) {
092: return null;
093: }
094:
095: public PropertyGroup lock() {
096: return null;
097: }
098:
099: public PropertyGroup copy() {
100: return null;
101: }
102:
103: public Class getPrimaryClass() {
104: return primaryClass;
105: }
106:
107: public String getAssetGetMethod() {
108: return assetGetter;
109: }
110:
111: public String getAssetSetMethod() {
112: return assetSetter;
113: }
114:
115: public Class getIntrospectionClass() {
116: return AssetConsumptionRatePGImpl.class;
117: }
118:
119: public boolean hasDataQuality() {
120: return false;
121: }
122:
123: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
124: return null;
125: }
126: }
127:
128: /** Future PG implementation for AssetConsumptionRatePG **/
129: final class Future implements AssetConsumptionRatePG, Future_PG {
130: public AssetConsumptionRate getAssetConsumptionRate(
131: String assetType, Service service, String theater) {
132: waitForFinalize();
133: return _real.getAssetConsumptionRate(assetType, service,
134: theater);
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 AssetConsumptionRatePGImpl.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 AssetConsumptionRatePG _real = null;
188:
189: public synchronized void finalize(PropertyGroup real) {
190: if (real instanceof AssetConsumptionRatePG) {
191: _real = (AssetConsumptionRatePG) 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: }
|