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 ItemIdentificationPG.
029: * Identification of a unique, actual Asset, e.g. by VIN, SSN, etc.
030: * @see NewItemIdentificationPG
031: * @see ItemIdentificationPGImpl
032: **/package org.cougaar.planning.ldm.asset;
033:
034: import org.cougaar.planning.ldm.measure.*;
035: import org.cougaar.planning.ldm.asset.*;
036: import org.cougaar.planning.ldm.plan.*;
037: import java.util.*;
038:
039: public interface ItemIdentificationPG extends PropertyGroup {
040: /** A String of the form "<type>/<id>", e.g. "SN/105G13F7YM0G" **/
041: String getItemIdentification();
042:
043: /** A String describing the Asset in human-readable form. **/
044: String getNomenclature();
045:
046: /** Not to be used as MessageAddress. Use ClusterPG.getMessageAddress() instead. **/
047: String getAlternateItemIdentification();
048:
049: // introspection and construction
050: /** the method of factoryClass that creates this type **/
051: String factoryMethod = "newItemIdentificationPG";
052: /** the (mutable) class type returned by factoryMethod **/
053: String mutableClass = "org.cougaar.planning.ldm.asset.NewItemIdentificationPG";
054: /** the factory class **/
055: Class factoryClass = org.cougaar.planning.ldm.asset.PropertyGroupFactory.class;
056: /** the (immutable) class type returned by domain factory **/
057: Class primaryClass = org.cougaar.planning.ldm.asset.ItemIdentificationPG.class;
058: String assetSetter = "setItemIdentificationPG";
059: String assetGetter = "getItemIdentificationPG";
060: /** The Null instance for indicating that the PG definitely has no value **/
061: ItemIdentificationPG nullPG = new Null_ItemIdentificationPG();
062:
063: /** Null_PG implementation for ItemIdentificationPG **/
064: final class Null_ItemIdentificationPG implements
065: ItemIdentificationPG, Null_PG {
066: public String getItemIdentification() {
067: throw new UndefinedValueException();
068: }
069:
070: public String getNomenclature() {
071: throw new UndefinedValueException();
072: }
073:
074: public String getAlternateItemIdentification() {
075: throw new UndefinedValueException();
076: }
077:
078: public boolean equals(Object object) {
079: throw new UndefinedValueException();
080: }
081:
082: public Object clone() throws CloneNotSupportedException {
083: throw new CloneNotSupportedException();
084: }
085:
086: public NewPropertyGroup unlock(Object key) {
087: return null;
088: }
089:
090: public PropertyGroup lock(Object key) {
091: return null;
092: }
093:
094: public PropertyGroup lock() {
095: return null;
096: }
097:
098: public PropertyGroup copy() {
099: return null;
100: }
101:
102: public Class getPrimaryClass() {
103: return primaryClass;
104: }
105:
106: public String getAssetGetMethod() {
107: return assetGetter;
108: }
109:
110: public String getAssetSetMethod() {
111: return assetSetter;
112: }
113:
114: public Class getIntrospectionClass() {
115: return ItemIdentificationPGImpl.class;
116: }
117:
118: public boolean hasDataQuality() {
119: return false;
120: }
121: }
122:
123: /** Future PG implementation for ItemIdentificationPG **/
124: final class Future implements ItemIdentificationPG, Future_PG {
125: public String getItemIdentification() {
126: waitForFinalize();
127: return _real.getItemIdentification();
128: }
129:
130: public String getNomenclature() {
131: waitForFinalize();
132: return _real.getNomenclature();
133: }
134:
135: public String getAlternateItemIdentification() {
136: waitForFinalize();
137: return _real.getAlternateItemIdentification();
138: }
139:
140: public boolean equals(Object object) {
141: waitForFinalize();
142: return _real.equals(object);
143: }
144:
145: public Object clone() throws CloneNotSupportedException {
146: throw new CloneNotSupportedException();
147: }
148:
149: public NewPropertyGroup unlock(Object key) {
150: return null;
151: }
152:
153: public PropertyGroup lock(Object key) {
154: return null;
155: }
156:
157: public PropertyGroup lock() {
158: return null;
159: }
160:
161: public PropertyGroup copy() {
162: return null;
163: }
164:
165: public Class getPrimaryClass() {
166: return primaryClass;
167: }
168:
169: public String getAssetGetMethod() {
170: return assetGetter;
171: }
172:
173: public String getAssetSetMethod() {
174: return assetSetter;
175: }
176:
177: public Class getIntrospectionClass() {
178: return ItemIdentificationPGImpl.class;
179: }
180:
181: public synchronized boolean hasDataQuality() {
182: return (_real != null) && _real.hasDataQuality();
183: }
184:
185: // Finalization support
186: private ItemIdentificationPG _real = null;
187:
188: public synchronized void finalize(PropertyGroup real) {
189: if (real instanceof ItemIdentificationPG) {
190: _real = (ItemIdentificationPG) real;
191: notifyAll();
192: } else {
193: throw new IllegalArgumentException(
194: "Finalization with wrong class: " + real);
195: }
196: }
197:
198: private synchronized void waitForFinalize() {
199: while (_real == null) {
200: try {
201: wait();
202: } catch (InterruptedException _ie) {
203: // We should really let waitForFinalize throw InterruptedException
204: Thread.interrupted();
205: }
206: }
207: }
208: }
209: }
|