2016-10-18 4 views
1

나는 UNMARSHAL 단계에 대한 MultiPart 요청에 대한 특정 논리를 수행 할 인터셉터를 작성했습니다.이 단계에서는 다른 CXF 인터셉터가 있습니다. 논리.우리는 동일한 단계에서 여러 개의 CXF 인터셉터를 가질 수 있습니까

제 질문은 같은 단계로 여러 개의 CXF 인터셉터를 만들 수 있습니까? 예 : 아래와 같이 표시된 순서보다 무엇입니까?

예 :

public class Interceptor1 extends AbstractPhaseInterceptor<Message> { 

     public Interceptor1() { 
     super(Phase.UNMARSHAL); 
     } 
     @Override 
     public void handleMessage(Message message) throws Fault { 
      System.out.println("Interceptor1"); 
     } 

} 

public class Interceptor2 extends AbstractPhaseInterceptor<Message> { 

     public Interceptor2() { 
     super(Phase.UNMARSHAL); 
     } 
     @Override 
     public void handleMessage(Message message) throws Fault { 
      System.out.println("Interceptor2"); 
     } 

} 

답변

1

상에있는 하나 이상의 인터셉터는 그들이

추가 된 순서
<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"> 
     <property name="inInterceptors"> 
      <ref bean="MyInterceptor"/> 
      <ref bean="OtherInterceptor"/> 
     </property> 
     <property name="outInterceptors"> 
      <ref bean="MyInterceptor"/> 
     </property> 
    </bean> 

MyInterceptor의 (1)에서 실행될 때 각 단계, 당신이 원하는만큼 인터셉터를 포함 할 수 있습니다 -> OtherInterceptor (2)

관련 문제