1 package net.sf.appstatus.core.services;
2
3 import java.util.List;
4 import java.util.Properties;
5
6 /**
7 * Service manager. Entry point for using services.
8 *
9 * @author Nicolas Richeton
10 *
11 */
12 public interface IServiceManager {
13
14 /**
15 * Get current configuration.
16 *
17 * @return
18 */
19 Properties getConfiguration();
20
21 /**
22 * Returns a monitor for a new service call.
23 *
24 * @param service
25 * @return
26 */
27 IServiceMonitor getMonitor(IService service);
28
29 /**
30 * Create or get the service definition identified by group and name.
31 *
32 * @param name
33 * name of the service.
34 * @param group
35 * group of the service.
36 * @return
37 */
38 IService getService(String name, String group);
39
40 /**
41 * List all current services.
42 *
43 * <p>
44 * Services are defined using #getService(String, String)
45 *
46 * @return
47 */
48 List<IService> getServices();
49
50 /**
51 * Inject configuration for service manager.
52 *
53 * @param configuration
54 */
55 void setConfiguration(Properties configuration);
56
57 }