1 package org.apache.turbine.services;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Properties;
23
24 import org.apache.commons.configuration.Configuration;
25
26 /***
27 * <code>Services</code> are <code>Initables</code> that have a name,
28 * and a set of properties.
29 *
30 * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
31 * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
32 * @author <a href="mailto:burton@apache.org">Kevin Burton</a>
33 * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
34 * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
35 * @version $Id: Service.java 534527 2007-05-02 16:10:59Z tv $
36 */
37 public interface Service
38 extends Initable
39 {
40 /*** The name of this service. */
41 String SERVICE_NAME = "Service";
42
43 /***
44 * Provides a Service with a reference to the ServiceBroker that
45 * instantiated this object, so that it can ask for its properties
46 * and access other Services.
47 *
48 * @param broker The ServiceBroker that instantiated this object.
49 */
50 void setServiceBroker(ServiceBroker broker);
51
52 /***
53 * ServiceBroker uses this method to pass a Service its name.
54 * Service uses its name to ask the broker for an apropriate set
55 * of Properties.
56 *
57 * @param name The name of this Service.
58 */
59 void setName(String name);
60
61 /***
62 * Returns the name of this Service.
63 *
64 * @return The name of this Service.
65 */
66 String getName();
67
68 /***
69 * Returns the Properties of this Service. Every Service has at
70 * least one property, which is "classname", containing the name
71 * of the class implementing this service. Note that the service
72 * may chose to alter its properties, therefore they may be
73 * different from those returned by ServiceBroker.
74 *
75 * @return The properties of this Service.
76 */
77 Properties getProperties();
78
79 /***
80 * Returns the Configuration of this Service. Every Service has at
81 * least one property, which is "classname", containing the name
82 * of the class implementing this service. Note that the service
83 * may chose to alter its configuration, therefore they may be
84 * different from those returned by ServiceBroker.
85 *
86 * @return The Configuration of this Service.
87 */
88 Configuration getConfiguration();
89 }