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