You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/01/08 19:26:52 UTC

svn commit: r897286 - in /james/server/trunk: imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java spring-deployment/src/main/config/james/spring-beans.xml

Author: norman
Date: Fri Jan  8 18:26:51 2010
New Revision: 897286

URL: http://svn.apache.org/viewvc?rev=897286&view=rev
Log:
More decoupling from implementations using DI (Isn't DI just ... wonderful)

Modified:
    james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java
    james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml

Modified: james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java?rev=897286&r1=897285&r2=897286&view=diff
==============================================================================
--- james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java (original)
+++ james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapServerProtocolHandlerFactory.java Fri Jan  8 18:26:51 2010
@@ -38,7 +38,6 @@
 import org.apache.james.imap.mailbox.MailboxManager;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.main.ImapRequestHandler;
-import org.apache.james.imap.processor.main.DefaultImapProcessorFactory;
 import org.apache.james.services.MailServer;
 import org.apache.james.socket.api.ProtocolHandler;
 import org.apache.james.socket.shared.AbstractProtocolHandlerFactory;
@@ -76,17 +75,21 @@
         this.mailboxManager = mailboxManager;
     }
     
+    @Resource(name="imapDecoder")
     public void setImapDecoder(ImapDecoder decoder) {
         this.decoder = decoder;
     }
     
+    @Resource(name="imapEncoder")
     public void setImapEncoder(ImapEncoder encoder) {
         this.encoder = encoder;
     }
     
-    public void onInit() {
-        processor = DefaultImapProcessorFactory.createDefaultProcessor(mailboxManager);
+    @Resource(name="imapProcessor")
+    public void setImapProcessor(ImapProcessor processor) {
+        this.processor = processor;
     }
+    
 
     @Override
     public void onConfigure( final HierarchicalConfiguration configuration ) throws ConfigurationException {

Modified: james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml?rev=897286&r1=897285&r2=897286&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml (original)
+++ james/server/trunk/spring-deployment/src/main/config/james/spring-beans.xml Fri Jan  8 18:26:51 2010
@@ -319,6 +319,11 @@
 		<property name="protocolHandlerFactory" ref="imapserver.protocolhandlerfactory" />
 	</bean>
 		
+	<bean id="imapProcessor" class="org.apache.james.imap.processor.main.DefaultImapProcessorFactory"
+      	factory-method="createDefaultProcessor">
+      	<constructor-arg ref="mailboxmanager"/>
+    </bean>
+      
     <bean id="imapDecoderFactory" class="org.apache.james.imap.main.DefaultImapDecoderFactory"/>
     <bean id="imapDecoder" factory-bean="imapDecoderFactory"  factory-method="buildImapDecoder"/>
    



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