01: package org.objectweb.celtix.bus.bindings.xml;
02:
03: import java.io.IOException;
04: import javax.wsdl.BindingInput;
05: import javax.wsdl.BindingOutput;
06: import javax.wsdl.WSDLException;
07: import javax.xml.bind.JAXBException;
08:
09: import org.objectweb.celtix.Bus;
10: import org.objectweb.celtix.bindings.BindingFactory;
11: import org.objectweb.celtix.bindings.ClientBinding;
12: import org.objectweb.celtix.bindings.ServerBinding;
13: import org.objectweb.celtix.bindings.ServerBindingEndpointCallback;
14: import org.objectweb.celtix.bindings.xmlformat.TBody;
15: import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
16: import org.objectweb.celtix.wsdl.JAXBExtensionHelper;
17:
18: public class XMLBindingFactory implements BindingFactory {
19:
20: private Bus bus;
21:
22: public XMLBindingFactory() {
23: //Complete
24: }
25:
26: public void init(Bus b) {
27: bus = b;
28: try {
29: JAXBExtensionHelper.addExtensions(bus.getWSDLManager()
30: .getExtenstionRegistry(), BindingInput.class,
31: TBody.class);
32: JAXBExtensionHelper.addExtensions(bus.getWSDLManager()
33: .getExtenstionRegistry(), BindingOutput.class,
34: TBody.class);
35: } catch (JAXBException e) {
36: //ignore, we can continue without the extension registered
37: }
38: }
39:
40: public ClientBinding createClientBinding(
41: EndpointReferenceType reference) throws WSDLException,
42: IOException {
43: return new XMLClientBinding(bus, reference);
44: }
45:
46: public ServerBinding createServerBinding(
47: EndpointReferenceType reference,
48: ServerBindingEndpointCallback cbFactory)
49: throws WSDLException, IOException {
50: return new XMLServerBinding(bus, reference, cbFactory);
51: }
52: }
|