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