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 LocationSchedulePG.
029: * @see NewLocationSchedulePG
030: * @see LocationSchedulePGImpl
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 LocationSchedulePG extends PropertyGroup, LocalPG {
039: /** A schedule of LocationScheduleElement elements. The semantics of location and overlapping time ranges is not defined. Consumers of the schedule should probably synchronize on the schedule object in order to prevent comodification exceptions. **/
040: Schedule getSchedule();
041:
042: // introspection and construction
043: /** the method of factoryClass that creates this type **/
044: String factoryMethod = "newLocationSchedulePG";
045: /** the (mutable) class type returned by factoryMethod **/
046: String mutableClass = "org.cougaar.planning.ldm.asset.NewLocationSchedulePG";
047: /** the factory class **/
048: Class factoryClass = org.cougaar.planning.ldm.asset.PropertyGroupFactory.class;
049: /** the (immutable) class type returned by domain factory **/
050: Class primaryClass = org.cougaar.planning.ldm.asset.LocationSchedulePG.class;
051: String assetSetter = "setLocationSchedulePG";
052: String assetGetter = "getLocationSchedulePG";
053: /** The Null instance for indicating that the PG definitely has no value **/
054: LocationSchedulePG nullPG = new Null_LocationSchedulePG();
055:
056: /** Null_PG implementation for LocationSchedulePG **/
057: final class Null_LocationSchedulePG implements LocationSchedulePG,
058: Null_PG {
059: public Schedule getSchedule() {
060: throw new UndefinedValueException();
061: }
062:
063: public boolean equals(Object object) {
064: throw new UndefinedValueException();
065: }
066:
067: public Object clone() throws CloneNotSupportedException {
068: throw new CloneNotSupportedException();
069: }
070:
071: public NewPropertyGroup unlock(Object key) {
072: return null;
073: }
074:
075: public PropertyGroup lock(Object key) {
076: return null;
077: }
078:
079: public PropertyGroup lock() {
080: return null;
081: }
082:
083: public PropertyGroup copy() {
084: return null;
085: }
086:
087: public Class getPrimaryClass() {
088: return primaryClass;
089: }
090:
091: public String getAssetGetMethod() {
092: return assetGetter;
093: }
094:
095: public String getAssetSetMethod() {
096: return assetSetter;
097: }
098:
099: public Class getIntrospectionClass() {
100: return LocationSchedulePGImpl.class;
101: }
102:
103: public boolean hasDataQuality() {
104: return false;
105: }
106: }
107:
108: /** Future PG implementation for LocationSchedulePG **/
109: final class Future implements LocationSchedulePG, Future_PG {
110: public Schedule getSchedule() {
111: waitForFinalize();
112: return _real.getSchedule();
113: }
114:
115: public boolean equals(Object object) {
116: waitForFinalize();
117: return _real.equals(object);
118: }
119:
120: public Object clone() throws CloneNotSupportedException {
121: throw new CloneNotSupportedException();
122: }
123:
124: public NewPropertyGroup unlock(Object key) {
125: return null;
126: }
127:
128: public PropertyGroup lock(Object key) {
129: return null;
130: }
131:
132: public PropertyGroup lock() {
133: return null;
134: }
135:
136: public PropertyGroup copy() {
137: return null;
138: }
139:
140: public Class getPrimaryClass() {
141: return primaryClass;
142: }
143:
144: public String getAssetGetMethod() {
145: return assetGetter;
146: }
147:
148: public String getAssetSetMethod() {
149: return assetSetter;
150: }
151:
152: public Class getIntrospectionClass() {
153: return LocationSchedulePGImpl.class;
154: }
155:
156: public synchronized boolean hasDataQuality() {
157: return (_real != null) && _real.hasDataQuality();
158: }
159:
160: // Finalization support
161: private LocationSchedulePG _real = null;
162:
163: public synchronized void finalize(PropertyGroup real) {
164: if (real instanceof LocationSchedulePG) {
165: _real = (LocationSchedulePG) real;
166: notifyAll();
167: } else {
168: throw new IllegalArgumentException(
169: "Finalization with wrong class: " + real);
170: }
171: }
172:
173: private synchronized void waitForFinalize() {
174: while (_real == null) {
175: try {
176: wait();
177: } catch (InterruptedException _ie) {
178: // We should really let waitForFinalize throw InterruptedException
179: Thread.interrupted();
180: }
181: }
182: }
183: }
184: }
|