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