james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-james/src/org/apache/james/core AvalonMailStore.java AvalonUsersStore.java MailetConfigImpl.java
Date Mon, 05 Mar 2001 15:14:30 GMT
donaldp     01/03/05 07:14:29

  Modified:    src/org/apache/james/core AvalonMailStore.java
                        AvalonUsersStore.java MailetConfigImpl.java
  Log:
  Updated to non-deprecated Configuration
  
  Submitted By: "Eung-ju Park" <colus@isoft.co.kr>
  
  Revision  Changes    Path
  1.5       +22 -15    jakarta-james/src/org/apache/james/core/AvalonMailStore.java
  
  Index: AvalonMailStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/AvalonMailStore.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AvalonMailStore.java	2001/03/01 13:53:58	1.4
  +++ AvalonMailStore.java	2001/03/05 15:14:19	1.5
  @@ -18,9 +18,9 @@
   import org.apache.avalon.ComponentManagerException;
   import org.apache.avalon.Composer;
   import org.apache.avalon.ComponentManager;
  -import org.apache.avalon.Configurable;
  -import org.apache.avalon.Configuration;
  -import org.apache.avalon.ConfigurationException;
  +import org.apache.avalon.configuration.Configurable;
  +import org.apache.avalon.configuration.Configuration;
  +import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.avalon.Initializable;
   import org.apache.james.services.MailRepository;
   import org.apache.james.services.MailStore;
  @@ -63,9 +63,10 @@
           repositories = new HashMap();
           models = new HashMap();
           classes = new HashMap();
  -        Iterator registeredClasses = configuration.getChild("repositories").getChildren("repository");
  -        while (registeredClasses.hasNext()) {
  -            registerRepository((Configuration) registeredClasses.next());
  +        Configuration[] registeredClasses = configuration.getChild("repositories").getChildren("repository");
  +        for ( int i = 0; i < registeredClasses.length; i++ )
  +        {
  +            registerRepository((Configuration) registeredClasses[i]);
           }
           getLogger().info("James RepositoryManager ...init");
       }
  @@ -73,15 +74,21 @@
       public void registerRepository(Configuration repConf) throws ConfigurationException
{
           String className = repConf.getAttribute("class");
           getLogger().info("Registering Repository " + className);
  -        Iterator protocols = repConf.getChild("protocols").getChildren("protocol");
  -        Iterator types = repConf.getChild("types").getChildren("type");
  -        Iterator models = repConf.getChild("models").getChildren("model");
  -        while (protocols.hasNext()) {
  -            String protocol = ((Configuration) protocols.next()).getValue();
  -            while (types.hasNext()) {
  -                String type = ((Configuration) types.next()).getValue();
  -                while (models.hasNext()) {
  -                    String model = ((Configuration) models.next()).getValue();
  +        Configuration[] protocols = repConf.getChild("protocols").getChildren("protocol");
  +        Configuration[] types = repConf.getChild("types").getChildren("type");
  +        Configuration[] models = repConf.getChild("models").getChildren("model");
  +        for ( int i = 0; i < protocols.length; i++ )
  +        {
  +            final String protocol = protocols[i].getValue();
  +
  +            for ( int j = 0; j < types.length; j++ )
  +            {
  +                final String type = types[i].getValue();
  +
  +                for ( int k = 0; k < models.length; k++ )
  +                {
  +                    final String model = models[i].getValue();
  +
                       classes.put(protocol + type + model, className);
                       getLogger().info("   for " + protocol + "," + type + "," + model);
                   }
  
  
  
  1.5       +7 -6      jakarta-james/src/org/apache/james/core/AvalonUsersStore.java
  
  Index: AvalonUsersStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/AvalonUsersStore.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AvalonUsersStore.java	2001/03/05 11:45:20	1.4
  +++ AvalonUsersStore.java	2001/03/05 15:14:22	1.5
  @@ -16,9 +16,9 @@
   import org.apache.avalon.ComponentManager;
   import org.apache.avalon.ComponentManagerException;
   import org.apache.avalon.Composer;
  -import org.apache.avalon.Configurable;
  -import org.apache.avalon.Configuration;
  -import org.apache.avalon.ConfigurationException;
  +import org.apache.avalon.configuration.Configurable;
  +import org.apache.avalon.configuration.Configuration;
  +import org.apache.avalon.configuration.ConfigurationException;
   import org.apache.avalon.Initializable;
   import org.apache.james.services.UsersRepository;
   import org.apache.james.services.UsersStore;
  @@ -52,9 +52,10 @@
           getLogger().info("AvalonUsersStore init...");
           repositories = new HashMap();
        
  -        Iterator repConfs = configuration.getChildren("repository");
  -        while (repConfs.hasNext()) {
  -            Configuration repConf = (Configuration) repConfs.next();
  +        Configuration[] repConfs = configuration.getChildren("repository");
  +        for ( int i = 0; i < repConfs.length; i++ )
  +        {
  +            Configuration repConf = repConfs[i];
               String repName = repConf.getAttribute("name");
               String repClass = repConf.getAttribute("class");
   
  
  
  
  1.4       +7 -4      jakarta-james/src/org/apache/james/core/MailetConfigImpl.java
  
  Index: MailetConfigImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/org/apache/james/core/MailetConfigImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MailetConfigImpl.java	2001/02/03 18:21:22	1.3
  +++ MailetConfigImpl.java	2001/03/05 15:14:23	1.4
  @@ -14,8 +14,8 @@
   import javax.mail.*;
   import javax.mail.internet.*;
   import org.apache.mailet.*;
  -import org.apache.avalon.Configuration;
  -import org.apache.avalon.ConfigurationException;
  +import org.apache.avalon.configuration.Configuration;
  +import org.apache.avalon.configuration.ConfigurationException;
   
   /**
    *
  @@ -36,13 +36,16 @@
       public String getInitParameter(String name) {
   	try {
   	    String result = null;
  -	    for (Iterator it = configuration.getChildren(name); it.hasNext(); ) {
  +
  +            final Configuration[] values = configuration.getChildren( name );
  +            for ( int i = 0; i < values.length; i++ )
  +            {
   		if (result == null) {
   		    result = "";
   		} else {
   		    result += ",";
   		}
  -		Configuration conf = (Configuration)it.next();
  +		Configuration conf = values[i];
   		result += conf.getValue();
   	    }
   	    return result;
  
  
  

Mime
View raw message