rename subsystem to component.
[utils] / system / general / src / main / java / org / wamblee / system / Component.java
1 package org.wamblee.system;
2
3 /**
4  * A component represents a part of a system that requires a 
5  * number of interfaces and provides a number of interfaces. 
6  *
7  * @author Erik Brakkee
8  */
9 public interface Component {
10         
11         /**
12          * Gets the name of the subsystem.
13          * @return Subsystem name. 
14          */
15         String getName();
16
17         /**
18          * Gets a description of the provided interfaces. 
19          * @return Provided interfaces. 
20          */
21         ProvidedInterfaceDescriptor[] getProvidedServices();
22         
23         /**
24          * Gets a description of the required interfaces. 
25          * @return Required interfaces. 
26          */
27         RequiredInterfaceDescriptor[] getRequiredServices();
28
29         
30         /**
31          * Initialises the subsytem by starting all the services that
32          * it described as provided. 
33          * @param aContext Unique name for the subsystem. 
34          * @param aRequiredServices Running services from other 
35          * subsystems that are required by this subsystem. 
36          * @return Services that are running in the subsystem. 
37          */
38         Service[] start(String aContext, Service[] aRequiredServices);
39         
40         /**
41          * Stops a subsystem. 
42          */
43         void stop(); 
44         
45         /**
46          * Gets the list of running services in the subsystem. 
47          * 
48          * This method may only be called after the
49          * {@link #initialize(String, Service[])} has been called. 
50          * @return
51          */
52         Service[] getRunningServices();
53 }