public static void addInterceptors ( InterceptorProvider provider ) { PhaseManager phases = BusFactory . getDefaultBus ( ) . getExtension ( PhaseManager . class ) ; for ( Phase p : phases . getInPhases ( ) ) { provider . getInInterceptors ( ) . add ( new DemoInterceptor ( p . getName ( ) ) ) ; provider . getInFaultInterceptors ( ) . add ( new DemoInterceptor ( p . getName ( ) ) ) ; } for ( Phase p : phases . getOutPhases ( ) ) { provider . getOutInterceptors ( ) . add ( new DemoInterceptor ( p . getName ( ) ) ) ; provider . getOutFaultInterceptors ( ) . add ( new DemoInterceptor ( p . getName ( ) ) ) ; } }
This method will add a DemoInterceptor into every in and every out phase of the interceptor chains .