james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r828952 - in /james/server/trunk: phoenix-deployment/src/java/org/apache/james/phoenix/ smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/
Date Fri, 23 Oct 2009 07:44:41 GMT
Author: norman
Date: Fri Oct 23 07:44:40 2009
New Revision: 828952

URL: http://svn.apache.org/viewvc?rev=828952&view=rev
Log:
We need a marker interface to tell the PhoenixLoader to not try to inject resources again..
to many workarounds...

Added:
    james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/GuiceInjected.java
Modified:
    james/server/trunk/phoenix-deployment/src/java/org/apache/james/phoenix/PhoenixLoader.java
    james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AvalonAsyncSMTPServer.java

Modified: james/server/trunk/phoenix-deployment/src/java/org/apache/james/phoenix/PhoenixLoader.java
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/src/java/org/apache/james/phoenix/PhoenixLoader.java?rev=828952&r1=828951&r2=828952&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/src/java/org/apache/james/phoenix/PhoenixLoader.java
(original)
+++ james/server/trunk/phoenix-deployment/src/java/org/apache/james/phoenix/PhoenixLoader.java
Fri Oct 23 07:44:40 2009
@@ -33,6 +33,7 @@
 import org.apache.avalon.phoenix.ApplicationListener;
 import org.apache.avalon.phoenix.BlockEvent;
 import org.apache.james.api.kernel.LoaderService;
+import org.apache.james.smtpserver.mina.GuiceInjected;
 
 public class PhoenixLoader implements LoaderService, ApplicationListener, LogEnabled {
 
@@ -62,12 +63,19 @@
      */
     public void applicationStarted() {
         for (Object resource : servicesByName.values()) {
-            injectResources(resource);
+            
+            // Only handle injection if it not use guice already 
+            if ((resource instanceof GuiceInjected) == false) {
+                injectResources(resource);
+            }
         }
         
         try {
             for (Object resource : servicesByName.values()) {
-                postConstruct(resource);
+                // Only handle injection if it not use guice already 
+                if ((resource instanceof GuiceInjected) == false) {
+                    postConstruct(resource);
+                }
             }
         } catch (Exception e) {
             throw new RuntimeException("Initialisation failed", e);

Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AvalonAsyncSMTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AvalonAsyncSMTPServer.java?rev=828952&r1=828951&r2=828952&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AvalonAsyncSMTPServer.java
(original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/AvalonAsyncSMTPServer.java
Fri Oct 23 07:44:40 2009
@@ -52,7 +52,7 @@
  * of AsyncSMTPServer. This way AsyncSMTPServer has no dependencies on avalon anymore
  *
  */
-public class AvalonAsyncSMTPServer implements LogEnabled, Configurable, Serviceable, Initializable
{
+public class AvalonAsyncSMTPServer implements LogEnabled, Configurable, Serviceable, Initializable,
GuiceInjected {
 
     private FileSystem filesystem;
     private MailServer mailserver;

Added: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/GuiceInjected.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/GuiceInjected.java?rev=828952&view=auto
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/GuiceInjected.java
(added)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/mina/GuiceInjected.java
Fri Oct 23 07:44:40 2009
@@ -0,0 +1,28 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+package org.apache.james.smtpserver.mina;
+
+/**
+ * Just a marker interface which tells that injection is already handled by guice.
+ * 
+ *
+ */
+public interface GuiceInjected {
+
+}



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