james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1443630 [2/2] - in /james/server/trunk: app/src/main/resources/META-INF/org/apache/james/ container-spring/ container-spring/src/main/java/org/apache/james/container/spring/bean/factory/mailetcontainer/ container-spring/src/main/java/org/a...
Date Thu, 07 Feb 2013 17:54:28 GMT
Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/LocalDelivery.java Thu Feb  7 17:54:26 2013
@@ -23,7 +23,8 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import javax.mail.MessagingException;
 
 import org.apache.commons.collections.iterators.IteratorChain;
@@ -45,16 +46,38 @@ import org.apache.mailet.base.GenericMai
  * James 2.3 behavior.
  */
 public class LocalDelivery extends GenericMailet {
-    @Resource(name = "recipientrewritetable")
+    
+    @Inject
     private org.apache.james.rrt.api.RecipientRewriteTable rrt;
-    @Resource(name = "usersrepository")
+    public void setRrt(@Named("recipientrewritetable") org.apache.james.rrt.api.RecipientRewriteTable rrt) {
+        this.rrt = rrt;
+    }
+
+    @Inject
+   
     private UsersRepository usersRepository;
-    @Resource(name = "mailboxmanager")
+    public void setUsersRepository(@Named("usersrepository") UsersRepository usersRepository) {
+        this.usersRepository = usersRepository;
+    }
+    
+    @Inject
     private MailboxManager mailboxManager;
-    @Resource(name = "domainlist")
+    public void setMailboxManager(@Named("mailboxmanager") MailboxManager mailboxManager) {
+        this.mailboxManager = mailboxManager;
+    }
+    
+    @Inject
+    
     private DomainList domainList;
-    @Resource(name = "filesystem")
+    public void setDomainList(@Named("domainlist") DomainList domainList) {
+        this.domainList = domainList;
+    }
+    
+    @Inject
     private FileSystem fileSystem;
+    public void setFileSystem(@Named("filesystem") FileSystem fileSystem) {
+        this.fileSystem = fileSystem;
+    }
 
     private SieveMailet sieveMailet;  // Mailet that actually stores the message
     private RecipientRewriteTable recipientRewriteTable;  // Mailet that applies RecipientRewriteTable

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java Thu Feb  7 17:54:26 2013
@@ -22,12 +22,12 @@ package org.apache.james.transport.maile
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
 
-import org.apache.james.rrt.api.RecipientRewriteTableException;
 import org.apache.james.rrt.api.RecipientRewriteTable.ErrorMappingException;
+import org.apache.james.rrt.api.RecipientRewriteTableException;
 import org.apache.mailet.MailAddress;
 
 /**
@@ -43,7 +43,7 @@ public class RecipientRewriteTable exten
      * @param vut
      *            the vutStore to set, possibly null
      */
-    @Resource(name = "recipientrewritetable")
+    @Inject
     public final void setRecipientRewriteTable(org.apache.james.rrt.api.RecipientRewriteTable vut) {
         this.vut = vut;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java Thu Feb  7 17:54:26 2013
@@ -44,6 +44,8 @@ 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.Address;
 import javax.mail.MessagingException;
 import javax.mail.SendFailedException;
@@ -156,6 +158,7 @@ public class RemoteDelivery extends Gene
     private static Pattern PATTERN = null;
 
     /** The DNSService */
+    @Inject
     private DNSService dnsServer;
 
     /**
@@ -232,7 +235,11 @@ public class RemoteDelivery extends Gene
     /** The retry count dnsProblemErrors */
     private int dnsProblemRetry = 0;
 
+    @Inject
     private MailQueueFactory queueFactory;
+    public void setMailQueueFactory(@Named("mailqueuefactory") MailQueueFactory queueFactory) {
+        this.queueFactory = queueFactory;
+    }
 
     private MailQueue queue;
 
@@ -242,24 +249,14 @@ public class RemoteDelivery extends Gene
 
     private boolean usePriority;
     
-    @Resource(name = "mailqueuefactory")
-    public void setMailQueueFactory(MailQueueFactory queueFactory) {
-        this.queueFactory = queueFactory;
-    }
-
-    @Resource(name = "dnsservice")
-    public void setDNSService(DNSService dnsService) {
-        this.dnsServer = dnsService;
-    }
-
     private DomainList domainList;
 
     private boolean startTLS = false;
     
     private boolean isSSLEnable = false;
 
-    @Resource(name = "domainlist")
-    public void setDomainList(DomainList domainList) {
+    @Inject
+    public void setDomainList(@Named("domainlist") DomainList domainList) {
         this.domainList = domainList;
     }
 

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/SieveMailet.java Thu Feb  7 17:54:26 2013
@@ -20,7 +20,7 @@ package org.apache.james.transport.maile
 
 import java.util.Date;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
 
@@ -51,17 +51,17 @@ public class SieveMailet extends SieveMa
     private FileSystem fileSystem;
     private String folder;
 
-    @Resource(name = "usersrepository")
+    @Inject
     public void setUsersRepository(UsersRepository usersRepos) {
         this.usersRepos = usersRepos;
     }
 
-    @Resource(name = "mailboxmanager")
+    @Inject
     public void setMailboxManager(MailboxManager mailboxManager) {
         this.mailboxManager = mailboxManager;
     }
 
-    @Resource(name = "filesystem")
+    @Inject
     public void setFileSystem(FileSystem fileSystem) {
         this.fileSystem = fileSystem;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRecipientFolder.java Thu Feb  7 17:54:26 2013
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.commons.collections.iterators.IteratorChain;
@@ -51,11 +51,14 @@ import org.apache.mailet.base.GenericMai
  * 
  */
 public class ToRecipientFolder extends GenericMailet {
-    @Resource(name = "mailboxmanager")
+
+    @Inject
     private MailboxManager mailboxManager;
-    @Resource(name = "usersrepository")
+    
+    @Inject
     private UsersRepository usersRepository;
-    @Resource(name = "filesystem")
+    
+    @Inject
     private FileSystem fileSystem;
 
     private SieveMailet sieveMailet;  // Mailet that actually stores the message

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRepository.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRepository.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToRepository.java Thu Feb  7 17:54:26 2013
@@ -19,13 +19,14 @@
 
 package org.apache.james.transport.mailets;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import javax.mail.MessagingException;
 
 import org.apache.james.mailrepository.api.MailRepository;
 import org.apache.james.mailrepository.api.MailRepositoryStore;
-import org.apache.mailet.base.GenericMailet;
 import org.apache.mailet.Mail;
+import org.apache.mailet.base.GenericMailet;
 
 /**
  * Stores incoming Mail in the specified Repository.<br>
@@ -54,8 +55,8 @@ public class ToRepository extends Generi
 
     private MailRepositoryStore mailStore;
 
-    @Resource(name = "mailrepositorystore")
-    public void setStore(MailRepositoryStore mailStore) {
+    @Inject
+    public void setStore(@Named("mailrepositorystore") MailRepositoryStore mailStore) {
         this.mailStore = mailStore;
     }
 

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToSenderFolder.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToSenderFolder.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToSenderFolder.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/ToSenderFolder.java Thu Feb  7 17:54:26 2013
@@ -20,7 +20,7 @@ package org.apache.james.transport.maile
 
 import java.util.Date;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.james.core.MimeMessageInputStream;
@@ -55,9 +55,11 @@ import org.apache.mailet.base.GenericMai
  * 
  */
 public class ToSenderFolder extends GenericMailet {
-    @Resource(name = "usersrepository")
+
+    @Inject
     private UsersRepository usersRepository;
-    @Resource(name = "mailboxmanager")
+
+    @Inject
     private MailboxManager mailboxManager;
 
     private String folder;

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/UsersRepositoryAliasingForwarding.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/UsersRepositoryAliasingForwarding.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/UsersRepositoryAliasingForwarding.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/UsersRepositoryAliasingForwarding.java Thu Feb  7 17:54:26 2013
@@ -22,13 +22,13 @@ package org.apache.james.transport.maile
 import java.util.ArrayList;
 import java.util.Collection;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMessage;
 
 import org.apache.james.rrt.api.RecipientRewriteTable;
-import org.apache.james.rrt.api.RecipientRewriteTableException;
 import org.apache.james.rrt.api.RecipientRewriteTable.ErrorMappingException;
+import org.apache.james.rrt.api.RecipientRewriteTableException;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.mailet.MailAddress;
 
@@ -65,7 +65,7 @@ public class UsersRepositoryAliasingForw
         return "Local User Aliasing and Forwarding Mailet";
     }
 
-    @Resource(name = "usersrepository")
+    @Inject
     public void setUsersRepository(UsersRepository usersRepository) {
         this.usersRepository = usersRepository;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/WhiteListManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/WhiteListManager.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/WhiteListManager.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/WhiteListManager.java Thu Feb  7 17:54:26 2013
@@ -19,26 +19,6 @@
 
 package org.apache.james.transport.mailets;
 
-import org.apache.james.user.api.UsersRepository;
-import org.apache.james.user.api.model.JamesUser;
-import org.apache.james.util.sql.JDBCUtil;
-import org.apache.james.util.sql.SqlResources;
-import org.apache.mailet.base.GenericMailet;
-import org.apache.mailet.Mail;
-import org.apache.mailet.MailAddress;
-import org.apache.mailet.base.RFC2822Headers;
-import org.apache.mailet.base.RFC822DateFormat;
-
-import javax.annotation.Resource;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-import javax.sql.DataSource;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -57,6 +37,26 @@ import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
 
+import javax.inject.Inject;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+import javax.sql.DataSource;
+
+import org.apache.james.user.api.UsersRepository;
+import org.apache.james.user.api.model.JamesUser;
+import org.apache.james.util.sql.JDBCUtil;
+import org.apache.james.util.sql.SqlResources;
+import org.apache.mailet.Mail;
+import org.apache.mailet.MailAddress;
+import org.apache.mailet.base.GenericMailet;
+import org.apache.mailet.base.RFC2822Headers;
+import org.apache.mailet.base.RFC822DateFormat;
+
 /**
  * <p>
  * Manages for each local user a "white list" of remote addresses whose messages
@@ -165,12 +165,12 @@ public class WhiteListManager extends Ge
     /** Holds value of property sqlParameters. */
     private Map<String, String> sqlParameters = new HashMap<String, String>();
 
-    @Resource(name = "datasource")
+    @Inject
     public void setDataSource(DataSource datasource) {
         this.datasource = datasource;
     }
 
-    @Resource(name = "usersrepository")
+    @Inject
     public void setUsersRepository(UsersRepository localusers) {
         this.localusers = localusers;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractNetworkMatcher.java Thu Feb  7 17:54:26 2013
@@ -21,7 +21,7 @@ package org.apache.james.transport.match
 import java.util.Collection;
 import java.util.StringTokenizer;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.james.dnsservice.api.DNSService;
@@ -98,7 +98,7 @@ public abstract class AbstractNetworkMat
      * 
      * @param dnsService
      */
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dnsService) {
         this.dnsServer = dnsService;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractSQLWhitelistMatcher.java Thu Feb  7 17:54:26 2013
@@ -31,7 +31,7 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.StringTokenizer;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 import javax.sql.DataSource;
 
@@ -61,12 +61,12 @@ public abstract class AbstractSQLWhiteli
     /** Holds value of property sqlParameters. */
     private Map<String, String> sqlParameters = new HashMap<String, String>();
 
-    @Resource(name = "datasource")
+    @Inject
     public void setDataSource(DataSource datasource) {
         this.datasource = datasource;
     }
 
-    @Resource(name = "usersrepository")
+    @Inject
     public void setUsersRepository(UsersRepository localusers) {
         this.localusers = localusers;
     }
@@ -96,7 +96,7 @@ public abstract class AbstractSQLWhiteli
 
     private FileSystem fs;
 
-    @Resource(name = "filesystem")
+    @Inject
     public void setFilesystem(FileSystem fs) {
         this.fs = fs;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractStorageQuota.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractStorageQuota.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractStorageQuota.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/AbstractStorageQuota.java Thu Feb  7 17:54:26 2013
@@ -23,7 +23,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.james.mailbox.MailboxManager;
@@ -66,12 +66,12 @@ abstract public class AbstractStorageQuo
 
     private MailboxManager manager;
 
-    @Resource(name = "mailboxmanager")
+    @Inject
     public void setMailboxManager(MailboxManager manager) {
         this.manager = manager;
     }
 
-    @Resource(name = "usersrepository")
+    @Inject
     public void setUsersRepository(UsersRepository localUsers) {
         this.localUsers = localUsers;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/InSpammerBlacklist.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/InSpammerBlacklist.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/InSpammerBlacklist.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/InSpammerBlacklist.java Thu Feb  7 17:54:26 2013
@@ -23,13 +23,13 @@ import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.StringTokenizer;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.james.dnsservice.api.DNSService;
-import org.apache.mailet.base.GenericMatcher;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailAddress;
+import org.apache.mailet.base.GenericMatcher;
 
 /**
  * Checks the network IP address of the sending server against a blacklist of
@@ -56,7 +56,7 @@ public class InSpammerBlacklist extends 
 
     private DNSService dnsServer;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dnsService) {
         this.dnsServer = dnsService;
     }

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/NetworkIsInWhitelist.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/NetworkIsInWhitelist.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/NetworkIsInWhitelist.java (original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/matchers/NetworkIsInWhitelist.java Thu Feb  7 17:54:26 2013
@@ -26,7 +26,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 
 import org.apache.james.dnsservice.api.DNSService;
@@ -56,7 +56,7 @@ public class NetworkIsInWhitelist extend
      * 
      * @param dns
      */
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dns) {
         this.dns = dns;
     }

Modified: james/server/trunk/protocols/protocols-imap4/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-imap4/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-imap4/pom.xml (original)
+++ james/server/trunk/protocols/protocols-imap4/pom.xml Thu Feb  7 17:54:26 2013
@@ -79,6 +79,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Modified: james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java (original)
+++ james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java Thu Feb  7 17:54:26 2013
@@ -22,7 +22,7 @@ import static org.jboss.netty.channel.Ch
 
 import java.util.concurrent.TimeUnit;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.net.ssl.SSLEngine;
 
 import org.apache.commons.configuration.ConfigurationException;
@@ -32,10 +32,10 @@ import org.apache.james.imap.api.process
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.encode.ImapEncoder;
 import org.apache.james.protocols.api.Encryption;
+import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer;
 import org.apache.james.protocols.netty.ChannelGroupHandler;
 import org.apache.james.protocols.netty.ConnectionLimitUpstreamHandler;
 import org.apache.james.protocols.netty.ConnectionPerIpLimitUpstreamHandler;
-import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.channel.ChannelUpstreamHandler;
@@ -84,17 +84,17 @@ public class IMAPServer extends Abstract
 
     public final static int DEFAULT_LITERAL_SIZE_LIMIT = 0;
 
-    @Resource(name = "imapDecoder")
+    @Inject
     public void setImapDecoder(ImapDecoder decoder) {
         this.decoder = decoder;
     }
 
-    @Resource(name = "imapEncoder")
+    @Inject
     public void setImapEncoder(ImapEncoder encoder) {
         this.encoder = encoder;
     }
 
-    @Resource(name = "imapProcessor")
+    @Inject
     public void setImapProcessor(ImapProcessor processor) {
         this.processor = processor;
     }

Modified: james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServerFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServerFactory.java (original)
+++ james/server/trunk/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServerFactory.java Thu Feb  7 17:54:26 2013
@@ -22,12 +22,15 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.imap.api.process.ImapProcessor;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.encode.ImapEncoder;
+import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader;
 import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer;
 import org.apache.james.protocols.lib.netty.AbstractServerFactory;
 import org.slf4j.Logger;
@@ -38,24 +41,24 @@ public class IMAPServerFactory extends A
     private ImapDecoder decoder;
     private ImapEncoder encoder;
     private ImapProcessor processor;
-
     
+    @Inject
     @Resource(name = "filesystem")
-    public final void setFileSystem(FileSystem filesystem) {
+    public final void setFileSystem(@Named("filesystem") FileSystem filesystem) {
         this.fileSystem = filesystem;
     }
-    
-    @Resource(name = "imapDecoder")
+
+    @Inject
     public void setImapDecoder(ImapDecoder decoder) {
         this.decoder = decoder;
     }
 
-    @Resource(name = "imapEncoder")
+    @Inject
     public void setImapEncoder(ImapEncoder encoder) {
         this.encoder = encoder;
     }
 
-    @Resource(name = "imapProcessor")
+    @Inject
     public void setImapProcessor(ImapProcessor processor) {
         this.processor = processor;
     }

Modified: james/server/trunk/protocols/protocols-library/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/pom.xml (original)
+++ james/server/trunk/protocols/protocols-library/pom.xml Thu Feb  7 17:54:26 2013
@@ -83,6 +83,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Modified: james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java (original)
+++ james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/ProtocolHandlerChainImpl.java Thu Feb  7 17:54:26 2013
@@ -55,7 +55,7 @@ public class ProtocolHandlerChainImpl im
     public void init() throws Exception {
         List<org.apache.commons.configuration.HierarchicalConfiguration> children = handlerchainConfig.configurationsAt("handler");
 
-        // check if the coreHandlersPackage was specified inte hconfig if
+        // check if the coreHandlersPackage was specified in the config, if
         // not add the default
         if (handlerchainConfig.getString("[@coreHandlersPackage]") == null)
             handlerchainConfig.addProperty("[@coreHandlersPackage]", coreHandlersPackage);

Modified: james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/handler/ProtocolHandlerLoader.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/handler/ProtocolHandlerLoader.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/handler/ProtocolHandlerLoader.java (original)
+++ james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/handler/ProtocolHandlerLoader.java Thu Feb  7 17:54:26 2013
@@ -25,8 +25,6 @@ import org.apache.james.protocols.api.ha
  * Implementations of this interface are responsible for loading instances
  * of {@link ProtocolHandler}. This includes to inject all needed resources and 
  * execute any lifecycle methods
- * 
- *
  */
 public interface ProtocolHandlerLoader {
 
@@ -34,7 +32,6 @@ public interface ProtocolHandlerLoader {
      * Load the {@link ProtocolHandler} and make sure all lifecycle methods are called and all
      * needed services injected.
      * 
-     * 
      * @param name
      * @param config
      * @return handler
@@ -42,7 +39,6 @@ public interface ProtocolHandlerLoader {
      */
     public ProtocolHandler load(String name, Configuration config) throws LoadingException;
     
-    
     /**
      * Exception which will get thrown if the loading of a {@link ProtocolHandler} failed 
      * 
@@ -61,5 +57,7 @@ public interface ProtocolHandlerLoader {
         public LoadingException(String msg) {
             super(msg);
         }
+
     }
+
 }

Modified: james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java (original)
+++ james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java Thu Feb  7 17:54:26 2013
@@ -30,7 +30,8 @@ import java.util.concurrent.Executor;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.net.ssl.KeyManagerFactory;
@@ -42,10 +43,9 @@ import org.apache.commons.configuration.
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.lifecycle.api.LogEnabled;
-
 import org.apache.james.protocols.api.Encryption;
-import org.apache.james.protocols.netty.AbstractAsyncServer;
 import org.apache.james.protocols.lib.jmx.ServerMBean;
+import org.apache.james.protocols.netty.AbstractAsyncServer;
 import org.apache.james.util.concurrent.JMXEnabledThreadPoolExecutor;
 import org.jboss.netty.bootstrap.ServerBootstrap;
 import org.jboss.netty.channel.ChannelPipelineFactory;
@@ -116,10 +116,8 @@ public abstract class AbstractConfigurab
 
     private MBeanServer mbeanServer;
 
-    
-    
-    @Resource(name = "filesystem")
-    public final void setFileSystem(FileSystem filesystem) {
+    @Inject
+    public final void setFileSystem(@Named("filesystem") FileSystem filesystem) {
         this.fileSystem = filesystem;
     }
 

Modified: james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java (original)
+++ james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractProtocolAsyncServer.java Thu Feb  7 17:54:26 2013
@@ -18,7 +18,8 @@
  ****************************************************************/
 package org.apache.james.protocols.lib.netty;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -30,8 +31,6 @@ import org.apache.james.protocols.lib.ha
 
 /**
  * Abstract base class which use a {@link ProtocolHandlerLoader} for loading the {@link ProtocolHandler}
- * 
- *
  */
 public abstract class AbstractProtocolAsyncServer extends AbstractConfigurableAsyncServer{
 
@@ -41,8 +40,8 @@ public abstract class AbstractProtocolAs
 
     private HierarchicalConfiguration config;
 
-    @Resource(name = "protocolhandlerloader")
-    public void setProtocolHandlerLoader(ProtocolHandlerLoader loader) {
+    @Inject
+    public void setProtocolHandlerLoader(@Named("protocolhandlerloader") ProtocolHandlerLoader loader) {
         this.loader = loader;
     }
     
@@ -87,4 +86,5 @@ public abstract class AbstractProtocolAs
      * @return jmx
      */
     protected abstract Class< ? extends HandlersPackage> getJMXHandlersPackage();
+
 }

Modified: james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractServerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractServerFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractServerFactory.java (original)
+++ james/server/trunk/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractServerFactory.java Thu Feb  7 17:54:26 2013
@@ -32,16 +32,13 @@ import org.slf4j.Logger;
 
 /**
  * Abstract base class for Factories that need to create {@link AbstractConfigurableAsyncServer}'s via configuration files
- * 
- *
  */
-public abstract class AbstractServerFactory implements Configurable, LogEnabled{
+public abstract class AbstractServerFactory implements Configurable, LogEnabled {
 
     private Logger log;
     private List<AbstractConfigurableAsyncServer> servers;
     private HierarchicalConfiguration config;
 
-
     /**
      * Create {@link AbstractConfigurableAsyncServer} servers, inject dependencies and configure them before return all fo them in a {@link List}
      * 
@@ -52,22 +49,16 @@ public abstract class AbstractServerFact
      */
     protected abstract List<AbstractConfigurableAsyncServer> createServers(Logger log, HierarchicalConfiguration config) throws Exception;
     
-    
-    
     @Override
     public void configure(HierarchicalConfiguration config) throws ConfigurationException {
         this.config = config;
     }
 
-
-
     @Override
     public void setLog(Logger log) {
         this.log = log;
     }
 
-
-
     @PostConstruct
     public void init() throws Exception {
         servers = createServers(log, config);
@@ -76,7 +67,6 @@ public abstract class AbstractServerFact
         }
     }
     
-    
     /**
      * Return all {@link AbstractConfigurableAsyncServer} instances that was create via this Factory
      * @return
@@ -85,14 +75,11 @@ public abstract class AbstractServerFact
         return servers;
     }
     
-    
     @PreDestroy
     public void destroy() {
         for (AbstractConfigurableAsyncServer server: servers) {
             server.destroy();
         }
     }
-    
  
-    
 }

Modified: james/server/trunk/protocols/protocols-lmtp/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-lmtp/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-lmtp/pom.xml (original)
+++ james/server/trunk/protocols/protocols-lmtp/pom.xml Thu Feb  7 17:54:26 2013
@@ -122,6 +122,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

Modified: james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java (original)
+++ james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/hook/MailboxDeliverToRecipientHandler.java Thu Feb  7 17:54:26 2013
@@ -22,7 +22,7 @@ package org.apache.james.lmtpserver.hook
 import java.io.IOException;
 import java.util.Date;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
@@ -50,12 +50,12 @@ public class MailboxDeliverToRecipientHa
     private UsersRepository users;
     private MailboxManager mailboxManager;
 
-    @Resource(name = "usersrepository")
+    @Inject
     public final void setUsersRepository(UsersRepository users) {
         this.users = users;
     }
 
-    @Resource(name = "mailboxmanager")
+    @Inject
     public final void setMailboxManager(MailboxManager mailboxManager) {
         this.mailboxManager = mailboxManager;
     }

Modified: james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java (original)
+++ james/server/trunk/protocols/protocols-lmtp/src/main/java/org/apache/james/lmtpserver/netty/LMTPServerFactory.java Thu Feb  7 17:54:26 2013
@@ -22,6 +22,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.filesystem.api.FileSystem;
@@ -35,16 +37,18 @@ public class LMTPServerFactory extends A
     private ProtocolHandlerLoader loader;
     private FileSystem fileSystem;
 
+    @Inject
     @Resource(name = "protocolhandlerloader")
-    public void setProtocolHandlerLoader(ProtocolHandlerLoader loader) {
+    public void setProtocolHandlerLoader(@Named("protocolhandlerloader") ProtocolHandlerLoader loader) {
         this.loader = loader;
     }
     
+    @Inject
     @Resource(name = "filesystem")
-    public final void setFileSystem(FileSystem filesystem) {
+    public final void setFileSystem(@Named("filesystem") FileSystem filesystem) {
         this.fileSystem = filesystem;
     }
-    
+
     protected LMTPServer createServer() {
        return new LMTPServer();
     }

Modified: james/server/trunk/protocols/protocols-pop3/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-pop3/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-pop3/pom.xml (original)
+++ james/server/trunk/protocols/protocols-pop3/pom.xml Thu Feb  7 17:54:26 2013
@@ -88,6 +88,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
         <!-- Test dependencies -->
         <dependency>
             <groupId>org.apache.james</groupId>

Modified: james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java (original)
+++ james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/core/PassCmdHandler.java Thu Feb  7 17:54:26 2013
@@ -20,7 +20,8 @@ package org.apache.james.pop3server.core
 
 import java.io.IOException;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
@@ -46,9 +47,8 @@ public class PassCmdHandler extends Abst
 
     private MailboxManager manager;
 
-
-    @Resource(name = "mailboxmanager")
-    public void setMailboxManager(MailboxManager manager) {
+    @Inject
+    public void setMailboxManager(@Named("mailboxmanager") MailboxManager manager) {
         this.manager = manager;
     }
 

Modified: james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java (original)
+++ james/server/trunk/protocols/protocols-pop3/src/main/java/org/apache/james/pop3server/netty/POP3ServerFactory.java Thu Feb  7 17:54:26 2013
@@ -4,8 +4,11 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader;
 import org.apache.james.protocols.lib.netty.AbstractConfigurableAsyncServer;
@@ -17,16 +20,18 @@ public class POP3ServerFactory extends A
     private ProtocolHandlerLoader loader;
     private FileSystem fileSystem;
     
+    @Inject
     @Resource(name = "protocolhandlerloader")
-    public void setProtocolHandlerLoader(ProtocolHandlerLoader loader) {
+    public void setProtocolHandlerLoader(@Named("protocolhandlerloader") ProtocolHandlerLoader loader) {
         this.loader = loader;
     }
-    
+
+    @Inject
     @Resource(name = "filesystem")
-    public final void setFileSystem(FileSystem filesystem) {
+    public final void setFileSystem(@Named("filesystem") FileSystem filesystem) {
         this.fileSystem = filesystem;
     }
-    
+
     protected POP3Server createServer() {
        return new POP3Server();
     }

Modified: james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java (original)
+++ james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java Thu Feb  7 17:54:26 2013
@@ -725,7 +725,7 @@ public class POP3ServerTest {
         protocolHandlerChain.put("mailboxmanager", mailboxManager);
     
         fileSystem = new MockFileSystem();
-        protocolHandlerChain.put("filesystem", fileSystem);
+        protocolHandlerChain.put("fileSystem", fileSystem);
     
     }
 

Modified: james/server/trunk/protocols/protocols-smtp/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/pom.xml (original)
+++ james/server/trunk/protocols/protocols-smtp/pom.xml Thu Feb  7 17:54:26 2013
@@ -122,6 +122,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
 
         <!-- Test dependencies -->
         <dependency>

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/AuthRequiredToRelayRcptHook.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/AuthRequiredToRelayRcptHook.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/AuthRequiredToRelayRcptHook.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/AuthRequiredToRelayRcptHook.java Thu Feb  7 17:54:26 2013
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.domainlist.api.DomainListException;
@@ -28,7 +28,7 @@ public class AuthRequiredToRelayRcptHook
 
     private DomainList domains;
 
-    @Resource(name = "domainlist")
+    @Inject
     public void setDomainList(DomainList domains) {
         this.domains = domains;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesMailCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesMailCmdHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesMailCmdHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesMailCmdHandler.java Thu Feb  7 17:54:26 2013
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.domainlist.api.DomainListException;
@@ -28,7 +28,7 @@ public class JamesMailCmdHandler extends
 
     private DomainList domainList;
 
-    @Resource(name = "domainlist")
+    @Inject
     public final void setDomainList(DomainList domainList) {
         this.domainList = domainList;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesRcptCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesRcptCmdHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesRcptCmdHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/JamesRcptCmdHandler.java Thu Feb  7 17:54:26 2013
@@ -19,7 +19,7 @@
 
 package org.apache.james.smtpserver;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.domainlist.api.DomainListException;
@@ -29,7 +29,7 @@ public class JamesRcptCmdHandler extends
 
     private DomainList domainList;
 
-    @Resource(name = "domainlist")
+    @Inject
     public final void setDomainList(DomainList domainList) {
         this.domainList = domainList;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SendMailHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SendMailHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SendMailHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SendMailHandler.java Thu Feb  7 17:54:26 2013
@@ -22,7 +22,8 @@ package org.apache.james.smtpserver;
 import java.util.Collection;
 
 import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import javax.mail.MessagingException;
 
 import org.apache.james.protocols.smtp.SMTPSession;
@@ -42,8 +43,8 @@ public class SendMailHandler implements 
     private MailQueue queue;
     private MailQueueFactory queueFactory;
 
-    @Resource(name = "mailqueuefactory")
-    public void setMailQueueFactory(MailQueueFactory queueFactory) {
+    @Inject
+    public void setMailQueueFactory(@Named("mailqueuefactory") MailQueueFactory queueFactory) {
         this.queueFactory = queueFactory;
     }
 

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/SenderAuthIdentifyVerificationRcptHook.java Thu Feb  7 17:54:26 2013
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.domainlist.api.DomainListException;
@@ -38,12 +38,12 @@ public class SenderAuthIdentifyVerificat
     private DomainList domains;
     private UsersRepository users;
 
-    @Resource(name = "usersrepository")
+    @Inject
     public final void setUsersRepository(UsersRepository users) {
         this.users = users;
     }
 
-    @Resource(name = "domainlist")
+    @Inject
     public void setDomainList(DomainList domains) {
         this.domains = domains;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/UsersRepositoryAuthHook.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/UsersRepositoryAuthHook.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/UsersRepositoryAuthHook.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/UsersRepositoryAuthHook.java Thu Feb  7 17:54:26 2013
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.james.smtpserver;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.protocols.smtp.SMTPSession;
 import org.apache.james.protocols.smtp.hook.AuthHook;
@@ -49,7 +49,7 @@ public class UsersRepositoryAuthHook imp
      * @param users
      *            the users to set
      */
-    @Resource(name = "usersrepository")
+    @Inject
     public final void setUsers(UsersRepository users) {
         this.users = users;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/DNSRBLHandler.java Thu Feb  7 17:54:26 2013
@@ -19,24 +19,24 @@
 
 package org.apache.james.smtpserver.fastfail;
 
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.inject.Inject;
+
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.protocols.lib.lifecycle.InitializingLifecycleAwareProtocolHandler;
 
-import javax.annotation.Resource;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
 public class DNSRBLHandler extends org.apache.james.protocols.smtp.core.fastfail.DNSRBLHandler implements InitializingLifecycleAwareProtocolHandler {
 
-
     private DNSService dns;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dns) {
         this.dns = dns;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/JDBCGreylistHandler.java Thu Feb  7 17:54:26 2013
@@ -33,7 +33,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.sql.DataSource;
 
 import org.apache.commons.configuration.Configuration;
@@ -111,7 +111,7 @@ public class JDBCGreylistHandler extends
      * @param system
      *            The filesystem service
      */
-    @Resource(name = "filesystem")
+    @Inject
     public void setFileSystem(FileSystem system) {
         this.fileSystem = system;
     }
@@ -122,7 +122,7 @@ public class JDBCGreylistHandler extends
      * @param datasource
      *            The datasource
      */
-    @Resource(name = "datasource")
+    @Inject
     public void setDataSource(DataSource datasource) {
         this.datasource = datasource;
     }
@@ -169,7 +169,7 @@ public class JDBCGreylistHandler extends
         setUnseenLifeTime(TimeConverter.getMilliSeconds(unseenLifeTime));
     }
 
-    @Resource(name = "dnsservice")
+    @Inject
     public final void setDNSService(DNSService dnsService) {
         this.dnsService = dnsService;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ResolvableEhloHeloHandler.java Thu Feb  7 17:54:26 2013
@@ -21,7 +21,7 @@ package org.apache.james.smtpserver.fast
 
 import java.net.UnknownHostException;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.dnsservice.api.DNSService;
 
@@ -29,7 +29,7 @@ public class ResolvableEhloHeloHandler e
 
     private DNSService dns;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dns) {
         this.dns = dns;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ReverseEqualsEhloHeloHandler.java Thu Feb  7 17:54:26 2013
@@ -20,21 +20,19 @@ package org.apache.james.smtpserver.fast
 
 import java.net.UnknownHostException;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.dnsservice.api.DNSService;
 
 public class ReverseEqualsEhloHeloHandler extends org.apache.james.protocols.smtp.core.fastfail.ReverseEqualsEhloHeloHandler {
 
-
     private DNSService dns;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dns) {
         this.dns = dns;
     }
 
-
     @Override
     protected String resolve(String host) throws UnknownHostException {
         return dns.getByName(host).getHostName();

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/URIRBLHandler.java Thu Feb  7 17:54:26 2013
@@ -26,7 +26,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeBodyPart;
 import javax.mail.internet.MimeMessage;
@@ -72,7 +72,6 @@ public class URIRBLHandler implements Ja
 
     private boolean getDetail = false;
 
-
     /**
      * Gets the DNS service.
      * 
@@ -88,12 +87,11 @@ public class URIRBLHandler implements Ja
      * @param dnsService
      *            the dnsService to set
      */
-    @Resource(name = "dnsservice")
+    @Inject
     public final void setDNSService(DNSService dnsService) {
         this.dnsService = dnsService;
     }
 
-
     /**
      * Set the UriRBL Servers
      * 

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptHandler.java Thu Feb  7 17:54:26 2013
@@ -20,7 +20,7 @@ package org.apache.james.smtpserver.fast
 
 import java.util.Collection;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
@@ -64,7 +64,7 @@ public class ValidRcptHandler extends Ab
      * @param users
      *            the users to set
      */
-    @Resource(name = "usersrepository")
+    @Inject
     public final void setUsers(UsersRepository users) {
         this.users = users;
     }
@@ -75,12 +75,12 @@ public class ValidRcptHandler extends Ab
      * @param vut
      *            the tableStore to set
      */
-    @Resource(name = "recipientrewritetable")
+    @Inject
     public final void setRecipientRewriteTable(RecipientRewriteTable vut) {
         this.vut = vut;
     }
 
-    @Resource(name = "domainlist")
+    @Inject
     public void setDomainList(DomainList domains) {
         this.domains = domains;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidRcptMX.java Thu Feb  7 17:54:26 2013
@@ -19,6 +19,13 @@
 
 package org.apache.james.smtpserver.fastfail;
 
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import javax.inject.Inject;
+
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.dnsservice.api.DNSService;
@@ -35,12 +42,6 @@ import org.apache.james.protocols.smtp.h
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.Resource;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
 /**
  * This class can be used to reject email with bogus MX which is send from a
  * authorized user or an authorized network.
@@ -88,7 +89,7 @@ public class ValidRcptMX implements Init
      *
      * @param dnsService the dnsService to set
      */
-    @Resource(name = "dnsservice")
+    @Inject
     public final void setDNSService(DNSService dnsService) {
         this.dnsService = dnsService;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/fastfail/ValidSenderDomainHandler.java Thu Feb  7 17:54:26 2013
@@ -21,7 +21,7 @@ package org.apache.james.smtpserver.fast
 
 import java.util.Collection;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.protocols.smtp.SMTPSession;
@@ -30,7 +30,7 @@ public class ValidSenderDomainHandler ex
     
     private DNSService dnsService;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dnsService) {
         this.dnsService = dnsService;
     }

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java Thu Feb  7 17:54:26 2013
@@ -20,7 +20,7 @@ package org.apache.james.smtpserver.nett
 
 
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.HierarchicalConfiguration;
@@ -88,13 +88,11 @@ public class SMTPServer extends Abstract
     
     private SMTPChannelUpstreamHandler coreHandler;
 
-    @Resource(name = "dnsservice")
+    @Inject
     public void setDNSService(DNSService dns) {
         this.dns = dns;
     }
     
-    
-    
     @Override
     protected void preInit() throws Exception {
         super.preInit();

Modified: james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServerFactory.java Thu Feb  7 17:54:26 2013
@@ -23,6 +23,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.dnsservice.api.DNSService;
@@ -32,25 +34,27 @@ import org.apache.james.protocols.lib.ne
 import org.apache.james.protocols.lib.netty.AbstractServerFactory;
 import org.slf4j.Logger;
 
-public class SMTPServerFactory extends AbstractServerFactory{
+public class SMTPServerFactory extends AbstractServerFactory {
 
     private DNSService dns;
     private ProtocolHandlerLoader loader;
     private FileSystem fileSystem;
 
+    @Inject
     @Resource(name = "dnsservice")
-    public void setDNSService(DNSService dns) {
+    public void setDNSService(@Named("dnsservice") DNSService dns) {
         this.dns = dns;
     }
     
-    @Resource(name = "protocolhandlerloader")
-    public void setProtocolHandlerLoader(ProtocolHandlerLoader loader) {
+    @Inject
+    @Resource(name = "protocolhandlerloader")
+    public void setProtocolHandlerLoader(@Named("protocolhandlerloader") ProtocolHandlerLoader loader) {
         this.loader = loader;
     }
-    
 
+    @Inject
     @Resource(name = "filesystem")
-    public final void setFileSystem(FileSystem filesystem) {
+    public final void setFileSystem(@Named("filesystem") FileSystem filesystem) {
         this.fileSystem = filesystem;
     }
 
@@ -61,6 +65,7 @@ public class SMTPServerFactory extends A
     @SuppressWarnings("unchecked")
     @Override
     protected List<AbstractConfigurableAsyncServer> createServers(Logger log, HierarchicalConfiguration config) throws Exception{
+        
         List<AbstractConfigurableAsyncServer> servers = new ArrayList<AbstractConfigurableAsyncServer>();
         List<HierarchicalConfiguration> configs = config.configurationsAt("smtpserver");
         

Modified: james/server/trunk/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java (original)
+++ james/server/trunk/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java Thu Feb  7 17:54:26 2013
@@ -288,7 +288,7 @@ public class SMTPServerTest {
         chain.put("mailStore", store);
         fileSystem = new MockFileSystem();
 
-        chain.put("filesystem", fileSystem);
+        chain.put("fileSystem", fileSystem);
         chain.put("org.apache.james.smtpserver.protocol.DNSService", dnsService);
         chain.put("recipientrewritetable", new RecipientRewriteTable() {
 

Modified: james/server/trunk/queue/queue-activemq/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-activemq/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-activemq/pom.xml (original)
+++ james/server/trunk/queue/queue-activemq/pom.xml Thu Feb  7 17:54:26 2013
@@ -103,6 +103,10 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-annotation_1.1_spec</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
 
         <!-- testing -->
         <dependency>

Modified: james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java (original)
+++ james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobStrategy.java Thu Feb  7 17:54:26 2013
@@ -42,12 +42,12 @@ import org.apache.james.filesystem.api.F
  */
 public class FileSystemBlobStrategy implements BlobUploadStrategy, BlobDownloadStrategy, ActiveMQSupport {
 
-    private final FileSystem fs;
+    private final FileSystem fileSystem;
     private final BlobTransferPolicy policy;
     private int splitCount;
 
-    public FileSystemBlobStrategy(final BlobTransferPolicy policy, final FileSystem fs, int splitCount) {
-        this.fs = fs;
+    public FileSystemBlobStrategy(final BlobTransferPolicy policy, final FileSystem fileSystem, int splitCount) {
+        this.fileSystem = fileSystem;
         this.policy = policy;
         this.splitCount = splitCount;
     }
@@ -130,7 +130,7 @@ public class FileSystemBlobStrategy impl
      */
     protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException {
         if (message.getURL() != null) {
-            return fs.getFile(message.getURL().toString());
+            return fileSystem.getFile(message.getURL().toString());
         }
 
         // Make sure it works on windows in all cases and make sure
@@ -141,7 +141,7 @@ public class FileSystemBlobStrategy impl
 
         String queueUrl = policy.getUploadUrl() + "/" + i;
 
-        File queueF = fs.getFile(queueUrl);
+        File queueF = fileSystem.getFile(queueUrl);
 
         synchronized (queueF) {
             // check if we need to create the queue folder
@@ -150,7 +150,7 @@ public class FileSystemBlobStrategy impl
             }
         }
 
-        return fs.getFile(queueUrl + "/" + filename);
+        return fileSystem.getFile(queueUrl + "/" + filename);
 
     }
 }

Modified: james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobTransferPolicy.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobTransferPolicy.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobTransferPolicy.java (original)
+++ james/server/trunk/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/FileSystemBlobTransferPolicy.java Thu Feb  7 17:54:26 2013
@@ -19,6 +19,8 @@
 package org.apache.james.queue.activemq;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.apache.activemq.blob.BlobDownloadStrategy;
 import org.apache.activemq.blob.BlobTransferPolicy;
@@ -32,13 +34,14 @@ import org.apache.james.filesystem.api.F
  */
 public class FileSystemBlobTransferPolicy extends BlobTransferPolicy {
 
-    private FileSystem fs;
+    private FileSystem fileSystem;
     private int splitCount = 10;
     private FileSystemBlobStrategy strategy;
 
+    @Inject
     @Resource(name = "filesystem")
-    public void setFileSystem(FileSystem fs) {
-        this.fs = fs;
+    public void setFileSystem(@Named("filesystem") FileSystem fileSystem) {
+        this.fileSystem = fileSystem;
     }
 
     public void setSplitCount(int splitCount) {
@@ -48,7 +51,7 @@ public class FileSystemBlobTransferPolic
     @Override
     public BlobTransferPolicy copy() {
         FileSystemBlobTransferPolicy that = new FileSystemBlobTransferPolicy();
-        that.setFileSystem(fs);
+        that.setFileSystem(fileSystem);
         that.setDefaultUploadUrl(getDefaultUploadUrl());
         that.setBrokerUploadUrl(getBrokerUploadUrl());
         that.setUploadUrl(getUploadUrl());
@@ -68,7 +71,7 @@ public class FileSystemBlobTransferPolic
 
     private synchronized FileSystemBlobStrategy getStrategy() {
         if (strategy == null) {
-            strategy = new FileSystemBlobStrategy(this, fs, splitCount);
+            strategy = new FileSystemBlobStrategy(this, fileSystem, splitCount);
         }
         return strategy;
     }

Modified: james/server/trunk/queue/queue-file/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-file/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-file/pom.xml (original)
+++ james/server/trunk/queue/queue-file/pom.xml Thu Feb  7 17:54:26 2013
@@ -47,6 +47,10 @@
             <groupId>org.apache.james</groupId>
             <artifactId>james-server-core</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
 
         <!-- test dependencies -->
         <dependency>

Modified: james/server/trunk/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java (original)
+++ james/server/trunk/queue/queue-file/src/main/java/org/apache/james/queue/file/FileMailQueueFactory.java Thu Feb  7 17:54:26 2013
@@ -22,7 +22,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.annotation.Resource;
+import javax.inject.Inject;
 
 import org.apache.james.filesystem.api.FileSystem;
 import org.apache.james.lifecycle.api.LogEnabled;
@@ -32,8 +32,6 @@ import org.slf4j.Logger;
 
 /**
  * {@link MailQueueFactory} implementation which returns {@link FileMailQueue} instances
- * 
- *
  */
 public class FileMailQueueFactory implements MailQueueFactory, LogEnabled{
 
@@ -42,7 +40,7 @@ public class FileMailQueueFactory implem
     private Logger log;
     private boolean sync = true;
     
-    @Resource(name = "filesystem")
+    @Inject
     public void setFileSystem(FileSystem fs) {
         this.fs = fs;
     }

Modified: james/server/trunk/queue/queue-jms/pom.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-jms/pom.xml?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-jms/pom.xml (original)
+++ james/server/trunk/queue/queue-jms/pom.xml Thu Feb  7 17:54:26 2013
@@ -76,6 +76,10 @@
             <groupId>org.apache.james.protocols</groupId>
             <artifactId>protocols-smtp</artifactId>
         </dependency>
+        <dependency>
+          <groupId>javax.inject</groupId>
+          <artifactId>javax.inject</artifactId>
+        </dependency>
 
         <!-- test dependencies -->
         <dependency>

Modified: james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueFactory.java (original)
+++ james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueFactory.java Thu Feb  7 17:54:26 2013
@@ -19,6 +19,8 @@
 package org.apache.james.queue.jms;
 
 import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
 import javax.jms.ConnectionFactory;
 
 import org.apache.james.queue.api.MailQueue;
@@ -32,8 +34,9 @@ public class JMSMailQueueFactory extends
 
     protected ConnectionFactory connectionFactory;
 
+    @Inject
     @Resource(name = "jmsConnectionFactory")
-    public void setConnectionFactory(ConnectionFactory connectionFactory) {
+    public void setConnectionFactory(@Named("jmsConnectionFactory") ConnectionFactory connectionFactory) {
         this.connectionFactory = connectionFactory;
     }
 
@@ -45,4 +48,5 @@ public class JMSMailQueueFactory extends
     protected MailQueue createMailQueue(String name) {
         return new JMSMailQueue(connectionFactory, name, log);
     }
-}
\ No newline at end of file
+    
+}

Modified: james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/library/AbstractMailQueueFactory.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/library/AbstractMailQueueFactory.java?rev=1443630&r1=1443629&r2=1443630&view=diff
==============================================================================
--- james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/library/AbstractMailQueueFactory.java (original)
+++ james/server/trunk/queue/queue-jms/src/main/java/org/apache/james/queue/library/AbstractMailQueueFactory.java Thu Feb  7 17:54:26 2013
@@ -78,7 +78,9 @@ public abstract class AbstractMailQueueF
      * org.apache.james.queue.api.MailQueueFactory#getQueue(java.lang.String)
      */
     public synchronized final MailQueue getQueue(String name) {
+        
         MailQueue queue = queues.get(name);
+
         if (queue == null) {
             queue = createMailQueue(name);
             if (useJMX) {
@@ -135,4 +137,5 @@ public abstract class AbstractMailQueueF
     public void setLog(Logger log) {
         this.log = log;
     }
-}
\ No newline at end of file
+    
+}



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