Revision 5311
Added by daigle over 14 years ago
service-base.html | ||
---|---|---|
57 | 57 |
</div> |
58 | 58 |
|
59 | 59 |
<a name="Overview"></a><div class="header1">Overview</div> |
60 |
<p>Metacat is migrating toward a service based architecture. Basically, |
|
61 |
what this means is that any internal service that Metacat provides should be |
|
62 |
represented in a singleton class that extends the BaseService class.</p> |
|
60 |
<p>There is a goal to migrate Metacat to a service based architecture. This |
|
61 |
provides several advantages: </p> |
|
62 |
<ul> |
|
63 |
<li>Cached values can be refreshed via the configuration utility without |
|
64 |
requiring a restart of Metacat.</li> |
|
65 |
<li>Services can be gracefully shut down when Metacat is stopped. For |
|
66 |
instance, the database service can make sure all db requests have completed |
|
67 |
before continuing with shutdown.</li> |
|
68 |
<li>Services can have a common interface to expose MBeans for JMX monitoring |
|
69 |
(see the <a href="http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/">Java Management Extensions</a> page).</li> |
|
70 |
</ul> |
|
63 | 71 |
|
72 |
<p>From a |
|
73 |
|
|
64 | 74 |
<p>There are a few basic questions that can be asked when you are creating a |
65 | 75 |
class to decide if it should be a service.</p> |
66 | 76 |
<ul> |
... | ... | |
99 | 109 |
performs any appropriate state-specific service updates.</li> |
100 | 110 |
<li> refresh() - a package level method that calls refreshable() and doRefresh(). It has |
101 | 111 |
package level access because we only want the ServiceService to be able to refresh the |
102 |
service</li> |
|
112 |
service.</li> |
|
113 |
<li>stop() - Gracefully shut down the service, releasing any resources.</li> |
|
103 | 114 |
</ul> |
104 | 115 |
|
105 | 116 |
<a name="ServiceService"></a><div class="header1">Controling Services With ServiceService Class</div> |
Also available in: Unified diff
Merge 1.9.2 changes back into the trunk