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