donaldp 2002/09/07 21:32:51
Modified: info/src/java/org/apache/avalon/framework/info
ComponentInfo.java DependencyDescriptor.java
info/src/java/org/apache/avalon/framework/tools/infobuilder
Resources.properties XMLInfoCreator.java
componentinfo.dtd
Log:
<role/> --> <key/>
Revision Changes Path
1.2 +2 -2
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentInfo.java
Index: ComponentInfo.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/ComponentInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ComponentInfo.java 31 Aug 2002 08:17:00 -0000 1.1
+++ ComponentInfo.java 8 Sep 2002 04:32:51 -0000 1.2
@@ -133,7 +133,7 @@
{
for( int i = 0; i < m_dependencies.length; i++ )
{
- if( m_dependencies[ i ].getRole().equals( role ) )
+ if( m_dependencies[ i ].getKey().equals( role ) )
{
return m_dependencies[ i ];
}
1.2 +10 -10
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java
Index: DependencyDescriptor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/DependencyDescriptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DependencyDescriptor.java 31 Aug 2002 08:17:00 -0000 1.1
+++ DependencyDescriptor.java 8 Sep 2002 04:32:51 -0000 1.2
@@ -41,7 +41,7 @@
/**
* The name the component uses to lookup dependency.
*/
- private final String m_role;
+ private final String m_key;
/**
* The service class/interface that the dependency must provide.
@@ -65,16 +65,16 @@
/**
* Constructor that has all parts sans parent.
*/
- public DependencyDescriptor( final String role,
+ public DependencyDescriptor( final String key,
final ServiceDesignator service,
final boolean optional,
final Properties attributes )
{
super( attributes );
- if( null == role )
+ if( null == key )
{
- throw new NullPointerException( "role" );
+ throw new NullPointerException( "key" );
}
if( null == service )
@@ -82,19 +82,19 @@
throw new NullPointerException( "service" );
}
- m_role = role;
+ m_key = key;
m_service = service;
m_optional = optional;
}
/**
- * Return the name the component uses to lookup dependency.
+ * Return the key the component uses to lookup dependency.
*
- * @return the name the component uses to lookup dependency.
+ * @return the key the component uses to lookup dependency.
*/
- public String getRole()
+ public String getKey()
{
- return m_role;
+ return m_key;
}
/**
1.2 +1 -1
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/Resources.properties
Index: Resources.properties
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/Resources.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Resources.properties 31 Aug 2002 08:17:01 -0000 1.1
+++ Resources.properties 8 Sep 2002 04:32:51 -0000 1.2
@@ -1,4 +1,4 @@
-builder.redundent-role.notice=Warning: ComponentInfo for class {0} redundently
specifies role name "{1}" in dependency when it is identical to the name of service.
It is recomended that the <role/> section be elided.
+builder.redundent-key.notice=Warning: ComponentInfo for class {0} redundently
specifies key name "{1}" in dependency when it is identical to the name of service. It
is recomended that the <key/> section be elided.
builder.creating-info.notice=Creating a ComponentInfo for class "{0}".
builder.created-info.notice=Constructed ComponentInfo object for class {0}.
ComponentInfo contains {1} services, {2} dependencies, {3} context entrys and {4}
loggers.
builder.bad-toplevel-element.error=Error the component implemented by "{0}" has an
invalid element at top level of component info descriptor. Expected: "component-info".
Actual: "{1}"
1.3 +10 -10
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoCreator.java
Index: XMLInfoCreator.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/XMLInfoCreator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLInfoCreator.java 8 Sep 2002 03:35:20 -0000 1.2
+++ XMLInfoCreator.java 8 Sep 2002 04:32:51 -0000 1.3
@@ -209,28 +209,28 @@
final Properties attributes =
buildAttributes( dependency.getChild( "attributes" ) );
- String role = dependency.getChild( "role" ).getValue( null );
+ String key = dependency.getChild( "key" ).getValue( null );
- //default to name of service if role unspecified
- if( null == role )
+ //default to name of service if key unspecified
+ if( null == key )
{
- role = service.getClassname();
+ key = service.getClassname();
}
else
{
- //If role is specified and it is the same as
+ //If key is specified and it is the same as
//service name then warn that it is redundent.
- if( role.equals( service.getClassname() ) )
+ if( key.equals( service.getClassname() ) )
{
final String message =
- REZ.getString( "builder.redundent-role.notice",
+ REZ.getString( "builder.redundent-key.notice",
classname,
- role );
+ key );
getLogger().warn( message );
}
}
- return new DependencyDescriptor( role, service, optional, attributes );
+ return new DependencyDescriptor( key, service, optional, attributes );
}
/**
1.3 +4 -5
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/componentinfo.dtd
Index: componentinfo.dtd
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/tools/infobuilder/componentinfo.dtd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- componentinfo.dtd 8 Sep 2002 03:35:20 -0000 1.2
+++ componentinfo.dtd 8 Sep 2002 04:32:51 -0000 1.3
@@ -89,14 +89,13 @@
The service dependency describes a service that the component
requires. It defines:
-role the role of the service. This is the value that is used to lookup the
- service in the ComponentManager. If not provided it defaults to the
- value specified in the name attribute of service element
+key the key used to lookup service. If not provided it defaults
+ to the value specified in the name attribute of service element
service-ref the service that is required
-->
-<!ELEMENT dependency (role?,service-ref,attributes?) >
+<!ELEMENT dependency (key?,service-ref,attributes?) >
<!ATTLIST dependency optional CDATA #IMPLIED >
- <!ELEMENT role (#PCDATA) >
+ <!ELEMENT key (#PCDATA) >
<!--
The loggers element contains a list of loggers that component uses.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>