mcconnell 2002/09/13 07:32:22
Modified: meta/src/java/org/apache/excalibur/meta
ConfigurationBuilder.java example-service.xml
type.dtd
meta/src/java/org/apache/excalibur/meta/info/builder
XMLTypeCreator.java
Log:
Updated DTD to use "info" element in preference to "component" element as
the work "component" appears in the general container descriptor and is a
potential source of consusion. Secondly, the "component" element at a type
level is not defining a component but is instead defining information about
the
type. Changes are bakward compatible and do not require a version change.
Revision Changes Path
1.6 +4 -4
jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/ConfigurationBuilder.java
Index: ConfigurationBuilder.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/ConfigurationBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ConfigurationBuilder.java 12 Sep 2002 05:35:33 -0000 1.5
+++ ConfigurationBuilder.java 13 Sep 2002 14:32:22 -0000 1.6
@@ -29,13 +29,13 @@
private static final DTDInfo[] c_dtdInfo = new DTDInfo[]
{
new DTDInfo( "-//AVALON/Component Type DTD Version 1.0//EN",
- "http://jakarta.apache.org/avalon/dtds/type_1_0.dtd",
+
"http://jakarta.apache.org/avalon/dtds/meta/type_1_0.dtd",
"org/apache/excalibur/meta/type.dtd" ),
new DTDInfo( "-//AVALON/Component Type DTD Version 1.1//EN",
- "http://jakarta.apache.org/avalon/dtds/type_1_1.dtd",
+
"http://jakarta.apache.org/avalon/dtds/meta/type_1_1.dtd",
"org/apache/excalibur/meta/type.dtd" ),
new DTDInfo( "-//AVALON/Service DTD Version 1.0//EN",
- "http://jakarta.apache.org/avalon/dtds/service_1_0.dtd",
+
"http://jakarta.apache.org/avalon/dtds/meta/service_1_0.dtd",
"org/apache/excalibur/meta/service.dtd" ),
new DTDInfo( "-//PHOENIX/Block Info DTD Version 1.0//EN",
"http://jakarta.apache.org/avalon/dtds/phoenix/blockinfo_1.0.dtd",
1.3 +1 -1
jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/example-service.xml
Index: example-service.xml
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/example-service.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- example-service.xml 12 Sep 2002 08:07:43 -0000 1.2
+++ example-service.xml 13 Sep 2002 14:32:22 -0000 1.3
@@ -1,6 +1,6 @@
<!DOCTYPE type
PUBLIC "-//AVALON/Service DTD Version 1.0//EN"
- "http://jakarta.apache.org/avalon/dtds/service_1_0.dtd" >
+ "http://jakarta.apache.org/avalon/dtds/meta/service_1_0.dtd" >
<!--
This is an example of a service description. Normally this file will be
included in a jar file colocated with the interface class under the name
[classname].xservice. The DOCTYPE identifier shall normally include the URL
http://jakarta.apache.org/avalon/dtds/service_1_0.dtd.
1.4 +24 -8
jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/type.dtd
Index: type.dtd
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/type.dtd,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- type.dtd 12 Sep 2002 15:09:40 -0000 1.3
+++ type.dtd 13 Sep 2002 14:32:22 -0000 1.4
@@ -24,18 +24,32 @@
<!--
A type element is the document root, it defines:
-component the specifc details about this component
-loggers the loggers used by this component
-context the context required by this component
-services the services offered by this component
-dependencies the services that this component require to operate
-stages the lifecycle stage extensions that this component is depenent
on
-extensions the lifecycle extensions that this component provides
+info the specific details about this component type
+loggers the loggers used by this component type
+context the context required by this component type
+services the services offered by this component type
+dependencies the services that this component type require to operate
+stages the lifecycle stage extensions that this component type is
depenent on
+extensions the lifecycle extensions that this component type provides
controls the set of management control points
-->
-<!ELEMENT type (component, loggers?, context?, services?, dependencies?,
stages?, extensions?)>
+<!ELEMENT type ( (component|info), loggers?, context?, services?,
dependencies?, stages?, extensions?)>
+
+<!--
+The info element describes the component, it defines:
+
+name the human readable name of component type. Must be a string
+ containing alphanumeric characters, '.', '_' and starting
+ with a letter.
+version the version of the component in (in the format #.#.#, #.#
or # where
+ # is a integer
+-->
+<!ELEMENT info (name?,version,attributes?)>
+ <!ELEMENT name (#PCDATA) >
+ <!ELEMENT version (#PCDATA) >
+
<!--
The component element describes the component, it defines:
@@ -45,6 +59,8 @@
with a letter.
version the version of the component in (in the format #.#.#, #.#
or # where
# is a integer
+
+This is a deprecated element - use "info" instead.
-->
<!ELEMENT component (name?,version,attributes?)>
<!ELEMENT name (#PCDATA) >
1.7 +13 -2
jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLTypeCreator.java
Index: XMLTypeCreator.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/meta/src/java/org/apache/excalibur/meta/info/builder/XMLTypeCreator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLTypeCreator.java 12 Sep 2002 15:09:40 -0000 1.6
+++ XMLTypeCreator.java 13 Sep 2002 14:32:22 -0000 1.7
@@ -102,7 +102,18 @@
Configuration configuration = null;
- configuration = info.getChild( "component" );
+ //
+ // changed the information block from "component" to "info" to
+ // avaiod confusion with the "component" elemement defintion in the
+ // meta-data level - change is backward compatible
+ //
+
+ configuration = info.getChild( "info", null );
+ if( configuration == null )
+ {
+ configuration = info.getChild( "component" );
+ }
+
final ComponentDescriptor descriptor =
buildComponentDescriptor( classname, configuration );
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>