donaldp 2002/06/08 17:27:26
Modified: containerkit/src/java/org/apache/excalibur/containerkit/metainfo
DependencyDescriptor.java
Log:
Extend FeatureDescriptor
Revision Changes Path
1.10 +7 -70
jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java
Index: DependencyDescriptor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/DependencyDescriptor.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DependencyDescriptor.java 8 Jun 2002 21:40:17 -0000 1.9
+++ DependencyDescriptor.java 9 Jun 2002 00:27:26 -0000 1.10
@@ -8,7 +8,6 @@
package org.apache.excalibur.containerkit.metainfo;
import java.util.Properties;
-import java.util.Enumeration;
/**
* A descriptor that describes dependency information for
@@ -33,13 +32,11 @@
* demands.</p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.9 $ $Date: 2002/06/08 21:40:17 $
+ * @version $Revision: 1.10 $ $Date: 2002/06/09 00:27:26 $
*/
public final class DependencyDescriptor
+ extends FeatureDescriptor
{
-
- private static final String[] EMPTY_SET = new String[0];
-
/**
* The name the component uses to lookup dependency.
*/
@@ -51,15 +48,10 @@
private final ServiceReference m_service;
/**
- * The arbitrary set of attributes associated with Dependency.
- */
- private final Properties m_attributes;
-
- /**
* A reference to the ComponentInfo instance that this descriptor
* is contained by.
*/
- private ComponentInfo m_parent;
+ private ComponentInfo m_parent;
/**
* Constructor a dependency sans Attributes.
@@ -77,7 +69,7 @@
final ServiceReference service,
final Properties attributes )
{
- this( role, service, null, null );
+ this( role, service, attributes, null );
}
/**
@@ -88,13 +80,12 @@
final Properties attributes,
final ComponentInfo parent )
{
+ super( attributes );
m_role = role;
m_service = service;
- m_attributes = attributes;
m_parent = parent;
}
-
/**
* Return the name the component uses to lookup dependency.
*
@@ -106,7 +97,7 @@
}
/**
- * Return the service class/interface descriptor that describes the
+ * Return the service class/interface descriptor that describes the
* dependency must fulfilled by a provider.
*
* @return a reference to service descriptor that describes the
fulfillment
@@ -118,59 +109,7 @@
}
/**
- * Return the attribute for specified key.
- *
- * @return the attribute for specified key.
- */
- public String getAttribute( final String key )
- {
- if( null == m_attributes )
- {
- return null;
- }
- else
- {
- return m_attributes.getProperty( key );
- }
- }
-
- /**
- * Return the attribute for specified key.
- *
- * @return the attribute for specified key.
- */
- public String getAttribute( final String key,
- final String defaultValue )
- {
- if( null == m_attributes )
- {
- return defaultValue;
- }
- else
- {
- return m_attributes.getProperty( key, defaultValue );
- }
- }
-
- /**
- * Returns the set of attribute names available under this descriptor.
- *
- * @return an array of the properties names held by the descriptor.
- */
- public String[] getAttributeNames()
- {
- if( null == m_attributes )
- {
- return EMPTY_SET;
- }
- else
- {
- return (String[]) m_attributes.keySet().toArray( EMPTY_SET );
- }
- }
-
- /**
- * Return the <code>ComponentInfo</code> instance that is the parent of
+ * Return the <code>ComponentInfo</code> instance that is the parent of
* this dependency descriptor.
*
* @return the parent component info instance or null if undefined.
@@ -179,6 +118,4 @@
{
return m_parent;
}
-
-
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>