01: /*
02: *
03: * <copyright>
04: *
05: * Copyright 1997-2004 BBNT Solutions, LLC
06: * under sponsorship of the Defense Advanced Research Projects
07: * Agency (DARPA).
08: *
09: * You can redistribute this software and/or modify it under the
10: * terms of the Cougaar Open Source License as published on the
11: * Cougaar Open Source Website (www.cougaar.org).
12: *
13: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24: *
25: * </copyright>
26: */
27: package org.cougaar.core.component;
28:
29: import java.util.Map;
30:
31: /**
32: * A {@link ViewService} view of a component, providing visibility
33: * into the component's {@link ComponentDescription} and
34: * advertised/obtained services.
35: */
36: public interface ComponentView {
37:
38: /**
39: * Get the unique identifier of this component, which can also be
40: * used to create a component creation-order timeline.
41: */
42: int getId();
43:
44: /**
45: * Get the time in milliseconds when the component was loaded.
46: */
47: long getTimestamp();
48:
49: /**
50: * Get the {@link ComponentDescription}, which includes the
51: * classname.
52: */
53: ComponentDescription getComponentDescription();
54:
55: /**
56: * Get a view of the parent container of this component.
57: */
58: ContainerView getParentView();
59:
60: /**
61: * Get a map of all services advertised by this component via {@link
62: * ServiceBroker#addService}.
63: * <p>
64: * In the standard implementation this is an ordered {@link
65: * java.util.LinkedHashMap} by {@link ServiceView#getId}.
66: *
67: * @return a Map of {@link java.lang.Class}es to {@link
68: * ServiceView}s.
69: */
70: Map getAdvertisedServices();
71:
72: /**
73: * Get a map of obtained service classes {@link
74: * ServiceBroker#getService} to information about that obtained
75: * service.
76: * <p>
77: * In the standard implementation this is an ordered {@link
78: * java.util.LinkedHashMap} by {@link ServiceView#getId}.
79: *
80: * @return a Map of {@link java.lang.Class}es to {@link
81: * ServiceView}s.
82: */
83: Map getObtainedServices();
84: }
|