james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r884854 - in /james/server/trunk/imapserver-function/src/main/java/org/apache/james: imapserver/AvalonImapServer.java mailboxmanager/torque/DefaultMailboxManager.java
Date Fri, 27 Nov 2009 12:21:55 GMT
Author: norman
Date: Fri Nov 27 12:21:55 2009
New Revision: 884854

URL: http://svn.apache.org/viewvc?rev=884854&view=rev
Log:
Fix IMAPServer component after broke it before

Modified:
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/AvalonImapServer.java
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/mailboxmanager/torque/DefaultMailboxManager.java

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/AvalonImapServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/AvalonImapServer.java?rev=884854&r1=884853&r2=884854&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/AvalonImapServer.java
(original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/AvalonImapServer.java
Fri Nov 27 12:21:55 2009
@@ -50,6 +50,8 @@
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Singleton;
 import com.google.inject.name.Names;
 
 public class AvalonImapServer implements GuiceInjected, Poster, Initializable, Serviceable,
Configurable, LogEnabled {
@@ -93,7 +95,10 @@
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        poster = Guice.createInjector(new IMAPServerModule(), new Jsr250Module()).getInstance(ImapServerProtocolHandlerFactory.class);
+        Injector injector = Guice.createInjector(new IMAPServerModule(), new Jsr250Module());
+        injector.getInstance(AvalonProtocolServer.class);
+        poster = injector.getInstance(Poster.class);
+        //poster = injector.getInstance(ImapServerProtocolHandlerFactory.class);
     }
                  
     /**
@@ -113,12 +118,14 @@
             bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log")).toInstance(logger);
             bind(FileSystem.class).annotatedWith(Names.named("org.apache.james.services.FileSystem")).toInstance(filesystem);
             bind(UsersRepository.class).annotatedWith(Names.named("org.apache.james.api.user.UsersRepository")).toInstance(userRepos);
+            bind(ImapServerProtocolHandlerFactory.class).in(Singleton.class);
+            bind(Poster.class).to(ImapServerProtocolHandlerFactory.class);
             bind(ProtocolHandlerFactory.class).annotatedWith(Names.named("org.apache.james.socket.api.ProtocolHandlerFactory")).to(ImapServerProtocolHandlerFactory.class);
-            bind(ProtocolServer.class).annotatedWith(Names.named("org.apache.james.socket.api.ProtocolServer")).to(AvalonProtocolServer.class);
+            bind(ProtocolServer.class).annotatedWith(Names.named("org.apache.james.socket.api.ProtocolServer")).to(AvalonProtocolServer.class).in(Singleton.class);
             bind(SocketManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.sockets.SocketManager")).toInstance(socketManager);
             bind(JamesConnectionManager.class).annotatedWith(Names.named("org.apache.james.socket.JamesConnectionManager")).toInstance(connectionManager);
             bind(ThreadManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.threads.ThreadManager")).toInstance(threadManager);
-
+           
         }
     }
 

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/mailboxmanager/torque/DefaultMailboxManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/mailboxmanager/torque/DefaultMailboxManager.java?rev=884854&r1=884853&r2=884854&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/mailboxmanager/torque/DefaultMailboxManager.java
(original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/mailboxmanager/torque/DefaultMailboxManager.java
Fri Nov 27 12:21:55 2009
@@ -83,7 +83,7 @@
                 SqlResources sqlResources = new SqlResources();
                 sqlResources.init(fileSystem.getResource(configFile),
                         DefaultMailboxManager.class.getName(), conn,
-                        new HashMap());
+                        new HashMap<String,String>());
 
                 DatabaseMetaData dbMetaData = conn.getMetaData();
 



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