CXF Interceptor in phase order Java code
- In Org.apache.cxf.phase.PhaseManagerImpl
- Final void createinphases () {
- int i = 0;
- inphases = new sortedarrayset<phase> ();
- Inphases.add (new Phase (phase.receive, ++i * 1000));
- Inphases.add (new Phase (Phase.pre_stream, ++i * 1000));
- Inphases.add (new Phase (Phase.user_stream, ++i * 1000));
- Inphases.add (new Phase (Phase.post_stream, ++i * 1000));
- Inphases.add (new Phase (Phase.read, ++i * 1000));
- Inphases.add (new Phase (Phase.pre_protocol, ++i * 1000));
- Inphases.add (new Phase (Phase.user_protocol, ++i * 1000));
- Inphases.add (new Phase (Phase.post_protocol, ++i * 1000));
- Inphases.add (new Phase (Phase.unmarshal, ++i * 1000));
- Inphases.add (new Phase (phase.pre_logical, ++i * 1000));
- Inphases.add (new Phase (phase.user_logical, ++i * 1000));
- Inphases.add (new Phase (phase.post_logical, ++i * 1000));
- Inphases.add (new Phase (Phase.pre_invoke, ++i * 1000));
- Inphases.add (new Phase (Phase.invoke, ++i * 1000));
- Inphases.add (new Phase (Phase.post_invoke, ++i * 1000));
- }
- final void createoutphases () {
- outphases = new sortedarrayset<phase> ();
- int i = 0;
- Outphases.add (new Phase (Phase.setup, ++i * 1000));
- Outphases.add (new Phase (phase.pre_logical, ++i * 1000));
- Outphases.add (new Phase (phase.user_logical, ++i * 1000));
- Outphases.add (new Phase (phase.post_logical, ++i * 1000));
- Outphases.add (new Phase (Phase.prepare_send, ++i * 1000));
- Outphases.add (new Phase (Phase.pre_stream, ++i * 1000));
- Outphases.add (new Phase (Phase.pre_protocol, ++i * 1000));
- Outphases.add (new Phase (Phase.write, ++i * 1000));
- Outphases.add (new Phase (Phase.pre_marshal, ++i * 1000));
- Outphases.add (new Phase (Phase.marshal, ++i * 1000));
- Outphases.add (new Phase (Phase.post_marshal, ++i * 1000));
- Outphases.add (new Phase (Phase.user_protocol, ++i * 1000));
- Outphases.add (new Phase (Phase.post_protocol, ++i * 1000));
- Outphases.add (new Phase (Phase.user_stream, ++i * 1000));
- Outphases.add (new Phase (Phase.post_stream, ++i * 1000));
- Outphases.add (new Phase (Phase.send, ++i * 1000));
- //make sure ending interceptors is put in positions symmetric
- //To their starting interceptors
- Outphases.add (new Phase (phase.send_ending, ++i * 1000));
- Outphases.add (new Phase (phase.post_stream_ending, ++i * 1000));
- Outphases.add (new Phase (phase.user_stream_ending, ++i * 1000));
- Outphases.add (new Phase (phase.post_protocol_ending, ++i * 1000));
- Outphases.add (new Phase (phase.user_protocol_ending, ++i * 1000));
- Outphases.add (new Phase (phase.marshal_ending, ++i * 1000));
- Outphases.add (new Phase (phase.write_ending, ++i * 1000));
- Outphases.add (new Phase (phase.pre_protocol_ending, ++i * 1000));
- Outphases.add (new Phase (phase.pre_stream_ending, ++i * 1000));
- Outphases.add (new Phase (phase.prepare_send_ending, ++i * 1000));
- Outphases.add (new Phase (phase.post_logical_ending, ++i * 1000));
- Outphases.add (new Phase (phase.user_logical_ending, ++i * 1000));
- Outphases.add (new Phase (phase.pre_logical_ending, ++i * 1000));
- Outphases.add (new Phase (phase.setup_ending, ++i * 1000));
- }
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