1 package org.apache.fulcrum.yaafi.framework.container;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import org.apache.avalon.framework.configuration.ConfigurationException;
24 import org.apache.avalon.framework.service.ServiceException;
25 import org.apache.fulcrum.yaafi.framework.role.RoleEntry;
26
27 /**
28 * Interface for managing the lifecycle of services. It provides
29 * methods to get
30 *
31 * <ul>
32 * <li>metadata about the service components</li>
33 * <li>reconfiguring a single service</li>
34 * <li>decommissioning a signle service</li>
35 * </ul>
36 *
37 * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
38 */
39
40 public interface ServiceLifecycleManager
41 {
42 /**
43 * Get a RoleEntryImpl for a given service
44 *
45 * @param name the name of the service component
46 * @return the RoleEntryImpl
47 * @throws ServiceException the service was not found
48 */
49 RoleEntry getRoleEntry( String name )
50 throws ServiceException;
51
52 /**
53 * Get a list of all RoleEntries.
54 *
55 * @return a list of RoleEntries
56 */
57 RoleEntry[] getRoleEntries();
58
59 /**
60 * Reconfigures a set of services by calling Suspendable.suspend(),
61 * Reconfigurable.reconfigure() and Suspendable.resume().
62 *
63 * @param names the set of services to be reconfigured
64 * @exception ServiceException one of the service was not found
65 * @throws ConfigurationException the reconfiguration failed
66 */
67 void reconfigure( String[] names )
68 throws ServiceException, ConfigurationException;
69
70 /**
71 * Decommision the given service by calling Startable.stop()
72 * and Disposable.dispose().
73 *
74 * The state of the service component is the same as using lazy
75 * initialization. Therefore a new service instance will be created
76 * if the service is reused again. If you are keeping an instance
77 * of the service you are out of luck.
78 *
79 * @param name the name of the service
80 * @exception ServiceException the service was not found
81 */
82 void decommision( String name )
83 throws ServiceException;
84 }