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