avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/connection DefaultConnectionManager.java
Date Wed, 15 Jan 2003 11:24:40 GMT
mcconnell    2003/01/15 03:24:39

  Modified:    src/java/org/apache/avalon/cornerstone/blocks/connection
                        DefaultConnectionManager.java
  Log:
  Improvement to logging and error messages.
  
  Revision  Changes    Path
  1.23      +15 -7     jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/connection/DefaultConnectionManager.java
  
  Index: DefaultConnectionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/src/java/org/apache/avalon/cornerstone/blocks/connection/DefaultConnectionManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DefaultConnectionManager.java	17 Aug 2002 02:24:24 -0000	1.22
  +++ DefaultConnectionManager.java	15 Jan 2003 11:24:39 -0000	1.23
  @@ -45,6 +45,10 @@
   
       public void dispose()
       {
  +        if( getLogger().isDebugEnabled() )
  +        {
  +            getLogger().debug( "disposal" );
  +        }
           final String[] names = (String[])m_connections.keySet().toArray( new String[ 0
] );
           for( int i = 0; i < names.length; i++ )
           {
  @@ -139,14 +143,18 @@
           throws Exception
       {
           final Connection connection = (Connection)m_connections.remove( name );
  -        if( null == connection )
  +
  +        if( connection != null )
           {
  -            final String message =
  -                "No such connection with name " + name;
  -            throw new IllegalArgumentException( message );
  +            //TODO: Stop ignoring tearDown
  +            connection.dispose();
  +        }
  +        else
  +        {
  +            final String error = 
  +               "Invalid request for the disconnection of an unrecognized connection name:
" 
  +               + name;
  +            throw new IllegalArgumentException( error );
           }
  -
  -        //TODO: Stop ignoring tearDown
  -        connection.dispose();
       }
   }
  
  
  

--
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