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 "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2007/05/01 16:21:15 UTC

[jira] Resolved: (JSPF-47) Refactor jSPF to support staged processing

     [ https://issues.apache.org/jira/browse/JSPF-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara resolved JSPF-47.
---------------------------------

    Resolution: Fixed

Renamed SPF1Data to SPFSession: SPFSession is created at the start of an SPF lookup and is used to store the status of the current lookup until a result is available.

SPFExecutor is a service that takes an SPFSession and execute it to complete a result.

SPF.checkSPF now returns a subclass of SPFResult => FutureSPFResult. FutureSPFResult is returned in a non-blocking way and the result is the injected (and the object notified) by the SPFExecutor, asynchronously.

FutureSPFResult will block the callers (waiting for the result) if getResult is called before the result is available.

an SPFSession has 2 stacks:
1) SPFChecker stack
2) SPFCheckerExceptionCatcher stack

An SPFExecutor will do the following to execute a lookup:
1) take a checker from the stack
2) execute it
   2a) if it returns a DNSLookupContinuation execute the lookup and call the callback
   2b) if it returns null go to 1.
If there are no more checkers in the stack the processing have been completed.
If an exception happen during an SPFChecker execution then an SPFCheckerExceptionCatcher is taken from the stack and executed.

Most Mechanisms/Modifiers/SPFRetriever have been rewritten to simply "split" their processing into multiple SPFCheckers. As soon as they are executed they place new "children" SPFCheckers in the stack, the executor will take care to execute them.

The Synchronous SPFExecutor simply run spflookups in the same "cycle": it receives the DNSLookupContinuation, it run synchronously the blocking lookup and it calls the continuation callback.
The StagedMultipleSPFExecutor instead manage queue of dns responses and have a worker thread for the main execution.




> Refactor jSPF to support staged processing
> ------------------------------------------
>
>                 Key: JSPF-47
>                 URL: https://issues.apache.org/jira/browse/JSPF-47
>             Project: jSPF
>          Issue Type: Sub-task
>          Components: Core
>    Affects Versions: 0.9b4
>            Reporter: Stefano Bagnara
>         Assigned To: Stefano Bagnara
>             Fix For: 0.9.5
>
>
> In order to support asynchronous operation in JSPF we have to refactor it to work via "event messaging".
> The only asynchronous component in a jSPF lookup is the DNS Lookup.
> We can see the asynchronous processing like an asynchronous conversation bettween the SPF resolver and the DNS server. SPF resolver has no blocking components apart DNS lookups.
> DNS lookups are performed by:
> 1) MacroExpansion
> 2) SPF Mechanisms/Modifiers
> 3) Main SPF records retriever

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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