// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// null

package com.agiledeveloper.ws;

import com.sun.xml.rpc.encoding.*;
import com.sun.xml.rpc.client.ServiceExceptionImpl;
import com.sun.xml.rpc.util.exception.*;
import com.sun.xml.rpc.soap.SOAPVersion;
import com.sun.xml.rpc.client.HandlerChainImpl;
import javax.xml.rpc.*;
import javax.xml.rpc.encoding.*;
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.namespace.QName;

public class Lifetime_Impl extends com.sun.xml.rpc.client.BasicService implements Lifetime {
    private static final QName serviceName = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "Lifetime");
    private static final QName ns1_LifetimeIFPort_QNAME = new QName("http://www.agiledeveloper.com/wsdl/Lifetime", "LifetimeIFPort");
    private static final Class lifetimeIF_PortClass = com.agiledeveloper.ws.LifetimeIF.class;
    
    public Lifetime_Impl() {
        super(serviceName, new QName[] {
                        ns1_LifetimeIFPort_QNAME
                    },
            new com.agiledeveloper.ws.Lifetime_SerializerRegistry().getRegistry());
        
    }
    
    public java.rmi.Remote getPort(QName portName, Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (portName.equals(ns1_LifetimeIFPort_QNAME) &&
                serviceDefInterface.equals(lifetimeIF_PortClass)) {
                return getLifetimeIFPort();
            }
        } catch (Exception e) {
            throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
        }
        return super.getPort(portName, serviceDefInterface);
    }
    
    public java.rmi.Remote getPort(Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (serviceDefInterface.equals(lifetimeIF_PortClass)) {
                return getLifetimeIFPort();
            }
        } catch (Exception e) {
            throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
        }
        return super.getPort(serviceDefInterface);
    }
    
    public com.agiledeveloper.ws.LifetimeIF getLifetimeIFPort() {
        String[] roles = new String[] {};
        HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_LifetimeIFPort_QNAME));
        handlerChain.setRoles(roles);
        com.agiledeveloper.ws.LifetimeIF_Stub stub = new com.agiledeveloper.ws.LifetimeIF_Stub(handlerChain);
        try {
            stub._initialize(super.internalTypeRegistry);
        } catch (JAXRPCException e) {
            throw e;
        } catch (Exception e) {
            throw new JAXRPCException(e.getMessage(), e);
        }
        return stub;
    }
}
