/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package javax.xml.ws;

import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.ws.handler.HandlerResolver;
import javax.xml.ws.spi.Provider;
import javax.xml.ws.spi.ServiceDelegate;
import java.net.URL;
import java.util.Iterator;
import java.util.concurrent.Executor;

public class Service {
    public enum Mode {
        MESSAGE, PAYLOAD }

    protected Service(URL wsdlDocumentLocation, QName serviceName) {
        _delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation, serviceName, getClass());
    }

    public <T> T getPort(QName portName, Class<T> serviceEndpointInterface) {
        return (T) _delegate.getPort(portName, serviceEndpointInterface);
    }

    public <T> T getPort(Class<T> serviceEndpointInterface) {
        return (T) _delegate.getPort(serviceEndpointInterface);
    }

    public <T> T getPort(QName portName, Class<T> serviceEndpointInterface, WebServiceFeature... features) {
        return (T) _delegate.getPort(portName, serviceEndpointInterface, features);
    }
    
    public <T> T getPort(Class<T> serviceEndpointInterface, WebServiceFeature... features) {
        return (T) _delegate.getPort(serviceEndpointInterface, features);
    }
    
    public <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features) {
        return (T) _delegate.getPort(endpointReference, serviceEndpointInterface, features);
    }
    
    public void addPort(QName portName, String bindingId, String endpointAddress) {
        _delegate.addPort(portName, bindingId, endpointAddress);
    }

    public <T>Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode) {
        return _delegate.createDispatch(portName, type, mode);
    }

    public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Mode mode) {
        return _delegate.createDispatch(portName, context, mode);
    }

    public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode, WebServiceFeature... features) {
        return _delegate.createDispatch(portName, type, mode, features);
    }
    
    public <T> Dispatch<T> createDispatch(EndpointReference endpointReference, Class<T> type, Service.Mode mode, WebServiceFeature... features) {
        return _delegate.createDispatch(endpointReference, type, mode, features);
    }
    
    public Dispatch<Object> createDispatch(QName portName, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
        return _delegate.createDispatch(portName, context, mode, features);
    }
    
    public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Service.Mode mode, WebServiceFeature... features) {
        return _delegate.createDispatch(endpointReference, context, mode, features);
    }
    
    public QName getServiceName() {
        return _delegate.getServiceName();
    }

    public Iterator<QName> getPorts() {
        return _delegate.getPorts();
    }

    public URL getWSDLDocumentLocation() {
        return _delegate.getWSDLDocumentLocation();
    }

    public HandlerResolver getHandlerResolver() {
        return _delegate.getHandlerResolver();
    }

    public void setHandlerResolver(HandlerResolver handlerResolver) {
        _delegate.setHandlerResolver(handlerResolver);
    }

    public Executor getExecutor() {
        return _delegate.getExecutor();
    }

    public void setExecutor(Executor executor) {
        _delegate.setExecutor(executor);
    }

    public static Service create(URL wsdlDocumentLocation, QName serviceName) {
        return new Service(wsdlDocumentLocation, serviceName);
    }

    public static Service create(QName serviceName) {
        return new Service(null, serviceName);
    }

    private ServiceDelegate _delegate;
}

@@ -1238,33 +1238,32 @@
 Name) %7B%0A        
-_
 delegate = Provi
@@ -1347,16 +1347,16 @@
 ass());%0A
+
     %7D%0A%0A 
@@ -1443,33 +1443,32 @@
      return (T) 
-_
 delegate.getPort
@@ -1585,33 +1585,32 @@
      return (T) 
-_
 delegate.getPort
@@ -1764,33 +1764,32 @@
      return (T) 
-_
 delegate.getPort
@@ -1951,33 +1951,32 @@
      return (T) 
-_
 delegate.getPort
@@ -2173,17 +2173,16 @@
 urn (T) 
-_
 delegate
@@ -2341,33 +2341,32 @@
 ress) %7B%0A        
-_
 delegate.addPort
@@ -2504,33 +2504,32 @@
 %0A        return 
-_
 delegate.createD
@@ -2666,33 +2666,32 @@
 %0A        return 
-_
 delegate.createD
@@ -2863,33 +2863,32 @@
 %0A        return 
-_
 delegate.createD
@@ -3092,33 +3092,32 @@
 %0A        return 
-_
 delegate.createD
@@ -3316,33 +3316,32 @@
 %0A        return 
-_
 delegate.createD
@@ -3555,33 +3555,32 @@
 %0A        return 
-_
 delegate.createD
@@ -3686,33 +3686,32 @@
 %0A        return 
-_
 delegate.getServ
@@ -3775,33 +3775,32 @@
 %0A        return 
-_
 delegate.getPort
@@ -3861,33 +3861,32 @@
 %0A        return 
-_
 delegate.getWSDL
@@ -3969,33 +3969,32 @@
 %0A        return 
-_
 delegate.getHand
@@ -4085,33 +4085,32 @@
 lver) %7B%0A        
-_
 delegate.setHand
@@ -4197,17 +4197,16 @@
  return 
-_
 delegate
@@ -4285,17 +4285,16 @@
         
-_
 delegate
@@ -4578,24 +4578,24 @@
 me);%0A    %7D%0A%0A
+
     private 
@@ -4614,9 +4614,8 @@
 ate 
-_
 dele

update variable name