Returns service ID from the &lt;service&gt; element of the appengine-web.xml, or null if it is
missing. Will also look at module ID.
13606
@Nullable
  public String getServiceId() throws AppEngineException {
    String serviceId = getText(getNode(document, "appengine-web-app", "service"));
    if (serviceId != null) {
      return serviceId;
    }
    return getText(getNode(document, "appengine-web-app", "module"));
  }
773506
private Object getServiceHandler(IScope scope, String serviceName) {
        // get application scope handler first
        Object service = scope.getHandler();
        if (serviceName == null || serviceName.equals("")) {
            // no service requested, return application scope handler
            log.trace("No service requested, return application scope handler: {}", service);
            return service;
        }
        // search service resolver that knows about service name
        for (IServiceResolver resolver : serviceResolvers) {
            service = resolver.resolveService(scope, serviceName);
            if (service != null) {
                return service;
            }
        }
        // requested service does not exist
        return null;
    }
797117
public String getServiceClassName()
    {
    	Class<?> serviceClass = getServiceClass();
    	if (serviceClass != null)
    		return serviceClass.getName();
		String serviceClassName = context.getProperty(BundleConstants.SERVICE_CLASS);	// Don't use getProperty - endless loop
		if (serviceClassName == null)
		{
			if (service != null)
				serviceClassName = service.getClass().getName();
			else
				serviceClassName = this.getClass().getName();
		}
		return serviceClassName;
    }
1197425
public Service getServiceObjectFromId(String id) {
        log.fine("Return service object for " + id);
        Service service = null;
        for (Service s : services.getServices()) {
            if (id.equals(s.getId())) {
                return s;
            }
        }
        return service;
    }
571530
public OvhService serviceId_GET(Long serviceId) throws IOException {
		String qPath = "/service/{serviceId}";
		StringBuilder sb = path(qPath, serviceId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhService.class);
	}
416197
private static String findJarServiceProviderName(String factoryId)
    {
        SecuritySupport ss = SecuritySupport.getInstance();
        String serviceId = SERVICES_PATH + factoryId;
        InputStream is = null;

        // First try the Context ClassLoader
        ClassLoader cl = findClassLoader();

        is = ss.getResourceAsStream(cl, serviceId);

        // If no provider found then try the current ClassLoader
        if (is == null) {
            ClassLoader current = ObjectFactory.class.getClassLoader();
            if (cl != current) {
                cl = current;
                is = ss.getResourceAsStream(cl, serviceId);
            }
        }

        if (is == null) {
            // No provider found
            return null;
        }

        debugPrintln("found jar resource=" + serviceId +
               " using ClassLoader: " + cl);

        // Read the service provider name in UTF-8 as specified in
        // the jar spec.  Unfortunately this fails in Microsoft
        // VJ++, which does not implement the UTF-8
        // encoding. Theoretically, we should simply let it fail in
        // that case, since the JVM is obviously broken if it
        // doesn't support such a basic standard.  But since there
        // are still some users attempting to use VJ++ for
        // development, we have dropped in a fallback which makes a
        // second attempt using the platform's default encoding. In
        // VJ++ this is apparently ASCII, which is a subset of
        // UTF-8... and since the strings we'll be reading here are
        // also primarily limited to the 7-bit ASCII range (at
        // least, in English versions), this should work well
        // enough to keep us on the air until we're ready to
        // officially decommit from VJ++. [Edited comment from
        // jkesselm]
        BufferedReader rd;
        try {
            rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        } catch (java.io.UnsupportedEncodingException e) {
            rd = new BufferedReader(new InputStreamReader(is));
        }
        
        String factoryClassName = null;
        try {
            // XXX Does not handle all possible input as specified by the
            // Jar Service Provider specification
            factoryClassName = rd.readLine();
        } catch (IOException x) {
            // No provider found
            return null;
        }
        finally {
            try {
                // try to close the reader.
                rd.close();
            }
            // Ignore the exception.
            catch (IOException exc) {}
        }          

        if (factoryClassName != null &&
            ! "".equals(factoryClassName)) {
            debugPrintln("found in resource, value="
                   + factoryClassName);

            // Note: here we do not want to fall back to the current
            // ClassLoader because we want to avoid the case where the
            // resource file was found using one ClassLoader and the
            // provider class was instantiated using a different one.
            return factoryClassName;
        }

        // No provider found
        return null;
    }
