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