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: [email protected]
For additional commands, e-mail: [email protected]