1 package org.apache.fulcrum.yaafi.framework.component;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.avalon.framework.configuration.Configuration;
23 import org.apache.avalon.framework.context.Context;
24 import org.apache.avalon.framework.logger.Logger;
25 import org.apache.avalon.framework.parameters.Parameters;
26 import org.apache.avalon.framework.service.ServiceManager;
27
28 /**
29 * This class implements the lifecycle contract of a service component
30 * instance.
31 *
32 * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
33 */
34
35 public interface ServiceComponentLifecycle
36 {
37 /**
38 * Loads the implementaion class.
39 *
40 * @param classLoader the classloader to use for loading the implementation class
41 * @throws ClassNotFoundException loading of the class failed
42 */
43 void loadImplemtationClass(ClassLoader classLoader) throws ClassNotFoundException;
44
45 /**
46 * Incarnates a service component instance.
47 * @throws Exception the operation failed
48 */
49 void incarnate() throws Exception;
50
51 /**
52 * Reconfigures a service component instance
53 * @throws Exception the operation failed
54 */
55 void reconfigure() throws Exception;
56
57 /**
58 * Decommisions a service component instance.
59 * @throws Exception the operation failed
60 */
61 void decommision() throws Exception;
62
63 /**
64 * Dispose a service component instance.
65 */
66 void dispose();
67
68 /**
69 * @return Returns the instance of the singleton
70 * @throws Exception the operation failed
71 */
72 Object getInstance() throws Exception;
73
74 /**
75 * Sets the logger to be used by this component.
76 *
77 * @param logger The logger to set
78 */
79 void setLogger(Logger logger);
80
81 /**
82 * Sets the ServiceManager to be used by this component.
83 *
84 * @param serviceManager The serviceManager to set.
85 */
86 void setServiceManager(ServiceManager serviceManager);
87
88 /**
89 * Sets the Context to be used by this component.
90 *
91 * @param context The context to set.
92 */
93 void setContext(Context context);
94
95 /**
96 * Sets the Configuration to be used by this component.
97 *
98 * @param configuration The configuration to set.
99 */
100 void setConfiguration(Configuration configuration);
101
102 /**
103 * Sets the Parameters to be used by this component.
104 *
105 * @param parameters The paramaters to set.
106 */
107 void setParameters(Parameters parameters);
108 }