01: package org.objectweb.celtix.bus.jaxws.spi;
02:
03: import java.net.URL;
04: import java.util.logging.Logger;
05:
06: import javax.xml.namespace.QName;
07: import javax.xml.ws.Endpoint;
08: import javax.xml.ws.WebServiceException;
09: import javax.xml.ws.spi.ServiceDelegate;
10:
11: import org.objectweb.celtix.Bus;
12: import org.objectweb.celtix.bus.jaxws.EndpointImpl;
13: import org.objectweb.celtix.bus.jaxws.EndpointUtils;
14: import org.objectweb.celtix.bus.jaxws.ServiceImpl;
15: import org.objectweb.celtix.common.i18n.Message;
16: import org.objectweb.celtix.common.logging.LogUtils;
17:
18: public class ProviderImpl extends javax.xml.ws.spi.Provider {
19: public static final String JAXWS_PROVIDER = ProviderImpl.class
20: .getName();
21:
22: private static final Logger LOG = LogUtils
23: .getL7dLogger(ProviderImpl.class);
24:
25: @Override
26: public ServiceDelegate createServiceDelegate(URL url, QName qname,
27: Class cls) {
28: return new ServiceImpl(Bus.getCurrent(), url, qname, cls);
29: }
30:
31: @Override
32: public Endpoint createEndpoint(String bindingId, Object implementor) {
33: Endpoint ep = null;
34: if (EndpointUtils.isValidImplementor(implementor)) {
35: ep = new EndpointImpl(Bus.getCurrent(), implementor,
36: bindingId);
37: return ep;
38: } else {
39: throw new WebServiceException(new Message(
40: "INVALID_IMPLEMENTOR_EXC", LOG).toString());
41: }
42: }
43:
44: @Override
45: public Endpoint createAndPublishEndpoint(String url,
46: Object implementor) {
47: Endpoint ep = createEndpoint(null, implementor);
48: ep.publish(url);
49: return ep;
50: }
51:
52: }
|