1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.apache.camel.component.cxf; |
18 |
|
|
19 |
|
import java.util.Properties; |
20 |
|
|
21 |
|
import org.apache.camel.Consumer; |
22 |
|
import org.apache.camel.Processor; |
23 |
|
import org.apache.camel.Producer; |
24 |
|
import org.apache.camel.impl.DefaultEndpoint; |
25 |
|
import org.apache.cxf.Bus; |
26 |
|
import org.apache.cxf.message.Message; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
1 |
public class CxfInvokeEndpoint extends DefaultEndpoint<CxfExchange> { |
34 |
|
private CxfBinding binding; |
35 |
|
private final CxfInvokeComponent component; |
36 |
1 |
private boolean inOut = true; |
37 |
|
private Properties properties; |
38 |
|
|
39 |
|
public CxfInvokeEndpoint(String uri, CxfInvokeComponent component, Properties properties) { |
40 |
1 |
super(uri, component); |
41 |
1 |
this.component = component; |
42 |
1 |
this.properties = properties; |
43 |
1 |
} |
44 |
|
|
45 |
|
public Producer<CxfExchange> createProducer() throws Exception { |
46 |
1 |
return new CxfInvokeProducer(this); |
47 |
|
} |
48 |
|
|
49 |
|
public Consumer<CxfExchange> createConsumer(Processor processor) throws Exception { |
50 |
0 |
return new CxfInvokeConsumer(this, processor); |
51 |
|
} |
52 |
|
|
53 |
|
public CxfExchange createExchange() { |
54 |
1 |
return new CxfExchange(getContext(), getBinding()); |
55 |
|
} |
56 |
|
|
57 |
|
public CxfExchange createExchange(Message inMessage) { |
58 |
0 |
return new CxfExchange(getContext(), getBinding(), inMessage); |
59 |
|
} |
60 |
|
|
61 |
|
public CxfBinding getBinding() { |
62 |
2 |
if (binding == null) { |
63 |
1 |
binding = new CxfBinding(); |
64 |
|
} |
65 |
2 |
return binding; |
66 |
|
} |
67 |
|
|
68 |
|
public void setBinding(CxfBinding binding) { |
69 |
0 |
this.binding = binding; |
70 |
0 |
} |
71 |
|
|
72 |
|
public boolean isInOut() { |
73 |
0 |
return inOut; |
74 |
|
} |
75 |
|
|
76 |
|
public void setInOut(boolean inOut) { |
77 |
0 |
this.inOut = inOut; |
78 |
0 |
} |
79 |
|
|
80 |
|
public CxfInvokeComponent getComponent() { |
81 |
0 |
return component; |
82 |
|
} |
83 |
|
|
84 |
|
public String getProperty(String key) { |
85 |
2 |
return properties.getProperty(key); |
86 |
|
} |
87 |
|
|
88 |
|
public Bus getBus() { |
89 |
1 |
return component.getBus(); |
90 |
|
} |
91 |
|
|
92 |
|
public boolean isSingleton() { |
93 |
1 |
return true; |
94 |
|
} |
95 |
|
|
96 |
|
} |