001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.jaxws.spi;
019:
020: import java.net.URL;
021: import java.util.logging.Logger;
022:
023: import javax.xml.namespace.QName;
024: import javax.xml.ws.Endpoint; //TODO JAX-WS 2.1
025: //import javax.xml.ws.EndpointReference;
026: import javax.xml.ws.WebServiceException; //TODO JAX-WS 2.1
027: //import javax.xml.ws.WebServiceFeature;
028: import javax.xml.ws.spi.ServiceDelegate; //TODO JAX-WS 2.1
029: //import javax.xml.ws.wsaddressing.W3CEndpointReference;
030:
031: import org.apache.cxf.Bus;
032: import org.apache.cxf.BusFactory;
033: import org.apache.cxf.common.i18n.Message;
034: import org.apache.cxf.common.logging.LogUtils;
035: import org.apache.cxf.jaxws.EndpointImpl;
036: import org.apache.cxf.jaxws.EndpointUtils;
037: import org.apache.cxf.jaxws.ServiceImpl;
038:
039: public class ProviderImpl extends javax.xml.ws.spi.Provider {
040: public static final String JAXWS_PROVIDER = ProviderImpl.class
041: .getName();
042:
043: private static final Logger LOG = LogUtils
044: .getL7dLogger(ProviderImpl.class);
045:
046: @Override
047: public ServiceDelegate createServiceDelegate(URL url, QName qname,
048: Class cls) {
049: Bus bus = BusFactory.getThreadDefaultBus();
050: return new ServiceImpl(bus, url, qname, cls);
051: }
052:
053: @Override
054: public Endpoint createEndpoint(String bindingId, Object implementor) {
055:
056: Endpoint ep = null;
057: if (EndpointUtils.isValidImplementor(implementor)) {
058: Bus bus = BusFactory.getThreadDefaultBus();
059: ep = new EndpointImpl(bus, implementor, bindingId);
060: return ep;
061: } else {
062: throw new WebServiceException(new Message(
063: "INVALID_IMPLEMENTOR_EXC", LOG).toString());
064: }
065: }
066:
067: @Override
068: public Endpoint createAndPublishEndpoint(String url,
069: Object implementor) {
070: Endpoint ep = createEndpoint(null, implementor);
071: ep.publish(url);
072: return ep;
073: }
074:
075: // TODO JAX-WS 2.1
076: /*
077: public W3CEndpointReference createW3CEndpointReference(String address,
078: QName serviceName,
079: QName portName,
080: List<Element> metadata,
081: String wsdlDocumentLocation,
082: List<Element> referenceParameters) {
083: // TODO
084: throw new UnsupportedOperationException();
085: }
086:
087: public <T> T getPort(EndpointReference endpointReference,
088: Class<T> serviceEndpointInterface,
089: WebServiceFeature... features) {
090: // TODO
091: throw new UnsupportedOperationException();
092: }
093:
094: public EndpointReference readEndpointReference(Source eprInfoset) {
095: // TODO
096: throw new UnsupportedOperationException();
097: }
098: */
099:
100: }
|