get a service instance the service must have a interface and implements
it.
976625
public Object getService(TargetMetaDef targetMetaDef, RequestWrapper request) {
		userTargetMetaDefFactory.createTargetMetaRequest(targetMetaDef, request.getContextHolder());
		return webServiceAccessor.getService(request);
	}
259885
private Object getJavaObjectInstance(Context c, Hashtable<?, ?> envmt, String className, String bindingName, ResourceInfo resourceRefInfo, IndirectReference ref) throws Exception {
        // Return null if we don't find a binding so that the caller can
        // use JNDI if enabled.
        Object resource = null;

        NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.match(bindingName);
        if (namespace != null) {
            ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
            if (cmd != null) {
                OSGiInjectionScopeData isd = injectionEngine.getInjectionScopeData(cmd, namespace);
                if (isd != null) {
                    String name = namespace.unprefix(bindingName);

                    InjectionBinding<?> binding = isd.getInjectionBinding(namespace, name);
                    if (binding == null && isd.processDeferredReferenceData()) {
                        // Try again after processing deferred reference data.
                        binding = isd.getInjectionBinding(namespace, name);
                    }

                    if (binding != null) {
                        resource = getBindingObjectInstance(c, envmt, className, resourceRefInfo, ref, binding);
                    }
                }
            }

            if (resource == null && namespace == NamingConstants.JavaColonNamespace.COMP) {
                resource = getDefaultJavaCompObjectInstance(namespace, bindingName, resourceRefInfo);
            }

            // If not found and the customer did not provide a binding, then try and
            // auto-link to a resource that matches on name in the service registry.
            if (resource == null && ref.defaultBinding && !ref.name.startsWith("java:")) {
                resource = createResource(ref.name, className, ref.name, resourceRefInfo);
            }
        }

        return resource;
    }
1212280
def get_instance(self, payload):
        
        return FunctionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
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;
		}
	}
1030774
def instance(cls, *args, **kwargs):
        
        if cls._instance is None:
            cls._instance = cls(*args, **kwargs)
            loaded = cls._instance.reload()
            logging.getLogger('luigi-interface').info('Loaded %r', loaded)

        return cls._instance
109723
private Map<ServiceInstanceToken, InstanceHealthPair> getCacheServiceInstances() {
        if (instanceCache == null) {
            synchronized (this) {
                if (instanceCache == null) {
                    instanceCache = new ConcurrentHashMap<ServiceInstanceToken, InstanceHealthPair>();
                    initJobTasks();
                }
            }
        }
        return instanceCache;
    }
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;
	}
}
448071
protected T service(PathMapping pathMapping, Service<I, O> service) {
        return service(CompositeServiceEntry.of(pathMapping, service));
    }
846808
public static JsonUtil getInstance() {

    if (instance == null) {
      synchronized (JsonUtilImpl.class) {
        if (instance == null) {
          JsonUtilImpl impl = new JsonUtilImpl();
          impl.initialize();
        }
      }
    }
    return instance;
  }
376033
public <T> T getService(String serviceName) {
    T service = findService(serviceName, true);
    if (service == null) {
      throw new IllegalArgumentException(format("No service found named \"%s\"", serviceName));
    }

    return service;
  }
804707
public Service getService(String type, String name) {
        for (int i = 0; i < configs.length; i++) {
            Provider p = getProvider(i);
            Service s = p.getService(type, name);
            if (s != null) {
                return s;
            }
        }
        return null;
    }
1145636
def register_service(cls, service):
        
        logger.debug('Registering service {0}'.format(service.name))
        return local_store.instance.register(service)
1228421
@SuppressWarnings("unchecked")
  public ServiceT getService() {
    if (service == null) {
      service = serviceFactory.create((OptionsT) this);
    }
    return service;
  }
1156963
def _interface_to_service(iface):
    '''
    
    '''
    for _service in _get_services():
        service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, _service))
        if service_info.get_property('Ethernet')['Interface'] == iface:
            return _service
    return None
1240197
public static ProcessUtil getInstance() {

    if (instance == null) {
      synchronized (ProcessUtilImpl.class) {
        if (instance == null) {
          ProcessUtilImpl util = new ProcessUtilImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
162351
def get_service(self, service_type=None):
        """"""
        for service in self._services:
            if service.type == service_type and service_type:
                return service
        return None
556660
public ArrayList<OvhInterface> project_serviceName_instance_instanceId_interface_GET(String serviceName, String instanceId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/interface";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t22);
	}