On 6/2/07, Glen Daniels <[EMAIL PROTECTED]> wrote:
Hi Amila!
Amila Suriarachchi wrote:
> <module name="Security">
> <InFlow>
> <!-- Add Decrypt phase if not already present. If it's there
-->
> <!-- already, just confirm that it matches these rules ( i.e
. -->
> <!-- after Transport)
-->
> <phase name="Decrypt" after="Transport">
> <handler name="DecryptionHandler" class="..."/>
> </phase>
> <handler name="OtherHandler" class="...">
> <order phase="Dispatch"/>
> </handler>
> </InFlow>
> ...
> </module>
>
>
> I am not sure the practical limitations of doing this but,
> +1 for adding Phases in InFlow and OutFlow and placing them using the
> phase order rules like
> in handlers. I belive this would allow us to develop modules as real
> pluggable components.
This is relatively easy to do (I've already written the code once), and
I agree 100% this is what is needed to make Modules sufficiently...
well, modular. :) This was absolutely the design center that I had in
mind even from the outset of the Axis2 discussions.
Essentially you have a list of Constraints - a Constraint is like "A
must come before B" or "A must be in Phase Q". Whenever you deploy a
thing (Handler or Phase) with Constraints, you check its Constraints
against the current state of the ExecutionChain. If everything is
either satisfied or "open" (we'll come back to this in a sec) then that
deployment was successful. "Open" means that one of the referents of
the Constraint didn't exist at the time - so for instance if we're
deploying "A" and it says "A before B" but there's no "B" yet, we can
put A in and it works.
As I understood We have set of phases order of which determines by the phase
rules (eg. before, after) and within a phase we have set of handlers .
Agian order of the handlers within the phase is determined by the handler
rules. (eg. before, after).
So lets say we have a phase rule like this,
<phase name="Decrypt" after="WrongPhaseName">
<handler name="DecryptionHandler" class="..."/>
</phase>
if the WrongPhaseName phase does not exists why shouldn't it throw an
exception?
Later some one may or may not deploy a phase as given. we can not sure.
Then later if we deploy "B", there is a check at
that time for any open Constraints involving B. If we find one that
says "A before B" we'll know we have to satisfy that as well as whatever
B's native Constraints are in order to succeed.
This process isn't that computationally expensive, since our
handler/phase chains aren't ever going to be that long (I would guess it
will be VERY rare to see even a 20-Handler chain, let alone hundreds)
and the code can be written quite efficiently.
I also believe this will result in cleaner and more comprehensible
Handler-wrangling code.
--Glen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Amila Suriarachchi,
WSO2 Inc.