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