james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1460272 - in /james/server/trunk: data/data-library/src/main/java/org/apache/james/domainlist/lib/ data/data-library/src/main/java/org/apache/james/rrt/lib/ data/data-library/src/main/java/org/apache/james/user/lib/ mailet/mailets/src/main...
Date Sun, 24 Mar 2013 07:15:59 GMT
Author: eric
Date: Sun Mar 24 07:15:59 2013
New Revision: 1460272

URL: http://svn.apache.org/r1460272
Log:
Avoid NPE on various injected resources - this is also a fix for (JAMES-1493)

Modified:
    james/server/trunk/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
    james/server/trunk/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
    james/server/trunk/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
    james/server/trunk/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java

Modified: james/server/trunk/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
URL: http://svn.apache.org/viewvc/james/server/trunk/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java?rev=1460272&r1=1460271&r2=1460272&view=diff
==============================================================================
--- james/server/trunk/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
(original)
+++ james/server/trunk/data/data-library/src/main/java/org/apache/james/domainlist/lib/AbstractDomainList.java
Sun Mar 24 07:15:59 2013
@@ -25,7 +25,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 
+import javax.annotation.Resource;
 import javax.inject.Inject;
+import javax.inject.Named;
+import javax.xml.ws.RequestWrapper;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -48,7 +51,8 @@ public abstract class AbstractDomainList
     private String defaultDomain;
 
     @Inject
-    public void setDNSService(DNSService dns) {
+    @Resource
+    public void setDNSService(@Named("dnsservice") DNSService dns) {
         this.dns = dns;
     }
 

Modified: james/server/trunk/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
URL: http://svn.apache.org/viewvc/james/server/trunk/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java?rev=1460272&r1=1460271&r2=1460272&view=diff
==============================================================================
--- james/server/trunk/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
(original)
+++ james/server/trunk/data/data-library/src/main/java/org/apache/james/rrt/lib/AbstractRecipientRewriteTable.java
Sun Mar 24 07:15:59 2013
@@ -26,7 +26,9 @@ import java.util.Map;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
+import javax.annotation.Resource;
 import javax.inject.Inject;
+import javax.inject.Named;
 import javax.mail.internet.ParseException;
 
 import org.apache.commons.configuration.ConfigurationException;
@@ -54,7 +56,8 @@ public abstract class AbstractRecipientR
     private DomainList domainList;
 
     @Inject
-    public void setDomainList(DomainList domainList) {
+    @Resource
+    public void setDomainList(@Named("domainlist") DomainList domainList) {
         this.domainList = domainList;
     }
 

Modified: james/server/trunk/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java?rev=1460272&r1=1460271&r2=1460272&view=diff
==============================================================================
--- james/server/trunk/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
(original)
+++ james/server/trunk/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
Sun Mar 24 07:15:59 2013
@@ -19,7 +19,9 @@
 
 package org.apache.james.user.lib;
 
+import javax.annotation.Resource;
 import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -68,7 +70,8 @@ public abstract class AbstractUsersRepos
     }
 
     @Inject
-    public void setDomainList(DomainList domainList) {
+    @Resource
+    public void setDomainList(@Named("domainlist") DomainList domainList) {
         this.domainList = domainList;
     }
 

Modified: james/server/trunk/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=1460272&r1=1460271&r2=1460272&view=diff
==============================================================================
--- james/server/trunk/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
(original)
+++ james/server/trunk/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
Sun Mar 24 07:15:59 2013
@@ -19,38 +19,6 @@
 
 package org.apache.james.transport.mailets;
 
-import org.apache.james.dnsservice.api.DNSService;
-import org.apache.james.dnsservice.api.TemporaryResolutionException;
-import org.apache.james.dnsservice.library.MXHostAddressIterator;
-import org.apache.james.domainlist.api.DomainList;
-import org.apache.james.domainlist.api.DomainListException;
-import org.apache.james.lifecycle.api.LifecycleUtil;
-import org.apache.james.queue.api.MailPrioritySupport;
-import org.apache.james.queue.api.MailQueue;
-import org.apache.james.queue.api.MailQueue.MailQueueException;
-import org.apache.james.queue.api.MailQueue.MailQueueItem;
-import org.apache.james.queue.api.MailQueueFactory;
-import org.apache.james.transport.util.MailetContextLog;
-import org.apache.james.transport.util.Patterns;
-import org.apache.james.util.TimeConverter;
-import org.apache.mailet.HostAddress;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.MailetContext;
-import org.apache.mailet.base.GenericMailet;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.mail.Address;
-import javax.mail.MessagingException;
-import javax.mail.SendFailedException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.MimePart;
-import javax.mail.internet.ParseException;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -74,6 +42,40 @@ import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.mail.Address;
+import javax.mail.MessagingException;
+import javax.mail.SendFailedException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.mail.internet.MimePart;
+import javax.mail.internet.ParseException;
+
+import org.apache.james.dnsservice.api.DNSService;
+import org.apache.james.dnsservice.api.TemporaryResolutionException;
+import org.apache.james.dnsservice.library.MXHostAddressIterator;
+import org.apache.james.domainlist.api.DomainList;
+import org.apache.james.domainlist.api.DomainListException;
+import org.apache.james.lifecycle.api.LifecycleUtil;
+import org.apache.james.queue.api.MailPrioritySupport;
+import org.apache.james.queue.api.MailQueue;
+import org.apache.james.queue.api.MailQueue.MailQueueException;
+import org.apache.james.queue.api.MailQueue.MailQueueItem;
+import org.apache.james.queue.api.MailQueueFactory;
+import org.apache.james.transport.util.MailetContextLog;
+import org.apache.james.transport.util.Patterns;
+import org.apache.james.util.TimeConverter;
+import org.apache.mailet.HostAddress;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+import org.apache.mailet.MailetContext;
+import org.apache.mailet.base.GenericMailet;
+
 /**
  * <p>The RemoteDelivery mailet delivers messages to a remote SMTP server able to deliver
or forward messages to their final
  * destination.
@@ -159,6 +161,8 @@ public class RemoteDelivery extends Gene
     private static final Pattern PATTERN = Patterns.compilePatternUncheckedException(PATTERN_STRING);
 
     @Inject
+    @Named("dnsservice")
+    @Resource
     private DNSService dnsServer;
 
     /**



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