You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Peter Donald <pe...@apache.org> on 2002/06/07 04:33:13 UTC
Re: cvs commit:
jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/con
tainerkit/metainfo ComponentDescriptor.java ComponentInfo.java
DependencyDescriptor.java ServiceDescriptor.java
How about returning String[] instead? (Fits in with way rest of Avalon works)
At 02:22 AM 6/7/2002 +0000, you wrote:
>mcconnell 2002/06/06 19:22:18
>
> Modified:
> containerkit/src/java/org/apache/excalibur/containerkit/metainfo
> ComponentDescriptor.java ComponentInfo.java
> DependencyDescriptor.java ServiceDescriptor.java
> Log:
> updated source to always return an emumeration (eliminated the null
> return value)
>
> Revision Changes Path
> 1.7 +3
> -3
> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java
>
> Index: ComponentDescriptor.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -u -r1.6 -r1.7
> --- ComponentDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6
> +++ ComponentDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7
> @@ -50,7 +50,7 @@
> * </pre>
> *
> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
> - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $
> + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $
> */
> public final class ComponentDescriptor
> {
> @@ -173,13 +173,13 @@
> * Returns the set of attribute names available under this descriptor.
> *
> * @return Enumeration an enumeration of the properties names held
> by the
> - * descriptor. If not properties are defined, a null is returned.
> + * descriptor.
> */
> public Enumeration getAttributeNames()
> {
> if( null == m_attributes )
> {
> - return null;
> + return ComponentInfo.EMPTY_ENUMERATION;
> }
> else
> {
>
>
>
> 1.3 +32
> -1
> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java
>
> Index: ComponentInfo.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -r1.2 -r1.3
> --- ComponentInfo.java 4 Jun 2002 07:46:29 -0000 1.2
> +++ ComponentInfo.java 7 Jun 2002 02:22:17 -0000 1.3
> @@ -7,6 +7,9 @@
> */
> package org.apache.excalibur.containerkit.metainfo;
>
> +import java.util.Enumeration;
> +
> +
> /**
> * This class contains the meta information about a particular
> * component type. It describes;
> @@ -20,10 +23,16 @@
> * </ul>
> *
> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
> - * @version $Revision: 1.2 $ $Date: 2002/06/04 07:46:29 $
> + * @version $Revision: 1.3 $ $Date: 2002/06/07 02:22:17 $
> */
> public class ComponentInfo
> {
> +
> + /**
> + * Intrernal utility referecne holding a static empty enumeration.
> + */
> + static final EmptyEnumeration EMPTY_ENUMERATION = new
> EmptyEnumeration();
> +
> private final ComponentDescriptor m_descriptor;
> private final ServiceDescriptor[] m_services;
> private final DependencyDescriptor[] m_dependencies;
> @@ -89,5 +98,27 @@
> }
>
> return null;
> + }
> +
> + private static final class EmptyEnumeration implements Enumeration
> + {
> + /**
> + * Always returns the FALSE value.
> + * @return FALSE
> + */
> + public boolean hasMoreElements()
> + {
> + return false;
> + }
> +
> + /**
> + * Reeturns the next object in the enumeration. The
> impementation alway
> + * returns null.
> + * @return a null value.
> + */
> + public Object nextElement()
> + {
> + return null;
> + }
> }
> }
>
>
>
> 1.6 +3
> -3
> 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.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- DependencyDescriptor.java 7 Jun 2002 01:47:40 -0000 1.5
> +++ DependencyDescriptor.java 7 Jun 2002 02:22:17 -0000 1.6
> @@ -33,7 +33,7 @@
> * demands.</p>
> *
> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
> - * @version $Revision: 1.5 $ $Date: 2002/06/07 01:47:40 $
> + * @version $Revision: 1.6 $ $Date: 2002/06/07 02:22:17 $
> */
> public final class DependencyDescriptor
> {
> @@ -134,13 +134,13 @@
> * Returns the set of attribute names available under this descriptor.
> *
> * @return Enumeration an enumeration of the properties names held
> by the
> - * descriptor. If not properties are defined, a null is returned.
> + * descriptor.
> */
> public Enumeration getAttributeNames()
> {
> if( null == m_attributes )
> {
> - return null;
> + return ComponentInfo.EMPTY_ENUMERATION;
> }
> else
> {
>
>
>
> 1.7 +3
> -3
> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java
>
> Index: ServiceDescriptor.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -u -r1.6 -r1.7
> --- ServiceDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6
> +++ ServiceDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7
> @@ -30,7 +30,7 @@
> * upon to work in all containers.</p>
> *
> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
> - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $
> + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $
> */
> public final class ServiceDescriptor extends AbstractServiceDescriptor
> {
> @@ -104,13 +104,13 @@
> * Returns the set of attribute names available under this descriptor.
> *
> * @return Enumeration an enumeration of the properties names held
> by the
> - * descriptor. If not properties are defined, a null is returned.
> + * descriptor.
> */
> public Enumeration getAttributeNames()
> {
> if( null == m_attributes )
> {
> - return null;
> + return ComponentInfo.EMPTY_ENUMERATION;
> }
> else
> {
>
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/con
tainerkit/metainfo ComponentDescriptor.java ComponentInfo.java DependencyDescriptor.java
ServiceDescriptor.java
Posted by Stephen McConnell <mc...@osm.net>.
Peter Donald wrote:
> How about returning String[] instead? (Fits in with way rest of Avalon
> works)
Updated and committed.
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/con
tainerkit/metainfo ComponentDescriptor.java ComponentInfo.java DependencyDescriptor.java
ServiceDescriptor.java
Posted by Stephen McConnell <mc...@osm.net>.
Peter Donald wrote:
> How about returning String[] instead? (Fits in with way rest of Avalon
> works)
It would be more consitent - but not today!
I'll look into it tommorow.
- Steve.
>
>
> At 02:22 AM 6/7/2002 +0000, you wrote:
>
>> mcconnell 2002/06/06 19:22:18
>>
>> Modified:
>> containerkit/src/java/org/apache/excalibur/containerkit/metainfo
>> ComponentDescriptor.java ComponentInfo.java
>> DependencyDescriptor.java ServiceDescriptor.java
>> Log:
>> updated source to always return an emumeration (eliminated the null
>> return value)
>>
>> Revision Changes Path
>> 1.7 +3 -3
>> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java
>>
>>
>> Index: ComponentDescriptor.java
>> ===================================================================
>> RCS file:
>> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentDescriptor.java,v
>>
>> retrieving revision 1.6
>> retrieving revision 1.7
>> diff -u -r1.6 -r1.7
>> --- ComponentDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6
>> +++ ComponentDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7
>> @@ -50,7 +50,7 @@
>> * </pre>
>> *
>> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
>> - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $
>> + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $
>> */
>> public final class ComponentDescriptor
>> {
>> @@ -173,13 +173,13 @@
>> * Returns the set of attribute names available under this
>> descriptor.
>> *
>> * @return Enumeration an enumeration of the properties names
>> held by the
>> - * descriptor. If not properties are defined, a null is
>> returned.
>> + * descriptor.
>> */
>> public Enumeration getAttributeNames()
>> {
>> if( null == m_attributes )
>> {
>> - return null;
>> + return ComponentInfo.EMPTY_ENUMERATION;
>> }
>> else
>> {
>>
>>
>>
>> 1.3 +32 -1
>> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java
>>
>>
>> Index: ComponentInfo.java
>> ===================================================================
>> RCS file:
>> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ComponentInfo.java,v
>>
>> retrieving revision 1.2
>> retrieving revision 1.3
>> diff -u -r1.2 -r1.3
>> --- ComponentInfo.java 4 Jun 2002 07:46:29 -0000 1.2
>> +++ ComponentInfo.java 7 Jun 2002 02:22:17 -0000 1.3
>> @@ -7,6 +7,9 @@
>> */
>> package org.apache.excalibur.containerkit.metainfo;
>>
>> +import java.util.Enumeration;
>> +
>> +
>> /**
>> * This class contains the meta information about a particular
>> * component type. It describes;
>> @@ -20,10 +23,16 @@
>> * </ul>
>> *
>> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
>> - * @version $Revision: 1.2 $ $Date: 2002/06/04 07:46:29 $
>> + * @version $Revision: 1.3 $ $Date: 2002/06/07 02:22:17 $
>> */
>> public class ComponentInfo
>> {
>> +
>> + /**
>> + * Intrernal utility referecne holding a static empty enumeration.
>> + */
>> + static final EmptyEnumeration EMPTY_ENUMERATION = new
>> EmptyEnumeration();
>> +
>> private final ComponentDescriptor m_descriptor;
>> private final ServiceDescriptor[] m_services;
>> private final DependencyDescriptor[] m_dependencies;
>> @@ -89,5 +98,27 @@
>> }
>>
>> return null;
>> + }
>> +
>> + private static final class EmptyEnumeration implements
>> Enumeration
>> + {
>> + /**
>> + * Always returns the FALSE value.
>> + * @return FALSE
>> + */
>> + public boolean hasMoreElements()
>> + {
>> + return false;
>> + }
>> +
>> + /**
>> + * Reeturns the next object in the enumeration. The
>> impementation alway
>> + * returns null.
>> + * @return a null value.
>> + */
>> + public Object nextElement()
>> + {
>> + return null;
>> + }
>> }
>> }
>>
>>
>>
>> 1.6 +3 -3
>> 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.5
>> retrieving revision 1.6
>> diff -u -r1.5 -r1.6
>> --- DependencyDescriptor.java 7 Jun 2002 01:47:40 -0000 1.5
>> +++ DependencyDescriptor.java 7 Jun 2002 02:22:17 -0000 1.6
>> @@ -33,7 +33,7 @@
>> * demands.</p>
>> *
>> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
>> - * @version $Revision: 1.5 $ $Date: 2002/06/07 01:47:40 $
>> + * @version $Revision: 1.6 $ $Date: 2002/06/07 02:22:17 $
>> */
>> public final class DependencyDescriptor
>> {
>> @@ -134,13 +134,13 @@
>> * Returns the set of attribute names available under this
>> descriptor.
>> *
>> * @return Enumeration an enumeration of the properties names
>> held by the
>> - * descriptor. If not properties are defined, a null is
>> returned.
>> + * descriptor.
>> */
>> public Enumeration getAttributeNames()
>> {
>> if( null == m_attributes )
>> {
>> - return null;
>> + return ComponentInfo.EMPTY_ENUMERATION;
>> }
>> else
>> {
>>
>>
>>
>> 1.7 +3 -3
>> jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java
>>
>>
>> Index: ServiceDescriptor.java
>> ===================================================================
>> RCS file:
>> /home/cvs/jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/metainfo/ServiceDescriptor.java,v
>>
>> retrieving revision 1.6
>> retrieving revision 1.7
>> diff -u -r1.6 -r1.7
>> --- ServiceDescriptor.java 7 Jun 2002 01:47:40 -0000 1.6
>> +++ ServiceDescriptor.java 7 Jun 2002 02:22:17 -0000 1.7
>> @@ -30,7 +30,7 @@
>> * upon to work in all containers.</p>
>> *
>> * @author <a href="mailto:peter@apache.org">Peter Donald</a>
>> - * @version $Revision: 1.6 $ $Date: 2002/06/07 01:47:40 $
>> + * @version $Revision: 1.7 $ $Date: 2002/06/07 02:22:17 $
>> */
>> public final class ServiceDescriptor extends
>> AbstractServiceDescriptor
>> {
>> @@ -104,13 +104,13 @@
>> * Returns the set of attribute names available under this
>> descriptor.
>> *
>> * @return Enumeration an enumeration of the properties names
>> held by the
>> - * descriptor. If not properties are defined, a null is
>> returned.
>> + * descriptor.
>> */
>> public Enumeration getAttributeNames()
>> {
>> if( null == m_attributes )
>> {
>> - return null;
>> + return ComponentInfo.EMPTY_ENUMERATION;
>> }
>> else
>> {
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>