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 SkillsPG.
029: * @see NewSkillsPG
030: * @see SkillsPGImpl
031: **/package org.cougaar.lib.quo.performance.assets;
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: public interface SkillsPG extends PropertyGroup,
039: org.cougaar.planning.ldm.dq.HasDataQuality {
040: /** The number of years the programmer has been coding **/
041: int getYearsExperience();
042:
043: /** The average number lines of source code the programmer can produce per day **/
044: int getSLOCPerDay();
045:
046: // introspection and construction
047: /** the method of factoryClass that creates this type **/
048: String factoryMethod = "newSkillsPG";
049: /** the (mutable) class type returned by factoryMethod **/
050: String mutableClass = "org.cougaar.lib.quo.performance.assets.NewSkillsPG";
051: /** the factory class **/
052: Class factoryClass = org.cougaar.lib.quo.performance.assets.PropertyGroupFactory.class;
053: /** the (immutable) class type returned by domain factory **/
054: Class primaryClass = org.cougaar.lib.quo.performance.assets.SkillsPG.class;
055: String assetSetter = "setSkillsPG";
056: String assetGetter = "getSkillsPG";
057: /** The Null instance for indicating that the PG definitely has no value **/
058: SkillsPG nullPG = new Null_SkillsPG();
059:
060: /** Null_PG implementation for SkillsPG **/
061: final class Null_SkillsPG implements SkillsPG, Null_PG {
062: public int getYearsExperience() {
063: throw new UndefinedValueException();
064: }
065:
066: public int getSLOCPerDay() {
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 SkillsPGImpl.class;
108: }
109:
110: public boolean hasDataQuality() {
111: return false;
112: }
113:
114: public org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
115: return null;
116: }
117: }
118:
119: /** Future PG implementation for SkillsPG **/
120: final class Future implements SkillsPG, Future_PG {
121: public int getYearsExperience() {
122: waitForFinalize();
123: return _real.getYearsExperience();
124: }
125:
126: public int getSLOCPerDay() {
127: waitForFinalize();
128: return _real.getSLOCPerDay();
129: }
130:
131: public boolean equals(Object object) {
132: waitForFinalize();
133: return _real.equals(object);
134: }
135:
136: public Object clone() throws CloneNotSupportedException {
137: throw new CloneNotSupportedException();
138: }
139:
140: public NewPropertyGroup unlock(Object key) {
141: return null;
142: }
143:
144: public PropertyGroup lock(Object key) {
145: return null;
146: }
147:
148: public PropertyGroup lock() {
149: return null;
150: }
151:
152: public PropertyGroup copy() {
153: return null;
154: }
155:
156: public Class getPrimaryClass() {
157: return primaryClass;
158: }
159:
160: public String getAssetGetMethod() {
161: return assetGetter;
162: }
163:
164: public String getAssetSetMethod() {
165: return assetSetter;
166: }
167:
168: public Class getIntrospectionClass() {
169: return SkillsPGImpl.class;
170: }
171:
172: public synchronized boolean hasDataQuality() {
173: return (_real != null) && _real.hasDataQuality();
174: }
175:
176: public synchronized org.cougaar.planning.ldm.dq.DataQuality getDataQuality() {
177: return (_real == null) ? null : (_real.getDataQuality());
178: }
179:
180: // Finalization support
181: private SkillsPG _real = null;
182:
183: public synchronized void finalize(PropertyGroup real) {
184: if (real instanceof SkillsPG) {
185: _real = (SkillsPG) real;
186: notifyAll();
187: } else {
188: throw new IllegalArgumentException(
189: "Finalization with wrong class: " + real);
190: }
191: }
192:
193: private synchronized void waitForFinalize() {
194: while (_real == null) {
195: try {
196: wait();
197: } catch (InterruptedException _ie) {
198: // We should really let waitForFinalize throw InterruptedException
199: Thread.interrupted();
200: }
201: }
202: }
203: }
204: }
|