1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.cxf.support; |
8 | |
|
9 | |
import org.mule.api.MuleEvent; |
10 | |
import org.mule.module.cxf.CxfConstants; |
11 | |
|
12 | |
import java.util.Collection; |
13 | |
|
14 | |
import org.apache.cxf.interceptor.Fault; |
15 | |
import org.apache.cxf.message.Attachment; |
16 | |
import org.apache.cxf.message.Message; |
17 | |
import org.apache.cxf.phase.AbstractPhaseInterceptor; |
18 | |
import org.apache.cxf.phase.Phase; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public class CopyAttachmentOutInterceptor extends AbstractPhaseInterceptor |
24 | |
{ |
25 | |
public CopyAttachmentOutInterceptor() |
26 | |
{ |
27 | 0 | super(Phase.SETUP); |
28 | 0 | } |
29 | |
|
30 | |
public void handleMessage(Message message) throws Fault |
31 | |
{ |
32 | 0 | MuleEvent event = (MuleEvent) message.getExchange().get(CxfConstants.MULE_EVENT); |
33 | 0 | Collection<Attachment> a = event.getMessage().getInvocationProperty(CxfConstants.ATTACHMENTS); |
34 | |
|
35 | 0 | if (a != null) |
36 | |
{ |
37 | 0 | message.setAttachments(a); |
38 | |
} |
39 | 0 | } |
40 | |
} |
41 | |
|
42 | |
|