KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > jaxws > spi > ProviderImpl


1 package org.objectweb.celtix.bus.jaxws.spi;
2
3 import java.net.URL JavaDoc;
4 import java.util.logging.Logger JavaDoc;
5
6 import javax.xml.namespace.QName JavaDoc;
7 import javax.xml.ws.Endpoint;
8 import javax.xml.ws.WebServiceException;
9 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 JavaDoc JAXWS_PROVIDER = ProviderImpl.class.getName();
20     
21     private static final Logger JavaDoc LOG = LogUtils.getL7dLogger(ProviderImpl.class);
22
23     @Override JavaDoc
24     public ServiceDelegate createServiceDelegate(URL JavaDoc url,
25                                                  QName JavaDoc qname,
26                                                  Class JavaDoc cls) {
27         return new ServiceImpl(Bus.getCurrent(), url, qname, cls);
28     }
29
30     @Override JavaDoc
31     public Endpoint createEndpoint(String JavaDoc bindingId, Object JavaDoc implementor) {
32         Endpoint ep = null;
33         if (EndpointUtils.isValidImplementor(implementor)) {
34             ep = new EndpointImpl(Bus.getCurrent(), implementor, bindingId);
35             return ep;
36         } else {
37             throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
38         }
39     }
40
41     @Override JavaDoc
42     public Endpoint createAndPublishEndpoint(String JavaDoc url, Object JavaDoc implementor) {
43         Endpoint ep = createEndpoint(null, implementor);
44         ep.publish(url);
45         return ep;
46     }
47
48 }
49
Popular Tags