avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager UserManagerInterface.java PropertiesUserManager.java LdapUserManager.java DbUserManager.java AbstractUserManager.java
Date Sun, 10 Mar 2002 06:09:36 GMT
rana_b      02/03/09 22:09:36

  Modified:    ftpserver/src/java/org/apache/avalon/ftpserver/usermanager
                        UserManagerInterface.java
                        PropertiesUserManager.java LdapUserManager.java
                        DbUserManager.java AbstractUserManager.java
  Log:
  properly disposing resources
  
  Revision  Changes    Path
  1.2       +1 -6      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/UserManagerInterface.java
  
  Index: UserManagerInterface.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/UserManagerInterface.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UserManagerInterface.java	6 Mar 2002 14:25:41 -0000	1.1
  +++ UserManagerInterface.java	10 Mar 2002 06:09:36 -0000	1.2
  @@ -59,11 +59,6 @@
       /**
        * Load the user data again
        */ 
  -    void reload() throws Exception;
  -    
  -    /**
  -     * Close the user manager
  -     */    
  -    void close();      
  +    void reload() throws Exception;      
   
   } 
  
  
  
  1.6       +2 -1      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/PropertiesUserManager.java
  
  Index: PropertiesUserManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/PropertiesUserManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PropertiesUserManager.java	6 Mar 2002 14:25:41 -0000	1.5
  +++ PropertiesUserManager.java	10 Mar 2002 06:09:36 -0000	1.6
  @@ -261,7 +261,8 @@
       /**
        * Close the user manager - remove existing entries.
        */
  -    public void close() {
  +    public void dispose() {
  +        getLogger().info("Closing properties user manager...");
           if (mUserData != null) {
               mUserData.clear();
               mUserData = null;
  
  
  
  1.6       +2 -9      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/LdapUserManager.java
  
  Index: LdapUserManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/LdapUserManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LdapUserManager.java	6 Mar 2002 14:25:41 -0000	1.5
  +++ LdapUserManager.java	10 Mar 2002 06:09:36 -0000	1.6
  @@ -330,7 +330,8 @@
       /**
        * Close user manager
        */
  -    public synchronized void close() {
  +    public synchronized void dispose() {
  +        getLogger().info("Closing ldap user manager...");
           if (mAdminContext != null) {
               try {
                   mAdminContext.close();
  @@ -339,14 +340,6 @@
               }
               mAdminContext = null;
           }
  -    }
  -
  -    /**
  -     * Last defense to release resources.
  -     */
  -    protected void finalize() throws Throwable {
  -        close();
  -        super.finalize();
       }
       
       // static block
  
  
  
  1.7       +2 -10     jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/DbUserManager.java
  
  Index: DbUserManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/DbUserManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DbUserManager.java	6 Mar 2002 14:25:40 -0000	1.6
  +++ DbUserManager.java	10 Mar 2002 06:09:36 -0000	1.7
  @@ -307,7 +307,8 @@
       /**
        * Close this user manager. Close the database statements and connection.
        */
  -    public synchronized void close() {
  +    public synchronized void dispose() {
  +        getLogger().info("Closing database user manager...");
           if (mNewUserStmt != null) {
               try {mNewUserStmt.close(); } catch(SQLException ex) {}
               mNewUserStmt = null;
  @@ -339,15 +340,6 @@
           }
       }
           
  -
  -    /**
  -     * Last defense to close this user manager.
  -     */
  -    protected void finalize() throws Throwable {
  -        close();
  -        super.finalize();
  -    } 
  -    
   }
   
   
  
  
  
  1.2       +5 -2      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/AbstractUserManager.java
  
  Index: AbstractUserManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/usermanager/AbstractUserManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractUserManager.java	6 Mar 2002 14:25:40 -0000	1.1
  +++ AbstractUserManager.java	10 Mar 2002 06:09:36 -0000	1.2
  @@ -13,6 +13,7 @@
   
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.activity.Disposable;
   
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -38,7 +39,8 @@
                                                 Contextualizable, 
                                                 Composable, 
                                                 Configurable, 
  -                                              Initializable {
  +                                              Initializable,
  +                                              Disposable {
      
       protected Configuration mConfig;
       protected BlockContext mBlockContext;
  @@ -105,7 +107,8 @@
       /**
        * Close user manager - dummy implementation.
        */
  -    public void close() {
  +    public void dispose() {
  +        getLogger().info("Closing user manager...");
       }
   
   }
  
  
  

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