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:26:06 EDT 2007 from /u01/builds/cougaar/B12_4/B12_4/070927151721/src/albbn/src/org/cougaar/logistics/plugin/trans/properties.def - DO NOT HAND EDIT */
028: /** Primary client interface for LowFidelityAssetPG.
029: * Carries copy of low fidelity asset, so it can be associated with other low-fi assets that are part of the same glob
030: * @see NewLowFidelityAssetPG
031: * @see LowFidelityAssetPGImpl
032: **/package org.cougaar.logistics.plugin.trans;
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.asset.*;
040:
041: public interface LowFidelityAssetPG extends PropertyGroup {
042: /** the original low-fidelity asset **/
043: Asset getOriginalAsset();
044:
045: /** the dimensions and aggregate cargo category code in the aggregate **/
046: CargoCatCodeDimensionPG getCCCDim();
047:
048: // introspection and construction
049: /** the method of factoryClass that creates this type **/
050: String factoryMethod = "newLowFidelityAssetPG";
051: /** the (mutable) class type returned by factoryMethod **/
052: String mutableClass = "org.cougaar.logistics.plugin.trans.NewLowFidelityAssetPG";
053: /** the factory class **/
054: Class factoryClass = org.cougaar.logistics.plugin.trans.PropertyGroupFactory.class;
055: /** the (immutable) class type returned by domain factory **/
056: Class primaryClass = org.cougaar.logistics.plugin.trans.LowFidelityAssetPG.class;
057: String assetSetter = "setLowFidelityAssetPG";
058: String assetGetter = "getLowFidelityAssetPG";
059: /** The Null instance for indicating that the PG definitely has no value **/
060: LowFidelityAssetPG nullPG = new Null_LowFidelityAssetPG();
061:
062: /** Null_PG implementation for LowFidelityAssetPG **/
063: final class Null_LowFidelityAssetPG implements LowFidelityAssetPG,
064: Null_PG {
065: public Asset getOriginalAsset() {
066: throw new UndefinedValueException();
067: }
068:
069: public CargoCatCodeDimensionPG getCCCDim() {
070: throw new UndefinedValueException();
071: }
072:
073: public boolean equals(Object object) {
074: throw new UndefinedValueException();
075: }
076:
077: public Object clone() throws CloneNotSupportedException {
078: throw new CloneNotSupportedException();
079: }
080:
081: public NewPropertyGroup unlock(Object key) {
082: return null;
083: }
084:
085: public PropertyGroup lock(Object key) {
086: return null;
087: }
088:
089: public PropertyGroup lock() {
090: return null;
091: }
092:
093: public PropertyGroup copy() {
094: return null;
095: }
096:
097: public Class getPrimaryClass() {
098: return primaryClass;
099: }
100:
101: public String getAssetGetMethod() {
102: return assetGetter;
103: }
104:
105: public String getAssetSetMethod() {
106: return assetSetter;
107: }
108:
109: public Class getIntrospectionClass() {
110: return LowFidelityAssetPGImpl.class;
111: }
112:
113: public boolean hasDataQuality() {
114: return false;
115: }
116: }
117:
118: /** Future PG implementation for LowFidelityAssetPG **/
119: final class Future implements LowFidelityAssetPG, Future_PG {
120: public Asset getOriginalAsset() {
121: waitForFinalize();
122: return _real.getOriginalAsset();
123: }
124:
125: public CargoCatCodeDimensionPG getCCCDim() {
126: waitForFinalize();
127: return _real.getCCCDim();
128: }
129:
130: public boolean equals(Object object) {
131: waitForFinalize();
132: return _real.equals(object);
133: }
134:
135: public Object clone() throws CloneNotSupportedException {
136: throw new CloneNotSupportedException();
137: }
138:
139: public NewPropertyGroup unlock(Object key) {
140: return null;
141: }
142:
143: public PropertyGroup lock(Object key) {
144: return null;
145: }
146:
147: public PropertyGroup lock() {
148: return null;
149: }
150:
151: public PropertyGroup copy() {
152: return null;
153: }
154:
155: public Class getPrimaryClass() {
156: return primaryClass;
157: }
158:
159: public String getAssetGetMethod() {
160: return assetGetter;
161: }
162:
163: public String getAssetSetMethod() {
164: return assetSetter;
165: }
166:
167: public Class getIntrospectionClass() {
168: return LowFidelityAssetPGImpl.class;
169: }
170:
171: public synchronized boolean hasDataQuality() {
172: return (_real != null) && _real.hasDataQuality();
173: }
174:
175: // Finalization support
176: private LowFidelityAssetPG _real = null;
177:
178: public synchronized void finalize(PropertyGroup real) {
179: if (real instanceof LowFidelityAssetPG) {
180: _real = (LowFidelityAssetPG) real;
181: notifyAll();
182: } else {
183: throw new IllegalArgumentException(
184: "Finalization with wrong class: " + real);
185: }
186: }
187:
188: private synchronized void waitForFinalize() {
189: while (_real == null) {
190: try {
191: wait();
192: } catch (InterruptedException _ie) {
193: // We should really let waitForFinalize throw InterruptedException
194: Thread.interrupted();
195: }
196: }
197: }
198: }
199: }
|