james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r883793 - /james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java
Date Tue, 24 Nov 2009 17:16:32 GMT
Author: norman
Date: Tue Nov 24 17:16:32 2009
New Revision: 883793

URL: http://svn.apache.org/viewvc?rev=883793&view=rev
Log:
Make sure server implementations which use excalibur sockets are working without the need
of an avalonaware container

Modified:
    james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java

Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java?rev=883793&r1=883792&r2=883793&view=diff
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java
(original)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AvalonProtocolServer.java
Tue Nov 24 17:16:32 2009
@@ -50,6 +50,8 @@
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.logger.CommonsLogger;
 import org.apache.avalon.framework.service.DefaultServiceManager;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -218,7 +220,7 @@
 
     private Log logger;
     
-    private DefaultServiceManager serviceManager = new DefaultServiceManager();
+    private ServiceManager serviceManager = null;
 	
     /**
      * Gets the DNS Service.
@@ -522,11 +524,22 @@
     }
 
 
+    @Override
+    public void service(ServiceManager serviceManager) throws ServiceException {
+        this.serviceManager = serviceManager;
+        
+        super.service(serviceManager);
+    }
+
     @PostConstruct
     public void init() throws Exception {
         
         getLog().debug(protocolHandlerFactory.getServiceType() + " init...");
 
+        // check if we received the serviceManager before, if not create an empty
+        if (serviceManager == null) {
+            serviceManager = new DefaultServiceManager();
+        }
         ContainerUtil.service(this, serviceManager);
         // parse configuration
         configure();



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