01: /*
02: * <copyright>
03: *
04: * Copyright 1997-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.planning.ldm;
28:
29: import java.util.Collection;
30:
31: import org.cougaar.planning.ldm.asset.Asset;
32: import org.cougaar.planning.ldm.asset.PropertyGroup;
33:
34: /**
35: * A provider of Asset Properties to the LDM.
36: * @see org.cougaar.planning.ldm.LDMPluginServesLDM
37: **/
38: public interface LatePropertyProvider extends LDMPluginServesLDM {
39: /** Allows the LatePropertyProvider to specify the
40: * classes of PropertyGroup for which it can provide values. <p>
41: *
42: * The return value is a collection of PropertyGroup interfaces handled
43: * by the provider.
44: * The provider will only be called by the LDM for property groups
45: * which have been specified by this method. <p>
46: *
47: * A returned value of null is equivalent to returning a collection
48: * of all property group classes, so the provider will be invoked
49: * on any and all pg classes. An important caveat is that all providers
50: * which explicitly specify a PG will be invoked before any providers
51: * which return a null here. <p>
52: *
53: * This method will be called exactly once during plugin loading.
54: **/
55: Collection getPropertyGroupsProvided();
56:
57: /**
58: * Called by the LDM to request that the property group specified
59: * by the pg parameter should be filled in for the specified asset.
60: * The PG instance created should both be returned and actually
61: * set in the asset. <P>
62: *
63: * The time parameter allows specification of the time point of
64: * interest. The time may be specified as an actual Cougaar time, or
65: * as LdmServesClient.UNSPECIFIED_TIME. <P>
66: *
67: * A LatePropertyProvider may, at its option, fill in other property
68: * groups at the same time or decline to set or provide any value by
69: * returning null. <P>
70: *
71: * The first appropriate LatePropertyProvider to return a non-null
72: * value will prevent any other possibly appropriate ones from being
73: * executed. <p>
74: *
75: * It is important to note that this method could be called from multiple
76: * threads at the same time, so the plugin code must be reentrant and
77: * probably thread-aware.
78: **/
79: PropertyGroup fillPropertyGroup(Asset anAsset, Class pg, long time);
80: }
|