Author: norman
Date: Wed Jan 13 18:54:35 2010
New Revision: 898880

URL: http://svn.apache.org/viewvc?rev=898880&view=rev
Log:
Remove MailetContext as dependency of SMTPServer (JAMES-739)

Modified:
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerProtocolHandlerFactory.java

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerProtocolHandlerFactory.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerProtocolHandlerFactory.java?rev=898880&r1=898879&r2=898880&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerProtocolHandlerFactory.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServerProtocolHandlerFactory.java
 Wed Jan 13 18:54:35 2010
@@ -21,19 +21,16 @@
 
 package org.apache.james.smtpserver;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
-import org.apache.james.Constants;
 import org.apache.james.api.dnsservice.util.NetMatcher;
 import org.apache.james.services.MailServer;
 import org.apache.james.smtpserver.integration.CoreCmdHandlerLoader;
 import org.apache.james.smtpserver.protocol.SMTPConfiguration;
 import org.apache.james.socket.api.ProtocolHandler;
 import 
org.apache.james.socket.shared.AbstractSupportLoaderProtocolHandlerFactory;
-import org.apache.mailet.MailetContext;
 
 /**
  * <p>Accepts SMTP connections on a server socket and dispatches them to 
SMTPHandlers.</p>
@@ -42,18 +39,9 @@
  *
  * @version 1.1.0, 06/02/2001
  */
-/*
- * IMPORTANT: SMTPServer extends AbstractJamesService.  If you implement ANY
- * lifecycle methods, you MUST call super.<method> as well.
- */
 public class SMTPServerProtocolHandlerFactory extends 
AbstractSupportLoaderProtocolHandlerFactory {
 
     /**
-     * The mailet context - we access it here to set the hello name for the 
Mailet API
-     */
-    private MailetContext mailetcontext;
-
-    /**
      * The internal mail server service.
      */
     private MailServer mailServer;
@@ -109,32 +97,15 @@
         this.mailServer = mailServer;
     }
 
-    @Resource(name="James")
-    public final void setMailetContext(MailetContext mailetcontext) {
-        this.mailetcontext = mailetcontext;
-    }
-
     private boolean useStartTLS;
     
-    
-    @Override
-    @PostConstruct
-    public void init() throws Exception {
-        super.init();
-    }
-    
 
     /**
      * @see 
org.apache.james.socket.AvalonProtocolServer#onConfigure(org.apache.commons.configuration.HierarchicalConfiguration)
      */
     protected void onConfigure(HierarchicalConfiguration configuration) throws 
ConfigurationException {
         super.onConfigure(configuration);
-        String hello = (String) 
mailetcontext.getAttribute(Constants.HELLO_NAME);
-
-        // TODO Remove this in next not backwards compatible release!
-        if (hello == null)
-            mailetcontext.setAttribute(Constants.HELLO_NAME, getHelloName());
-
+        
         HierarchicalConfiguration handlerConfiguration = 
configuration.configurationAt("handler");
         String authRequiredString = 
handlerConfiguration.getString("authRequired", "false").trim().toLowerCase();
         if (authRequiredString.equals("true"))
@@ -208,10 +179,6 @@
 
         addressBracketsEnforcement = 
handlerConfiguration.getBoolean("addressBracketsEnforcement", true);
 
-        // TODO Remove this in next not backwards compatible release!
-        if (hello == null)
-            mailetcontext.setAttribute(Constants.HELLO_NAME, "localhost");
-
         // TODO: does this belong here ?
         useStartTLS = configuration.getBoolean("starttl...@enable]", false);
 



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

Reply via email to