/////////////////////////////////////////////////////////////////////////
//
// © Institute for Software Science, University of Vienna, 2004
//
// Copyright in this software belongs to Institute for Software Science, 
// University of Vienna, Nordbergstrasse 15/C/3, 1090 Vienna, Austria
//
// This software may not be used, sold, licensed, transferred, copied
// or reproduced in whole or in part in any manner or form or in or
// on any media by any person other than in accordance with the terms
// of the Licence Agreement supplied with the software, or otherwise
// without the prior written consent of the copyright owners.
//
// This software is distributed WITHOUT ANY WARRANTY, without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE, except where stated in the Licence Agreement supplied with
// the software.
//
//	Created By :		Aleksandar Dimitrov
//	Created Date :		2004/02/24
//	Created for Project:	GEMSS
//
////////////////////////////////////////////////////////////////////////
//
// Dependencies: Derived from auto generated code from Apache Axis WSDL2Java emitter
//
/////////////////////////////////////////////////////////////////////////
//
//	Last commit info:	$Author: dimitrov $
//					$Date: 2004/05/28 10:27:22 $
//					$Revision: 1.5 $
//
/////////////////////////////////////////////////////////////////////////

/**
 * RegistryImplServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package at.ac.univie.iss.registry.generated;

public class RegistryImplServiceLocator extends org.apache.axis.client.Service implements at.ac.univie.iss.registry.generated.RegistryImplService {

    // Use to get a proxy class for reg
    private final java.lang.String reg_address = "http://localhost:9075/registry/reg";

    public java.lang.String getregAddress() {
        return reg_address;
    }

    // The WSDD service name defaults to the port name.
    private java.lang.String regWSDDServiceName = "reg";

    public java.lang.String getregWSDDServiceName() {
        return regWSDDServiceName;
    }

    public void setregWSDDServiceName(java.lang.String name) {
        regWSDDServiceName = name;
    }

    public at.ac.univie.iss.registry.generated.RegistryImpl getreg() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(reg_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getreg(endpoint);
    }

    public at.ac.univie.iss.registry.generated.RegistryImpl getreg(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            at.ac.univie.iss.registry.generated.RegSoapBindingStub _stub = new at.ac.univie.iss.registry.generated.RegSoapBindingStub(portAddress, this);
            _stub.setPortName(getregWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }

    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (at.ac.univie.iss.registry.generated.RegistryImpl.class.isAssignableFrom(serviceEndpointInterface)) {
                at.ac.univie.iss.registry.generated.RegSoapBindingStub _stub = new at.ac.univie.iss.registry.generated.RegSoapBindingStub(new java.net.URL(reg_address), this);
                _stub.setPortName(getregWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }

    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("reg".equals(inputPortName)) {
            return getreg();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }

    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://localhost:9075/registry/reg", "RegistryImplService");
    }

    private java.util.HashSet ports = null;

    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("reg"));
        }
        return ports.iterator();
    }

}
