Patch add ability to set handler execution order for given phase .This allow to specify at which place in hander chain user’s handler should be executed, so handlers can be placed before or in the middle of global handlers.
If two handlers have the same priority, then insertion order is keep.
Modification :
- Handler interface is extended with getPriority method.
- AbstractHandler has priority set to 10000, so user who don’t want to set handler order can just skip this method. This value should be enough to put user handler after any global handler ( assuming global order priority starts from 1000 with 1000 step) .
Following handler have assigned priority :
[Handler name] [phase] [priority]
ParseMessageHandler DISPATCH 1000
DispatchServiceHandler DISPATCH 2000
ReadHeadersHandler PARSE 1000
ValidateHeadersHandler PRE_INVOKE 1000
AbstractBinding SERVICE 1000
SoapSerializerHandler TRANSPORT 1000
OutMessageSender SEND 1000
FaultSoapSerializerHandler TRANSPORT 1000
FaultResponseCodeHandler TRANSPORT 2000
FaultSender SEND 3000
I’m not sure about priorities for following handler, because i couldn’t find them inserted in any handlers chain:
AddressingInHandler PRE_DISPATCH 1000
ServiceRouterHandler PRE_DISPATCH 1000
AddressingOutHandler TRANSPORT 1000
or maybe its better idea to set some special value to AbstractHandler priority like -1 instead of 10000, and during addition to HandlerChain ( if no other value is set ) setting handler priority to priority of the last handler (with highest priority ).
Any comments ?