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