1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.module.cxf.builder; |
12 | |
|
13 | |
|
14 | |
import javax.xml.namespace.QName; |
15 | |
|
16 | |
import org.apache.cxf.endpoint.Client; |
17 | |
import org.apache.cxf.endpoint.dynamic.DynamicClientFactory; |
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
public class WsdlClientMessageProcessorBuilder extends AbstractOutboundMessageProcessorBuilder |
26 | |
{ |
27 | 0 | private final static Object CLIENT_CREATION_LOCK = new Object(); |
28 | |
|
29 | |
private String service; |
30 | |
private String port; |
31 | |
|
32 | |
public WsdlClientMessageProcessorBuilder() |
33 | |
{ |
34 | 0 | super(); |
35 | 0 | } |
36 | |
|
37 | |
protected Client createClient() throws Exception |
38 | |
{ |
39 | 0 | synchronized (CLIENT_CREATION_LOCK) |
40 | |
{ |
41 | 0 | DynamicClientFactory cf = DynamicClientFactory.newInstance(getBus()); |
42 | 0 | return cf.createClient(getWsdlLocation(), |
43 | |
(service == null ? null : QName.valueOf(service)), |
44 | |
(getPort() == null ? null : QName.valueOf(getPort()))); |
45 | 0 | } |
46 | |
} |
47 | |
|
48 | |
public String getService() |
49 | |
{ |
50 | 0 | return service; |
51 | |
} |
52 | |
|
53 | |
public void setService(String service) |
54 | |
{ |
55 | 0 | this.service = service; |
56 | 0 | } |
57 | |
|
58 | |
public String getPort() |
59 | |
{ |
60 | 0 | return port; |
61 | |
} |
62 | |
|
63 | |
public void setPort(String port) |
64 | |
{ |
65 | 0 | this.port = port; |
66 | 0 | } |
67 | |
|
68 | |
} |