| 1 |
<!-- |
| 2 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 |
contributor license agreements. See the NOTICE file distributed with |
| 4 |
this work for additional information regarding copyright ownership. |
| 5 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 |
(the "License"); you may not use this file except in compliance with |
| 7 |
the License. You may obtain a copy of the License at |
| 8 |
|
| 9 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
|
| 11 |
Unless required by applicable law or agreed to in writing, software |
| 12 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
See the License for the specific language governing permissions and |
| 15 |
limitations under the License. |
| 16 |
--> |
| 17 |
<html> |
| 18 |
<head> |
| 19 |
<title>Proposal for Service Discovery</title> |
| 20 |
</head> |
| 21 |
<body bgcolor="white"> |
| 22 |
|
| 23 |
<div align="center"> |
| 24 |
<h1>Proposal for <em>Service Discovery</em> Package</h1> |
| 25 |
</div> |
| 26 |
|
| 27 |
<h3>(0) Rationale</h3> |
| 28 |
|
| 29 |
<p>The Discovery Component is about discovering, or finding, |
| 30 |
implementations for pluggable interfaces. |
| 31 |
It provides facilities intantiating classes in general, |
| 32 |
and for lifecycle management of singleton (factory) classes. |
| 33 |
</p> |
| 34 |
<p> |
| 35 |
Fundamentally, Discovery locates classes that implement a given Java interface. |
| 36 |
The discovery pattern, though not necessarily this package, |
| 37 |
is used in many projects including JAXP (SaxParserFactory and others) |
| 38 |
and commons-logging (LogFactory). |
| 39 |
By extracting this pattern, other projects can (re)use it |
| 40 |
and take advantage of improvements to the pattern as Discovery evolves. |
| 41 |
</p> |
| 42 |
<p> |
| 43 |
Discovery improves over previous implementations |
| 44 |
by establishing facilities for working within managed environments. |
| 45 |
These allow configuration and property overrides without appealing |
| 46 |
to the global System properties (which are scoped across an entire JVM). |
| 47 |
</p> |
| 48 |
|
| 49 |
<h3>(1) Scope of the Package</h3> |
| 50 |
|
| 51 |
<p> |
| 52 |
This is not indended to be a replacement to be used strictly by the user, but rather |
| 53 |
a replacement to be used directly by projects. Use by the user is also reasonable, |
| 54 |
but limited due to 'keeping this simple'. In particular, there is no configuration |
| 55 |
for this discovery service, it relies soley on usage patterns. |
| 56 |
</p> |
| 57 |
|
| 58 |
<p> |
| 59 |
Given a java.lang.Class parameter 'package.Class' that represents a |
| 60 |
fundamental service as either an interface, an abstract class |
| 61 |
(or even a regular class), find an implementation of that class: |
| 62 |
<ul> |
| 63 |
<li>Look for system property named 'package.Class', the value of which is the |
| 64 |
name of an implementation.</li> |
| 65 |
<li>Look for a 'local' property named 'package.Class'...</li> |
| 66 |
<li>Attempt JDK 1.3+ style discovery</li> |
| 67 |
<li>Attempt to load a default implementation</li> |
| 68 |
</ul> |
| 69 |
In all cases, verify that the discovered implementation <b>implements</b> |
| 70 |
'package.Class'. |
| 71 |
</p> |
| 72 |
|
| 73 |
<p> |
| 74 |
The package should : |
| 75 |
<ul> |
| 76 |
<li>Have an API which should be as simple to use as possible</li> |
| 77 |
<li>Be based on usage patterns, not specific configuration file</li> |
| 78 |
<li>Represent proper discovery & class-loading principles</li> |
| 79 |
<li>Be reasonably portable across JDK levels (1.1.8+?)</li> |
| 80 |
</ul> |
| 81 |
</p> |
| 82 |
|
| 83 |
<h3>(1.5) Interaction With Other Packages</h3> |
| 84 |
|
| 85 |
<p><em>Services</em> relies on: |
| 86 |
</p> |
| 87 |
|
| 88 |
<ul> |
| 89 |
<li>Java Development Kit (Version 1.1 or later)</li> |
| 90 |
<li>[by design] Nothing Else, particularly anything that would be classified as a 'service'.</li> |
| 91 |
</ul> |
| 92 |
|
| 93 |
<h3>(2) Required Jakarta-Commons Resources</h3> |
| 94 |
|
| 95 |
<ul> |
| 96 |
|
| 97 |
<li>CVS Repository - New directory <code>discovery</code> in the |
| 98 |
<code>jakarta-commons-sandbox</code> CVS repository.</li> |
| 99 |
|
| 100 |
<li>Initial Committers - The list is provided below. </li> |
| 101 |
|
| 102 |
<li>Mailing List - Discussions will take place on the general |
| 103 |
<em>[email protected]</em> mailing list. To help list |
| 104 |
subscribers identify messages of interest, it is suggested that the |
| 105 |
message subject of messages about this component be prefixed with |
| 106 |
[discovery].</li> |
| 107 |
|
| 108 |
<li>Bugzilla - New component "discovery" under the "Commons" product |
| 109 |
category, with appropriate version identifiers as needed.</li> |
| 110 |
|
| 111 |
<li>Jyve FAQ - New category "discovery" (when available).</li> |
| 112 |
</ul> |
| 113 |
|
| 114 |
|
| 115 |
<h3>(4) Initial Committers</h3> |
| 116 |
|
| 117 |
<p>The initial committers on the Service Discovery component shall be:</p> |
| 118 |
|
| 119 |
<ul> |
| 120 |
<li>Richard A. Sitze</li> |
| 121 |
<li>Costin Manoloche</li> |
| 122 |
<li>Craig R. McClanahan</li> |
| 123 |
</ul> |
| 124 |
|
| 125 |
</body> |
| 126 |
</html> |