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