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