1 package org.objectweb.celtix.bus.jaxws.spi; 2 3 import java.net.URL ; 4 import java.util.logging.Logger ; 5 6 import javax.xml.namespace.QName ; 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 JAXWS_PROVIDER = ProviderImpl.class.getName(); 20 21 private static final Logger LOG = LogUtils.getL7dLogger(ProviderImpl.class); 22 23 @Override 24 public ServiceDelegate createServiceDelegate(URL url, 25 QName qname, 26 Class cls) { 27 return new ServiceImpl(Bus.getCurrent(), url, qname, cls); 28 } 29 30 @Override 31 public Endpoint createEndpoint(String bindingId, Object 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 42 public Endpoint createAndPublishEndpoint(String url, Object implementor) { 43 Endpoint ep = createEndpoint(null, implementor); 44 ep.publish(url); 45 return ep; 46 } 47 48 } 49 | Popular Tags |