You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2009/09/23 21:33:29 UTC

svn commit: r818221 - /james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java

Author: rdonkin
Date: Wed Sep 23 19:33:29 2009
New Revision: 818221

URL: http://svn.apache.org/viewvc?rev=818221&view=rev
Log:
Matcher is only used with one method so convert field to variable. This allows Delay to be marked 'final static'.

Modified:
    james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java

Modified: james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=818221&r1=818220&r2=818221&view=diff
==============================================================================
--- james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java (original)
+++ james/server/trunk/mailets-function/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java Wed Sep 23 19:33:29 2009
@@ -252,12 +252,6 @@
     private String bounceProcessor = null; 
 
     /**
-     * Matcher used in 'init' method to parse delayTimes specified in config
-     * file.
-     */
-    private Perl5Matcher delayTimeMatcher;
-
-    /**
      * Filter used by 'accept' to check if message is ready for retrying.
      */
     private MultipleDelayFilter delayFilter = new MultipleDelayFilter();
@@ -283,14 +277,16 @@
         ArrayList<Delay> delayTimesList = new ArrayList<Delay>();
         try {
             if (getInitParameter("delayTime") != null) {
-                delayTimeMatcher = new Perl5Matcher();
+
+                // parses delayTimes specified in config file.
+                final Perl5Matcher delayTimeMatcher = new Perl5Matcher();
                 String delayTimesParm = getInitParameter("delayTime");
 
                 // Split on commas
                 StringTokenizer st = new StringTokenizer (delayTimesParm,",");
                 while (st.hasMoreTokens()) {
                     String delayTime = st.nextToken();
-                    delayTimesList.add (new Delay(delayTime));
+                    delayTimesList.add (new Delay(delayTimeMatcher, delayTime));
                 }
             } else {
                 // Use default delayTime.
@@ -516,7 +512,7 @@
      * This class is used to hold a delay time and its corresponding number of
      * retries.
      **/
-    private class Delay {
+    private final static class Delay {
         private int attempts = 1;
 
         private long delayTime = DEFAULT_DELAY_TIME;
@@ -535,7 +531,7 @@
          * @param initString
          *            the string to initialize this Delay object from
          **/
-        public Delay(String initString) throws MessagingException {
+        public Delay(final Perl5Matcher delayTimeMatcher, String initString) throws MessagingException {
             // Default unit value to 'msec'.
             String unit = "msec";
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org