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 CSSCapabilityPG.
029: * @see NewCSSCapabilityPG
030: * @see CSSCapabilityPGImpl
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 CSSCapabilityPG extends PropertyGroup,
045: org.cougaar.planning.ldm.dq.HasDataQuality {
046: /** a set of CSS capabilities that this asset advertises. **/
047: Collection getCapabilities();
048:
049: /** test to see if an element is a member of the capabilities Collection **/
050: boolean inCapabilities(CSSCapability element);
051:
052: /** array getter for beans **/
053: CSSCapability[] getCapabilitiesAsArray();
054:
055: /** indexed getter for beans **/
056: CSSCapability getIndexedCapabilities(int index);
057:
058: // introspection and construction
059: /** the method of factoryClass that creates this type **/
060: String factoryMethod = "newCSSCapabilityPG";
061: /** the (mutable) class type returned by factoryMethod **/
062: String mutableClass = "org.cougaar.glm.ldm.asset.NewCSSCapabilityPG";
063: /** the factory class **/
064: Class factoryClass = org.cougaar.glm.ldm.asset.PropertyGroupFactory.class;
065: /** the (immutable) class type returned by domain factory **/
066: Class primaryClass = org.cougaar.glm.ldm.asset.CSSCapabilityPG.class;
067: String assetSetter = "setCSSCapabilityPG";
068: String assetGetter = "getCSSCapabilityPG";
069: /** The Null instance for indicating that the PG definitely has no value **/
070: CSSCapabilityPG nullPG = new Null_CSSCapabilityPG();
071:
072: /** Null_PG implementation for CSSCapabilityPG **/
073: final class Null_CSSCapabilityPG implements CSSCapabilityPG,
074: Null_PG {
075: public Collection getCapabilities() {
076: throw new UndefinedValueException();
077: }
078:
079: public boolean inCapabilities(CSSCapability element) {
080: return false;
081: }
082:
083: public CSSCapability[] getCapabilitiesAsArray() {
084: return null;
085: }
086:
087: public CSSCapability getIndexedCapabilities(int index) {
088: throw new UndefinedValueException();
089: }
090:
091: public boolean equals(Object object) {
092: throw new UndefinedValueException();
093: }
094:
095: public Object clone() throws CloneNotSupportedException {
096: throw new CloneNotSupportedException();
097: }
098:
099: public NewPropertyGroup unlock(Object key) {
100: return null;
101: }
102:
103: public PropertyGroup lock(Object key) {
104: return null;
105: }
106:
107: public PropertyGroup lock() {
108: return null;
109: }
110:
111: public PropertyGroup copy() {
112: return null;
113: }
114:
115: public Class getPrimaryClass() {
116: return primaryClass;
117: }
118:
119: public String getAssetGetMethod() {
120: return assetGetter;
121: }
122:
123: public String getAssetSetMethod() {
124: return assetSetter;
125: }
126:
127: public Class getIntrospectionClass() {
128: return CSSCapabilityPGImpl.class;
129: }
130:
131: public boolean hasDataQuality() {
132: return false;
133: }
134:
135: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
136: return null;
137: }
138: }
139:
140: /** Future PG implementation for CSSCapabilityPG **/
141: final class Future implements CSSCapabilityPG, Future_PG {
142: public Collection getCapabilities() {
143: waitForFinalize();
144: return _real.getCapabilities();
145: }
146:
147: public boolean inCapabilities(CSSCapability element) {
148: waitForFinalize();
149: return _real.inCapabilities(element);
150: }
151:
152: public CSSCapability[] getCapabilitiesAsArray() {
153: waitForFinalize();
154: return _real.getCapabilitiesAsArray();
155: }
156:
157: public CSSCapability getIndexedCapabilities(int index) {
158: waitForFinalize();
159: return _real.getIndexedCapabilities(index);
160: }
161:
162: public boolean equals(Object object) {
163: waitForFinalize();
164: return _real.equals(object);
165: }
166:
167: public Object clone() throws CloneNotSupportedException {
168: throw new CloneNotSupportedException();
169: }
170:
171: public NewPropertyGroup unlock(Object key) {
172: return null;
173: }
174:
175: public PropertyGroup lock(Object key) {
176: return null;
177: }
178:
179: public PropertyGroup lock() {
180: return null;
181: }
182:
183: public PropertyGroup copy() {
184: return null;
185: }
186:
187: public Class getPrimaryClass() {
188: return primaryClass;
189: }
190:
191: public String getAssetGetMethod() {
192: return assetGetter;
193: }
194:
195: public String getAssetSetMethod() {
196: return assetSetter;
197: }
198:
199: public Class getIntrospectionClass() {
200: return CSSCapabilityPGImpl.class;
201: }
202:
203: public synchronized boolean hasDataQuality() {
204: return (_real != null) && _real.hasDataQuality();
205: }
206:
207: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
208: return (_real == null) ? null : (_real.getDataQuality());
209: }
210:
211: // Finalization support
212: private CSSCapabilityPG _real = null;
213:
214: public synchronized void finalize(PropertyGroup real) {
215: if (real instanceof CSSCapabilityPG) {
216: _real = (CSSCapabilityPG) real;
217: notifyAll();
218: } else {
219: throw new IllegalArgumentException(
220: "Finalization with wrong class: " + real);
221: }
222: }
223:
224: private synchronized void waitForFinalize() {
225: while (_real == null) {
226: try {
227: wait();
228: } catch (InterruptedException _ie) {
229: // We should really let waitForFinalize throw InterruptedException
230: Thread.interrupted();
231: }
232: }
233: }
234: }
235: }
|