Author: bago
Date: Mon Feb 25 05:14:22 2008
New Revision: 630835
URL: http://svn.apache.org/viewvc?rev=630835&view=rev
Log:
Minor fixes and updated README.txt to reflect the catchers removal.
Modified:
james/jspf/trunk/README.txt
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/Directive.java
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
Modified: james/jspf/trunk/README.txt
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/README.txt?rev=630835&r1=630834&r2=630835&view=diff
==============================================================================
--- james/jspf/trunk/README.txt (original)
+++ james/jspf/trunk/README.txt Mon Feb 25 05:14:22 2008
@@ -79,12 +79,16 @@
turn is allowed to return DNSLookupContinuation if it needs DNS lookups). When
an SPFChecker (or the
SPFCheckerDNSResponseListener) completed the processing it will return null.
-The SPFSession includes 2 stacks: the "checkers" Stack and the "catchers"
Stack. The former contains
-the "to be processed" SPFChecker, the latter contains
SPFCheckerExceptionCatcher.
+The SPFSession includes a checkers stack: A checker can also implement the
SPFCheckerExceptionCatcher
+interface to be able to intercept exceptions from the nested checkers.
The SPFExecutor role is to pop an SPFChecker from the SPFSession and execute
it, by processing the
DNSRequests included in the returned DNSLookupContinuations until a null is
returned. If an exception
-is thrown by the current checker then an SPFCheckerExceptionCatcher is
retrieved from the catcher
-stack and executed to handle the exception.
+is thrown by the current checker then the executor will poll every checker
from the stack looking for
+a checker implementing the SPFCheckerExceptionCatcher interface, will remove
it from the stack and
+will execute its onException method to handle the exception.
+Please note that the SPFCheckerExceptionCatcher call wil often result in an
additional exception to be
+rethrown and the executor will take care to pop the chekers looking for
another catcher that will handle
+the new exception.
Terms, Policies and the Parser are all implementations of the SPFChecker
interface. An SPFChecker
implementation can do every processing in the checkSPF method or can simply
push more fine grained
Modified:
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/Directive.java
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/Directive.java?rev=630835&r1=630834&r2=630835&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/Directive.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/Directive.java
Mon Feb 25 05:14:22 2008
@@ -105,7 +105,7 @@
public DNSLookupContinuation checkSPF(SPFSession spfSession) throws
PermErrorException,
TempErrorException, NoneException, NeutralException {
// if already have a current result we don't run this
- if (spfSession.getCurrentResult() == null) {
+ if (spfSession.getCurrentResult() == null &&
spfSession.getCurrentResultExpanded() == null) {
spfSession.removeAttribute(ATTRIBUTE_MECHANISM_RESULT);
Modified:
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java?rev=630835&r1=630834&r2=630835&view=diff
==============================================================================
---
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
(original)
+++
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/IncludeMechanism.java
Mon Feb 25 05:14:22 2008
@@ -59,6 +59,7 @@
spfData.setIgnoreExplanation(true);
// set a null current result
spfData.setCurrentResult(null);
+ spfData.setCurrentResultExpanded(null);
spfData.pushChecker(spfChecker);
@@ -68,12 +69,14 @@
private final class CleanupAndResultChecker implements SPFChecker,
SPFCheckerExceptionCatcher {
private String previousResult;
+ private String previousResultExpanded;
private String previousDomain;
private void restoreSession(SPFSession spfData) {
spfData.setIgnoreExplanation(false);
spfData.setCurrentDomain(previousDomain);
spfData.setCurrentResult(previousResult);
+ spfData.setCurrentResultExpanded(previousResultExpanded);
}
/**
@@ -132,6 +135,7 @@
// do we need to backup the session attributes and restore them?
this.previousResult = spfSession.getCurrentResult();
this.previousDomain = spfSession.getCurrentDomain();
+ this.previousResultExpanded =
spfSession.getCurrentResultExpanded();
return this;
}
}
Modified:
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
URL:
http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java?rev=630835&r1=630834&r2=630835&view=diff
==============================================================================
---
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
(original)
+++
james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/RedirectModifier.java
Mon Feb 25 05:14:22 2008
@@ -82,7 +82,7 @@
throws PermErrorException, NoneException,
TempErrorException, NeutralException {
- checkSPF(session);
+ session.setIgnoreExplanation(true);
// remove every checker until the initialized one
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]