james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r881899 - in /james/hupa/trunk/server/src: main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java main/webapp/WEB-INF/conf/config.properties test/java/org/apache/hupa/server/DemoModeTest.java
Date Wed, 18 Nov 2009 19:38:49 GMT
Author: norman
Date: Wed Nov 18 19:38:48 2009
New Revision: 881899

URL: http://svn.apache.org/viewvc?rev=881899&view=rev
Log:
Use more then one IMAP connection per user (HUPA-51).

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
    james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
    james/hupa/trunk/server/src/test/java/org/apache/hupa/server/DemoModeTest.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java?rev=881899&r1=881898&r2=881899&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
(original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
Wed Nov 18 19:38:48 2009
@@ -51,7 +51,7 @@
     private boolean useSSL = false;
     
     @Inject
-    public InMemoryIMAPStoreCache(Log logger,@Named("IMAPServerAddress") String address,
@Named("IMAPServerPort") int port, @Named("IMAPS") boolean useSSL,Provider<Session>
sessionProvider) {
+    public InMemoryIMAPStoreCache(Log logger,@Named("IMAPServerAddress") String address,
@Named("IMAPServerPort") int port, @Named("IMAPS") boolean useSSL, @Named("IMAPConnectionPoolSize")
int connectionPoolSize, @Named("IMAPConnectionPoolTimeout") int timeout, Provider<Session>
sessionProvider) {
         this.logger = logger;
         this.address = address;
         this.port = port;
@@ -60,6 +60,12 @@
         props.setProperty("mail.mime.decodetext.strict", "false");
         if (useSSL) {
             props.setProperty("mail.store.protocol", "imaps");
+            props.setProperty("mail.imaps.connectionpoolsize", connectionPoolSize +"");
+            props.setProperty("mail.imaps.connectionpooltimeout", timeout + "");
+        } else {
+            props.setProperty("mail.imap.connectionpoolsize", connectionPoolSize + "");
+            props.setProperty("mail.imap.connectionpooltimeout", timeout + "");
+
         }
         session = sessionProvider.get();
         System.setProperty("mail.mime.decodetext.strict", "false");

Modified: james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties?rev=881899&r1=881898&r2=881899&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties (original)
+++ james/hupa/trunk/server/src/main/webapp/WEB-INF/conf/config.properties Wed Nov 18 19:38:48
2009
@@ -2,6 +2,11 @@
 IMAPServerAddress=imap.gmail.com
 # The port of the IMAP server
 IMAPServerPort=993
+# Set the connections amount which will get maximal opened per user for processing requests
+# Setting it higher can improve performance, but be sure that the IMAPServer will maybe have
some limit
+IMAPConnectionPoolSize=4
+# Set the timout for connections in milliseconds
+IMAPConnectionPoolTimeout=300000
 # Use SSL/TLS to connect to the IMAP server
 IMAPS=true
 

Modified: james/hupa/trunk/server/src/test/java/org/apache/hupa/server/DemoModeTest.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/test/java/org/apache/hupa/server/DemoModeTest.java?rev=881899&r1=881898&r2=881899&view=diff
==============================================================================
--- james/hupa/trunk/server/src/test/java/org/apache/hupa/server/DemoModeTest.java (original)
+++ james/hupa/trunk/server/src/test/java/org/apache/hupa/server/DemoModeTest.java Wed Nov
18 19:38:48 2009
@@ -26,7 +26,7 @@
 
 	private LoginUser demoUser = new LoginUser("demo", "demo");
 	
-	private InMemoryIMAPStoreCache memoryStore = new InMemoryIMAPStoreCache(logger, InMemoryIMAPStoreCache.DEMO_MODE,
143, false, provider);
+	private InMemoryIMAPStoreCache memoryStore = new InMemoryIMAPStoreCache(logger, InMemoryIMAPStoreCache.DEMO_MODE,
143, false, 1, 300000, provider);
 	
     private LoginUserHandler loginUserHandler = new LoginUserHandler(memoryStore, logger,
httpSessionProvider, settingsProvider);
     



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