Author: norman
Date: Fri Jan  8 17:55:00 2010
New Revision: 897278

URL: http://svn.apache.org/viewvc?rev=897278&view=rev
Log:
Remove not needed stuff

Removed:
    
james/server/trunk/imapserver-function/src/main/java/org/apache/james/imapserver/ImapFactory.java
    
james/server/trunk/imapserver-function/src/main/java/org/apache/james/user/impl/file/FileUserMetaDataService.java
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=897278&r1=897277&r2=897278&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 17:55:00 2010
@@ -30,13 +30,17 @@
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.apache.james.api.user.UsersRepository;
 import org.apache.james.imap.api.ImapConstants;
+import org.apache.james.imap.api.process.ImapProcessor;
+import org.apache.james.imap.decode.ImapDecoder;
+import org.apache.james.imap.encode.ImapEncoder;
+import org.apache.james.imap.encode.main.DefaultImapEncoderFactory;
 import org.apache.james.imap.mailbox.Mailbox;
 import org.apache.james.imap.mailbox.MailboxManager;
 import org.apache.james.imap.mailbox.MailboxSession;
+import org.apache.james.imap.main.DefaultImapDecoderFactory;
 import org.apache.james.imap.main.ImapRequestHandler;
-import org.apache.james.services.FileSystem;
+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;
@@ -53,17 +57,33 @@
 public class ImapServerProtocolHandlerFactory extends 
AbstractProtocolHandlerFactory implements ImapConstants, Poster
 {
     private static final String softwaretype = "JAMES "+VERSION+" Server "; 
//+ Constants.SOFTWARE_VERSION;
-     
-    private ImapFactory factory;
-    
+         
     private MailServer mailServer;
     
     private String hello;
     
+    private ImapEncoder encoder;
+    private ImapDecoder decoder;
+    private ImapProcessor processor;
+
+    private MailboxManager mailboxManager;
+    
     @Resource(name="James")
     public void setMailSerer(MailServer mailServer) {
         this.mailServer = mailServer;
     }
+    
+    @Resource(name="mailboxmanager")
+    public void setMailboxManager(MailboxManager mailboxManager) {
+        this.mailboxManager = mailboxManager;
+    }
+    
+    public void onInit() {
+        decoder = new DefaultImapDecoderFactory().buildImapDecoder();
+        encoder = new DefaultImapEncoderFactory().buildImapEncoder();
+        processor = 
DefaultImapProcessorFactory.createDefaultProcessor(mailboxManager);
+
+    }
 
     @Override
     public void onConfigure( final HierarchicalConfiguration configuration ) 
throws ConfigurationException {
@@ -84,18 +104,13 @@
         return "IMAP Service";
     }
     
-    @Resource(name="imapFactory")
-    public void setImapFactory(ImapFactory factory) {
-        this.factory = factory;
-    }
-
     /**
      * Producing handlers.
      * @see org.apache.avalon.excalibur.pool.ObjectFactory#newInstance()
      */
     public ProtocolHandler newProtocolHandlerInstance()
     {  
-        final ImapRequestHandler handler = factory.createHandler();
+        final ImapRequestHandler handler = new ImapRequestHandler(decoder, 
processor, encoder);
         final ImapHandler imapHandler = new ImapHandler(handler, hello); 
         getLogger().debug("Create handler instance");
         return imapHandler;
@@ -139,7 +154,6 @@
                             user = user + "@" + host;
                         } 
                         
-                        final MailboxManager mailboxManager = 
factory.getMailbox();
                         final MailboxSession session = 
mailboxManager.createSystemSession(user, getLogger());
                         // This allows Sieve scripts to use a standard 
delimiter regardless of mailbox implementation
                         final String mailbox = urlPath.replace('/', 
session.getPersonalSpace().getDeliminator());

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=897278&r1=897277&r2=897278&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 17:55:00 2010
@@ -315,9 +315,7 @@
        <bean id="imapserver.protocolserver" 
class="org.apache.james.socket.AvalonProtocolServer">
                <property name="protocolHandlerFactory" 
ref="imapserver.protocolhandlerfactory" />
        </bean>
-       
-       <bean id="imapFactory" class="org.apache.james.imapserver.ImapFactory"/>
-       
+               
        <bean id="mailboxmanager" 
class="org.apache.james.mailboxmanager.torque.DefaultMailboxManager">
                        <constructor-arg index="0" ref="userManager"/>
        </bean>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to