avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/service ServiceException.java
Date Sat, 09 Nov 2002 08:04:54 GMT
donaldp     2002/11/09 00:04:54

  Modified:    src/java/org/apache/avalon/framework/component
                        ComponentException.java
                        WrapperComponentManager.java
               src/java/org/apache/avalon/framework/service
                        ServiceException.java
  Log:
  Deprecate the term role and replace with key for clearer semantics.
  
  Revision  Changes    Path
  1.13      +23 -10    jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java
  
  Index: ComponentException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ComponentException.java	7 Nov 2002 08:35:27 -0000	1.12
  +++ ComponentException.java	9 Nov 2002 08:04:53 -0000	1.13
  @@ -69,7 +69,7 @@
   public class ComponentException
       extends CascadingException
   {
  -    private final String m_role;
  +    private final String m_key;
   
       /**
        * Construct a new <code>ComponentException</code> instance.
  @@ -77,10 +77,12 @@
        * @param message the exception message
        * @param throwable the throwable
        */
  -    public ComponentException( final String role, final String message, final Throwable
throwable )
  +    public ComponentException( final String key,
  +                               final String message,
  +                               final Throwable throwable )
       {
           super( message, throwable );
  -        m_role = role;
  +        m_key = key;
       }
   
       /**
  @@ -111,19 +113,30 @@
        *
        * @param message the exception message
        */
  -    public ComponentException( final String role, final String message )
  +    public ComponentException( final String key, final String message )
       {
  -        this( role, message, null );
  +        this( key, message, null );
       }
   
       /**
  -     * Get the role which let to the exception.  May be null.
  +     * Get the key which let to the exception.  May be null.
        *
  -     * @return The role which let to the exception.
  +     * @return The key which let to the exception.
  +     */
  +    public final String getKey()
  +    {
  +        return m_key;
  +    }
  +
  +    /**
  +     * Get the key which let to the exception.  May be null.
  +     *
  +     * @return The key which let to the exception.
  +     * @deprecated Use getKey instead
        */
       public final String getRole()
       {
  -        return m_role;
  +        return getKey();
       }
   
       /**
  @@ -133,13 +146,13 @@
        */
       public String getMessage()
       {
  -        if( m_role == null )
  +        if( m_key == null )
           {
               return super.getMessage();
           }
           else
           {
  -            return super.getMessage() + " (role [" + m_role + "])";
  +            return super.getMessage() + " (role [" + m_key + "])";
           }
       }
   }
  
  
  
  1.5       +2 -2      jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentManager.java
  
  Index: WrapperComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/WrapperComponentManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WrapperComponentManager.java	7 Nov 2002 15:52:11 -0000	1.4
  +++ WrapperComponentManager.java	9 Nov 2002 08:04:53 -0000	1.5
  @@ -65,7 +65,7 @@
           }
           catch( final ServiceException se )
           {
  -            throw new ComponentException( se.getRole(), se.getMessage(), se.getCause()
);
  +            throw new ComponentException( se.getKey(), se.getMessage(), se.getCause() );
           }
   
           final String message = "Role does not implement the Component " +
  
  
  
  1.12      +18 -8     jakarta-avalon/src/java/org/apache/avalon/framework/service/ServiceException.java
  
  Index: ServiceException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/service/ServiceException.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ServiceException.java	7 Nov 2002 08:35:29 -0000	1.11
  +++ ServiceException.java	9 Nov 2002 08:04:54 -0000	1.12
  @@ -70,7 +70,7 @@
   public class ServiceException
       extends CascadingException
   {
  -    final private String m_role;
  +    final private String m_key;
   
       /**
        * Construct a new <code>ServiceException</code> instance.
  @@ -90,10 +90,10 @@
        * @param message the exception message
        * @param throwable the throwable
        */
  -    public ServiceException( final String role, final String message, final Throwable throwable
)
  +    public ServiceException( final String key, final String message, final Throwable throwable
)
       {
           super( message, throwable );
  -        m_role = role;
  +        m_key = key;
       }
   
       /**
  @@ -112,17 +112,27 @@
        *
        * @param message the exception message
        */
  -    public ServiceException( final String role, final String message )
  +    public ServiceException( final String key, final String message )
       {
  -        this( role, message, null );
  +        this( key, message, null );
  +    }
  +
  +    /**
  +     * Return the key that caused the exception.
  +     */
  +    public String getKey()
  +    {
  +        return m_key;
       }
   
       /**
        * Return the role that caused the exception
  +     *
  +     * @deprecated Use getKey() instead
        */
       public String getRole()
       {
  -        return m_role;
  +        return getKey();
       }
   
       /**
  @@ -131,13 +141,13 @@
        */
       public String getMessage()
       {
  -        if( m_role == null )
  +        if( m_key == null )
           {
               return super.getMessage();
           }
           else
           {
  -            return super.getMessage() + " (Role='" + m_role + "')";
  +            return super.getMessage() + " (Role='" + m_key + "')";
           }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message