223791
function() {
            var loader = this;
            return {
                //callback is optional, but will guarantee module was initialized
                get: function(name, callback) {
                    if (!_.isString(name)) {
                        debug('To get a registered service, the service name must be provided.');
                        return;
                    }

                    var normalizedName = normalizeServiceName(name);
                    if (!callback) { //sync version
                        if (!_.includes(initMods, normalizedName)) { //hasn't been initialized
                            debug('Using services.get on %s before it has been initialized.', name);
                        }
                        return loader.get(normalizedName);

                    } else { //async version
                        if (_.includes(initMods, normalizedName)) { //already initialized
                            debug('Found already-initialized module %s, invoking callback.', name);
                            return callback(loader.get(normalizedName));
                        } else {
                            debug('Adding callback %s to notify list for service %s', (callback.name || '<anonymous>'),
                                name);
                            notifyList.push({name: normalizedName, callback: callback});
                        }
                    }
                }
            };
        }
701829
private function getServiceId($serviceKey) {
        return ((interface_exists($serviceKey) || class_exists($serviceKey)) && defined($serviceKey . '::SERVICE_ID'))
            ? $serviceKey::SERVICE_ID
            : (string)$serviceKey
        ;
    }
982698
def get(self, id): # pylint: disable=invalid-name,redefined-builtin
        
        schema = PackageSchema()
        resp = self.service.get_id(self.base, id)
        return self.service.decode(schema, resp)
1078411
public String processProjectId(String projectId) {
    if (projectId == null || projectId.trim().isEmpty() || projectId.equals(APPENGINE_CONFIG)) {
      throw new IllegalArgumentException(PROJECT_ERROR);
    } else if (projectId.equals(GCLOUD_CONFIG)) {
      return configReader.getProjectId();
    }
    return projectId;
  }
1272926
public com.google.appengine.v1.Service getServices(int index) {
    return services_.get(index);
  }
1228421
@SuppressWarnings("unchecked")
  public ServiceT getService() {
    if (service == null) {
      service = serviceFactory.create((OptionsT) this);
    }
    return service;
  }
315729
protected String getId(FaceletContext ctx)
    {
        if (this.id != null)
        {
            return this.id.getValue(ctx);
        }
        return ctx.generateUniqueId(this.tagId);
    }
1022327
public String getElementId() {
		for (Entry<String, String> attribute : attributes.entrySet()) {
			if (attribute.getKey().equalsIgnoreCase("id")) {
				return attribute.getValue();
			}
		}
		return null;
	}
96480
private OperationHandler getHandler(String serviceName, String operationName) {
        if (serviceName == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Service Name was null!");
            }

            return null;
        }

        if (operationName == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Operation Name was null!");
            }

            return null;
        }

        Map<String, OperationHandler> handlers =
                m_serviceHandlers.get(serviceName);
        if (handlers == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("No Service Handlers found for: " + serviceName);
            }

            return null;
        }

        OperationHandler handler = handlers.get(operationName);
        if (handler == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("Handler not found for: " + serviceName + "/"
                        + operationName);
            }
        }

        return handler;
    }
1354017
private static String getServiceIdIfNotProvided(ServiceMetadata metadata, String interfaceName) {
        if (INTERFACE_NAME_TO_SERVICE_ID.containsKey(interfaceName)) {
            return INTERFACE_NAME_TO_SERVICE_ID.get(interfaceName);
        }

        String serviceId = metadata.getServiceId();

        if (serviceId != null) {
            return serviceId;
        }

        return Utils.deriveServiceId(interfaceName);
    }
539849
@SuppressWarnings("unchecked")
    @Override
    public <S> S getService(ServiceReference<S> reference) {
        return (S) serviceImplementations.get(reference);
    }