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.lib.callback;
28:
29: import org.cougaar.core.blackboard.IncrementalSubscription;
30:
31: /**
32: * <pre>
33: * Root interface for filter callbacks.
34: *
35: * Filter callbacks encapsulate two ideas : 1) that we filter for
36: * some object in the space of cluster objects and 2) we want to be logger.informed
37: * when new/changed/deleted things match the filter.
38: *
39: * There are generally listener interfaces for every callback.
40: * Very simple callbacks may not have an explicit listener class
41: * paired with it. And some callback classes share a listener class.
42: *
43: * The interface doesn't require a listener, but the adapter does.
44: * </pre>
45: */
46:
47: public interface UTILFilterCallback {
48: /**
49: * used by plugins to ask the subscription direct questions,
50: * like "give me all your elements."
51: * @see org.cougaar.lib.filter.UTILAllocatorPluginAdapter#getAssets ()
52: */
53: IncrementalSubscription getSubscription();
54:
55: /**
56: * The filter has matched something, this defines what to do
57: * next.
58: */
59: void reactToChangedFilter();
60:
61: // void setExtraDebug (boolean d);
62:
63: /**
64: * Set to true if you want to see when the container changes in
65: * ways that *don't* notify the listener.
66: *
67: * (This can make you feel better, since interestingXXX calls are
68: * made even on objects that are about to disappear from your
69: * container. This can let you know that it's OK that even though
70: * the listener finds the object interesting, it's not being acted
71: * upon.)
72: */
73: // void setExtraExtraDebug (boolean d);
74: }
|