james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r883789 - in /james/server/trunk: avalon-socket-library/src/main/java/org/apache/james/socket/ nntpserver-function/src/main/java/org/apache/james/nntpserver/ pop3server-function/src/main/java/org/apache/james/pop3server/ remotemanager-funct...
Date Tue, 24 Nov 2009 17:09:14 GMT
Author: norman
Date: Tue Nov 24 17:09:14 2009
New Revision: 883789

URL: http://svn.apache.org/viewvc?rev=883789&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
    james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java
    james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/AvalonPOP3Server.java
    james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java
    james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/AvalonSMTPServer.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=883789&r1=883788&r2=883789&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:09:14 2009
@@ -49,8 +49,7 @@
 import org.apache.avalon.excalibur.pool.Poolable;
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.logger.CommonsLogger;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.DefaultServiceManager;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -218,8 +217,8 @@
     private SocketManager socketManager;
 
     private Log logger;
-
-    private ServiceManager serviceManager;
+    
+    private DefaultServiceManager serviceManager = new DefaultServiceManager();
 	
     /**
      * Gets the DNS Service.
@@ -281,15 +280,7 @@
     public void setSocketManager(SocketManager socketManager) {
         this.socketManager = socketManager;
     }
-    
-    
-    /**
-     * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
-     */
-    public void service(ServiceManager comp) throws ServiceException {
-        super.service( comp );
-        serviceManager = comp;
-    }
+   
 
     /**
      * Subclasses should override this method todo any configuration tasks
@@ -536,6 +527,7 @@
         
         getLog().debug(protocolHandlerFactory.getServiceType() + " init...");
 
+        ContainerUtil.service(this, serviceManager);
         // parse configuration
         configure();
 

Modified: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java?rev=883789&r1=883788&r2=883789&view=diff
==============================================================================
--- james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java
(original)
+++ james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java
Tue Nov 24 17:09:14 2009
@@ -56,7 +56,6 @@
     private DNSService dns;
     private Log logger;
     private org.apache.commons.configuration.HierarchicalConfiguration config;
-    private Injector injector;
     private UsersRepository userRepos;
     private JamesConnectionManager connectionManager;
     private SocketManager socketManager;
@@ -103,16 +102,13 @@
         connectionManager = (JamesConnectionManager) manager.lookup(JamesConnectionManager.ROLE);
    
         threadManager = (ThreadManager) manager.lookup(ThreadManager.ROLE);
         nntpRepos = (NNTPRepository) manager.lookup(NNTPRepository.ROLE);
-        // thats needed because of used excalibur socket components
-        nntpserver.service(manager);
     }
 
     /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        injector = Guice.createInjector(new NNTPServerModule(), new Jsr250Module());
-        injector.injectMembers(nntpserver);
+        nntpserver = Guice.createInjector(new NNTPServerModule(), new Jsr250Module()).getInstance(NNTPServer.class);
     }
                  
     /**

Modified: james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/AvalonPOP3Server.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/AvalonPOP3Server.java?rev=883789&r1=883788&r2=883789&view=diff
==============================================================================
--- james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/AvalonPOP3Server.java
(original)
+++ james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/AvalonPOP3Server.java
Tue Nov 24 17:09:14 2009
@@ -55,7 +55,6 @@
     private DNSService dns;
     private Log logger;
     private org.apache.commons.configuration.HierarchicalConfiguration config;
-    private Injector injector;
     private UsersRepository userRepos;
     private JamesConnectionManager connectionManager;
     private SocketManager socketManager;
@@ -100,17 +99,13 @@
         socketManager = (SocketManager) manager.lookup(SocketManager.ROLE);
         connectionManager = (JamesConnectionManager) manager.lookup(JamesConnectionManager.ROLE);
    
         threadManager = (ThreadManager) manager.lookup(ThreadManager.ROLE);
-        
-        // thats needed because of used excalibur socket components
-        pop3server.service(manager);
     }
 
     /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        injector = Guice.createInjector(new POP3ServerModule(), new Jsr250Module());
-        injector.injectMembers(pop3server);
+        pop3server = Guice.createInjector(new POP3ServerModule(), new Jsr250Module()).getInstance(POP3Server.class);
     }
                  
     /**

Modified: james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java?rev=883789&r1=883788&r2=883789&view=diff
==============================================================================
--- james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java
(original)
+++ james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java
Tue Nov 24 17:09:14 2009
@@ -61,7 +61,6 @@
     private DNSService dns;
     private Log logger;
     private org.apache.commons.configuration.HierarchicalConfiguration config;
-    private Injector injector;
     private JamesConnectionManager connectionManager;
     private SocketManager socketManager;
     private RemoteManager server = new RemoteManager();
@@ -118,16 +117,13 @@
         usersStore = (UsersStore) manager.lookup(UsersStore.ROLE);
         processorService = (ProcessorManagementService) manager.lookup(ProcessorManagementService.ROLE);
         store = (Store) manager.lookup(Store.ROLE);
-        // thats needed because of used excalibur socket components
-        server.service(manager);
     }
 
     /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        injector = Guice.createInjector(new RemoteManagerModule(), new Jsr250Module());
-        injector.injectMembers(server);
+        server = Guice.createInjector(new RemoteManagerModule(), new Jsr250Module()).getInstance(RemoteManager.class);
     }
                  
     /**

Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/AvalonSMTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/AvalonSMTPServer.java?rev=883789&r1=883788&r2=883789&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/AvalonSMTPServer.java
(original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/AvalonSMTPServer.java
Tue Nov 24 17:09:14 2009
@@ -60,14 +60,13 @@
     private MailetContext context;
     private Log logger;
     private org.apache.commons.configuration.HierarchicalConfiguration config;
-    private Injector injector;
     private UsersRepository userRepos;
     private DataSourceSelector dselector;
     private VirtualUserTableStore vutStore;
     private org.apache.james.smtpserver.protocol.DNSService dnsServiceAdapter;
     private JamesConnectionManager connectionManager;
     private SocketManager socketManager;
-    private SMTPServer smtpserver = new SMTPServer();
+    private SMTPServer smtpserver;
     private ThreadManager threadManager;
     
     public String getNetworkInterface() {
@@ -112,17 +111,13 @@
         socketManager = (SocketManager) manager.lookup(SocketManager.ROLE);
         connectionManager = (JamesConnectionManager) manager.lookup(JamesConnectionManager.ROLE);
    
         threadManager = (ThreadManager) manager.lookup(ThreadManager.ROLE);
-        
-        // thats needed because of used excalibur socket components
-        smtpserver.service(manager);
     }
 
     /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() throws Exception {
-        injector = Guice.createInjector(new SMTPServerModule(), new Jsr250Module());
-        injector.injectMembers(smtpserver);
+        smtpserver = Guice.createInjector(new SMTPServerModule(), new Jsr250Module()).getInstance(SMTPServer.class);
     }
                  
     /**



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