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