History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-142
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Diephouse
Reporter: Tomasz Sztelak
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XFire

Setting handler execution order

Created: 02/Oct/05 02:09 PM   Updated: 11/Nov/05 03:23 PM
Component/s: Core
Affects Version/s: None
Fix Version/s: 1.0-M6

Time Tracking:
Not Specified

File Attachments: 1. File HandlerOrdering (13 kb)



 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Tomasz Sztelak - 04/Oct/05 02:19 PM
Now i see some litle problem with current patch implementation, numer of global handlers always will be limited ( e.g. to 10 for AbstractHandler priority = 10.000 ). One solution is to set its priority to higher valule like 100.000
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 ?


Dan Diephouse - 11/Nov/05 03:23 PM
I did this in CVS. You can specify the name of the Handler you want to run before or after. Or you can override Handler.compareTo() and provide your own ordering alogorithm