CXF Interceptor Intercept sequence

Source: Internet
Author: User

CXF Interceptor in phase order Java code
  1. In Org.apache.cxf.phase.PhaseManagerImpl
  2. Final void createinphases () {
  3. int i = 0;
  4. inphases = new sortedarrayset<phase> ();
  5. Inphases.add (new Phase (phase.receive, ++i * 1000));
  6. Inphases.add (new Phase (Phase.pre_stream, ++i * 1000));
  7. Inphases.add (new Phase (Phase.user_stream, ++i * 1000));
  8. Inphases.add (new Phase (Phase.post_stream, ++i * 1000));
  9. Inphases.add (new Phase (Phase.read, ++i * 1000));
  10. Inphases.add (new Phase (Phase.pre_protocol, ++i * 1000));
  11. Inphases.add (new Phase (Phase.user_protocol, ++i * 1000));
  12. Inphases.add (new Phase (Phase.post_protocol, ++i * 1000));
  13. Inphases.add (new Phase (Phase.unmarshal, ++i * 1000));
  14. Inphases.add (new Phase (phase.pre_logical, ++i * 1000));
  15. Inphases.add (new Phase (phase.user_logical, ++i * 1000));
  16. Inphases.add (new Phase (phase.post_logical, ++i * 1000));
  17. Inphases.add (new Phase (Phase.pre_invoke, ++i * 1000));
  18. Inphases.add (new Phase (Phase.invoke, ++i * 1000));
  19. Inphases.add (new Phase (Phase.post_invoke, ++i * 1000));
  20. }
  21. final void createoutphases () {
  22. outphases = new sortedarrayset<phase> ();
  23. int i = 0;
  24. Outphases.add (new Phase (Phase.setup, ++i * 1000));
  25. Outphases.add (new Phase (phase.pre_logical, ++i * 1000));
  26. Outphases.add (new Phase (phase.user_logical, ++i * 1000));
  27. Outphases.add (new Phase (phase.post_logical, ++i * 1000));
  28. Outphases.add (new Phase (Phase.prepare_send, ++i * 1000));
  29. Outphases.add (new Phase (Phase.pre_stream, ++i * 1000));
  30. Outphases.add (new Phase (Phase.pre_protocol, ++i * 1000));
  31. Outphases.add (new Phase (Phase.write, ++i * 1000));
  32. Outphases.add (new Phase (Phase.pre_marshal, ++i * 1000));
  33. Outphases.add (new Phase (Phase.marshal, ++i * 1000));
  34. Outphases.add (new Phase (Phase.post_marshal, ++i * 1000));
  35. Outphases.add (new Phase (Phase.user_protocol, ++i * 1000));
  36. Outphases.add (new Phase (Phase.post_protocol, ++i * 1000));
  37. Outphases.add (new Phase (Phase.user_stream, ++i * 1000));
  38. Outphases.add (new Phase (Phase.post_stream, ++i * 1000));
  39. Outphases.add (new Phase (Phase.send, ++i * 1000));
  40. //make sure ending interceptors is put in positions symmetric
  41. //To their starting interceptors
  42. Outphases.add (new Phase (phase.send_ending, ++i * 1000));
  43. Outphases.add (new Phase (phase.post_stream_ending, ++i * 1000));
  44. Outphases.add (new Phase (phase.user_stream_ending, ++i * 1000));
  45. Outphases.add (new Phase (phase.post_protocol_ending, ++i * 1000));
  46. Outphases.add (new Phase (phase.user_protocol_ending, ++i * 1000));
  47. Outphases.add (new Phase (phase.marshal_ending, ++i * 1000));
  48. Outphases.add (new Phase (phase.write_ending, ++i * 1000));
  49. Outphases.add (new Phase (phase.pre_protocol_ending, ++i * 1000));
  50. Outphases.add (new Phase (phase.pre_stream_ending, ++i * 1000));
  51. Outphases.add (new Phase (phase.prepare_send_ending, ++i * 1000));
  52. Outphases.add (new Phase (phase.post_logical_ending, ++i * 1000));
  53. Outphases.add (new Phase (phase.user_logical_ending, ++i * 1000));
  54. Outphases.add (new Phase (phase.pre_logical_ending, ++i * 1000));
  55. Outphases.add (new Phase (phase.setup_ending, ++i * 1000));
  56. }

Also, if the levels are the same, they are intercepted in the order in which they are configured. The order is the order in which the <javaxws:interceptors></javaxws:interceptors> tags appear.

CXF Interceptor Intercept sequence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.