james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1050601 - in /james/server/trunk: container-spring/src/main/config/james/mailstore.xml mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java
Date Sat, 18 Dec 2010 09:25:43 GMT
Author: norman
Date: Sat Dec 18 09:25:42 2010
New Revision: 1050601

URL: http://svn.apache.org/viewvc?rev=1050601&view=rev
Log:
No need for type config anymore.. we only support MailRepository

Modified:
    james/server/trunk/container-spring/src/main/config/james/mailstore.xml
    james/server/trunk/mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java

Modified: james/server/trunk/container-spring/src/main/config/james/mailstore.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/config/james/mailstore.xml?rev=1050601&r1=1050600&r2=1050601&view=diff
==============================================================================
--- james/server/trunk/container-spring/src/main/config/james/mailstore.xml (original)
+++ james/server/trunk/container-spring/src/main/config/james/mailstore.xml Sat Dec 18 09:25:42
2010
@@ -27,18 +27,12 @@
           <protocols>
               <protocol>file</protocol>
           </protocols>
-          <types>
-                <type>MAIL</type>
-           </types>
       </repository>
       
       <repository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
           <protocols>
               <protocol>db</protocol>
           </protocols>
-          <types>
-              <type>MAIL</type>
-          </types>
           <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
           </config>
@@ -47,9 +41,6 @@
           <protocols>
               <protocol>dbfile</protocol>
           </protocols>
-          <types>
-              <type>MAIL</type>
-          </types>
           <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
               <filestore>file://var/dbmail</filestore>
@@ -59,9 +50,6 @@
           <protocols>
               <protocol>mbox</protocol>
           </protocols>
-          <types>
-              <type>MAIL</type>
-          </types>
           <config FIFO="false"/> 
       </repository>
   </repositories>

Modified: james/server/trunk/mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java?rev=1050601&r1=1050600&r2=1050601&view=diff
==============================================================================
--- james/server/trunk/mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java
(original)
+++ james/server/trunk/mail-library/src/main/java/org/apache/james/mailstore/lib/JamesMailStore.java
Sat Dec 18 09:25:42 2010
@@ -31,6 +31,7 @@ import javax.annotation.Resource;
 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.commons.configuration.CombinedConfiguration;
 import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.DefaultConfigurationBuilder;
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.james.lifecycle.api.Configurable;
@@ -121,7 +122,6 @@ public class JamesMailStore implements M
         String className = repConf.getString("[@class]");
         boolean infoEnabled = getLogger().isInfoEnabled();
         List<String> protocols = repConf.getList("protocols.protocol");
-        List<String >types = repConf.getList("types.type");
         
         for ( int i = 0; i < protocols.size(); i++ )
         {
@@ -134,31 +134,24 @@ public class JamesMailStore implements M
                 defConf = repConf.configurationAt("config");
             }
             
-
-            for ( int j = 0; j < types.size(); j++ )
-            {
-                String type = types.get(j);
-                String key = protocol + type ;
-                if (infoEnabled) {
-                    StringBuffer infoBuffer =
-                        new StringBuffer(128)
-                            .append("Registering Repository instance of class ")
-                            .append(className)
-                            .append(" to handle ")
-                            .append(protocol)
-                            .append(" protocol requests for repositories of type ")
-                            .append(type)
-                            .append(" with key ")
-                            .append(key);
-                    getLogger().info(infoBuffer.toString());
-                }
-                if (classes.get(key) != null) {
-                    throw new ConfigurationException("The combination of protocol and type
comprise a unique key for repositories.  This constraint has been violated.  Please check
your repository configuration.");
-                }
-                classes.put(key, className);
-                if (defConf != null) {
-                    defaultConfigs.put(key, defConf);
-                }
+            String key = protocol ;
+            if (infoEnabled) {
+                StringBuffer infoBuffer =
+                    new StringBuffer(128)
+                        .append("Registering Repository instance of class ")
+                        .append(className)
+                        .append(" to handle ")
+                        .append(protocol)
+                        .append(" protocol requests for repositories with key ")
+                        .append(key);
+                getLogger().info(infoBuffer.toString());
+            }
+            if (classes.get(key) != null) {
+                throw new ConfigurationException("The combination of protocol and type comprise
a unique key for repositories.  This constraint has been violated.  Please check your repository
configuration.");
+            }
+            classes.put(key, className);
+            if (defConf != null) {
+                defaultConfigs.put(key, defConf);
             }
         }
 
@@ -231,7 +224,10 @@ public class JamesMailStore implements M
             if ( defConf != null) {
                 config.addConfiguration(defConf);
             }
-
+            DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
+            builder.addProperty("[@destinationURL]", destination);
+            config.addConfiguration(builder);
+            
             try {               
                 reply =  (MailRepository) factory.newInstance(Thread.currentThread().getContextClassLoader().loadClass(repClass),
logger, config);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message