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 rd...@apache.org on 2009/09/04 18:51:24 UTC

svn commit: r811487 - /james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java

Author: rdonkin
Date: Fri Sep  4 16:51:22 2009
New Revision: 811487

URL: http://svn.apache.org/viewvc?rev=811487&view=rev
Log:
Inject a LoaderService.

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

Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java?rev=811487&r1=811486&r2=811487&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java (original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPServer.java Fri Sep  4 16:51:22 2009
@@ -21,6 +21,8 @@
 
 package org.apache.james.smtpserver;
 
+import javax.annotation.Resource;
+
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.container.ContainerUtil;
@@ -29,6 +31,7 @@
 import org.apache.james.Constants;
 import org.apache.james.api.dnsservice.DNSService;
 import org.apache.james.api.dnsservice.util.NetMatcher;
+import org.apache.james.api.kernel.LoaderService;
 import org.apache.james.api.user.UsersRepository;
 import org.apache.james.services.MailServer;
 import org.apache.james.socket.AbstractJamesService;
@@ -53,7 +56,7 @@
      * The handler chain - SMTPhandlers can lookup handlerchain to obtain
      * Command handlers , Message handlers and connection handlers
      */
-    SMTPHandlerChain handlerChain = new SMTPHandlerChain();
+    private SMTPHandlerChain handlerChain = new SMTPHandlerChain();
 
     /**
      * The mailet context - we access it here to set the hello name for the Mailet API
@@ -75,6 +78,8 @@
      * The DNSServer to use for queries
      */
     private DNSService dnsServer;
+    /** Loads instances */
+    private LoaderService loader;
     
     /**
      * Whether authentication is required to use
@@ -124,6 +129,24 @@
 
     private boolean addressBracketsEnforcement = true;
 
+    
+    /**
+     * Gets the current instance loader.
+     * @return the loader
+     */
+    public final LoaderService getLoader() {
+        return loader;
+    }
+
+    /**
+     * Sets the loader to be used for instances.
+     * @param loader the loader to set, not null
+     */
+    @Resource(name="org.apache.james.LoaderService")
+    public final void setLoader(LoaderService loader) {
+        this.loader = loader;
+    }
+
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
      */
@@ -219,7 +242,7 @@
 
             //set the logger
             ContainerUtil.enableLogging(handlerChain,getLogger());
-           
+            
             try {
                 ContainerUtil.service(handlerChain,serviceManager);
             } catch (ServiceException e) {
@@ -237,7 +260,7 @@
             if (hello == null) mailetcontext.setAttribute(Constants.HELLO_NAME, "localhost");
         }
     }
-    
+
     @Override
     protected void doInit() throws Exception {
         ContainerUtil.initialize(handlerChain);



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