/*
(non-Javadoc)

@see com.ibm.jbatch.container.config.ServicesManager#getService(com.ibm.jbatch.container.config.ServicesManagerImpl.ServiceType)
491652
private IBatchServiceBase getService(Name serviceType) throws BatchContainerServiceException {
        String sourceMethod = "getService";
        if (logger.isLoggable(Level.FINE))
            logger.entering(sourceClass, sourceMethod + ", serviceType=" + serviceType);

        initIfNecessary();

        IBatchServiceBase service = new ServiceLoader(serviceType).getService();

        if (logger.isLoggable(Level.FINE))
            logger.exiting(sourceClass, sourceMethod);

        return service;
    }
199154
public alluxio.grpc.ServiceType getServiceType() {
    alluxio.grpc.ServiceType result = alluxio.grpc.ServiceType.valueOf(serviceType_);
    return result == null ? alluxio.grpc.ServiceType.UNKNOWN_SERVICE : result;
  }
841509
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.AdParamServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.AdParamServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.AdParamServiceSoapBindingStub(new java.net.URL(AdParamServiceInterfacePort_address), this);
                _stub.setPortName(getAdParamServiceInterfacePortWSDDServiceName());
                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()));
    }
800779
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201902.CmsMetadataServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201902.CmsMetadataServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201902.CmsMetadataServiceSoapBindingStub(new java.net.URL(CmsMetadataServiceInterfacePort_address), this);
                _stub.setPortName(getCmsMetadataServiceInterfacePortWSDDServiceName());
                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()));
    }
578565
@SuppressWarnings("unchecked")
  public <S> S getService(ObjectName name) {
    return (S) servicesByName.get(name);
  }
983727
@SuppressWarnings({ "unchecked" })
private static Object  getBasicServiceObject ( )
//
{
	try
	{
		Class  serviceManagerClass
			= Class.forName ( "javax.jnlp.ServiceManager" );

		Method  lookupMethod = serviceManagerClass.getMethod ( "lookup",
			new Class [ ] { String.class } );

		return lookupMethod.invoke (
			null, new Object [ ] { "javax.jnlp.BasicService" } );
	}
	catch ( Exception  ex )
	{
		return null;
	}
}
266796
@Override
	public ServiceInstance getServiceInstance() {

		try {

			List<ServiceInstance> instances = this.client.getInstances(this.serviceName);
			return instances.isEmpty() ? null : instances.get(0);

		}
		catch (RuntimeException o_O) {
			return null;
		}
	}
961872
@SuppressWarnings("unchecked")
    public static <E> ServiceRegistry<E> getInstance() {
        if (instance == null) {
            synchronized (ServiceRegistry.class) {
                if (instance == null) {
                    instance = new ServiceRegistry<E>();
                }
            }
        }
        return instance;
    }
526066
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.BatchJobServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.BatchJobServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.BatchJobServiceSoapBindingStub(new java.net.URL(BatchJobServiceInterfacePort_address), this);
                _stub.setPortName(getBatchJobServiceInterfacePortWSDDServiceName());
                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()));
    }
307246
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201805.ContentMetadataKeyHierarchyServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201805.ContentMetadataKeyHierarchyServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201805.ContentMetadataKeyHierarchyServiceSoapBindingStub(new java.net.URL(ContentMetadataKeyHierarchyServiceInterfacePort_address), this);
                _stub.setPortName(getContentMetadataKeyHierarchyServiceInterfacePortWSDDServiceName());
                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()));
    }
519004
public static <T> Collection<T> getServices(Class<T> serviceType) {
        return getServiceProvider().getServices(serviceType);
    }
1345754
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.adwords.axis.v201809.cm.BatchJobOpsServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.adwords.axis.v201809.cm.BatchJobOpsServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.cm.BatchJobOpsServiceSoapBindingStub(new java.net.URL(BatchJobOpsServiceInterfacePort_address), this);
                _stub.setPortName(getBatchJobOpsServiceInterfacePortWSDDServiceName());
                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()));
    }
43897
@SuppressWarnings( "unchecked" )
    public <T> T getService( final Class<T> serviceType,
                             final long timeoutInMillis )
    {
        return (T) Proxy.newProxyInstance(
            getClass().getClassLoader(),
            new Class<?>[]{ serviceType },
            new InvocationHandler()
            {
                /**
                 * {@inheritDoc}
                 * Delegates the call to remote bundle context.
                 */
                public Object invoke( final Object proxy,
                                      final Method method,
                                      final Object[] params )
                    throws Throwable
                {
                    try
                    {
                        return getRemoteBundleContext().remoteCall(
                            method.getDeclaringClass(),
                            method.getName(),
                            method.getParameterTypes(),
                            timeoutInMillis,
                            params
                        );
                    }
                    catch( InvocationTargetException e )
                    {
                        throw e.getCause();
                    }
                    catch( RemoteException e )
                    {
                        throw new TestContainerException( "Remote exception", e );
                    }
                    catch( Exception e )
                    {
                        throw new TestContainerException( "Invocation exception", e );
                    }
                }
            }
        );
    }
734196
public <S> S getServiceValue(ServiceType type, String localName) {
    String globalName = composeLocalName(type, localName);
    ObjectName serviceName = getObjectName(globalName);
    return getServiceValue(serviceName);
  }
309043
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201811.PackageServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201811.PackageServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201811.PackageServiceSoapBindingStub(new java.net.URL(PackageServiceInterfacePort_address), this);
                _stub.setPortName(getPackageServiceInterfacePortWSDDServiceName());
                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()));
    }
412918
public GrpcServerBuilder addService(ServiceType serviceType, GrpcService serviceDefinition) {
    mServices.add(serviceType);
    return addService(serviceDefinition);
  }
330381
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201902.InventoryServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201902.InventoryServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201902.InventoryServiceSoapBindingStub(new java.net.URL(InventoryServiceInterfacePort_address), this);
                _stub.setPortName(getInventoryServiceInterfacePortWSDDServiceName());
                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()));
    }