GoogleService -------------------------
488803
private function curl( $url, $count = 0, $postString = false ) {

		$ch = curl_init();

		curl_setopt( $ch, CURLOPT_URL, $url );
		curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );

		if( $postString ) {

			curl_setopt( $ch,CURLOPT_POST, $count );
			curl_setopt( $ch,CURLOPT_POSTFIELDS, $postString );
		}

		$data = curl_exec( $ch );

		curl_close( $ch );

		return $data;
	}
920387
@Override
    public void stopService() {
        try {
            if (m_webservice != null) {
                m_webservice.stop();
            }
        } catch (Exception e) {
            m_logger.warn("WebService stop failed", e);
        }
    }
647865
function nextService()
    {

        if ($this->services) {
            $this->_current = array_shift($this->services);
        } else {
            $this->_current = null;
        }

        return $this->_current;
    }
758497
@Override
    public void startService() {
        m_cmdRegistry.freezeCommandSet(true);
        displayCommandSet();
        if (m_webservice != null) {
            try {
                m_webservice.start();
            } catch (Exception e) {
                throw new RuntimeException("Failed to start WebService", e);
            }
        }
    }
1007576
protected void invokeGwtService(
        String serviceName,
        HttpServletRequest req,
        HttpServletResponse res,
        ServletConfig servletConfig) {

        CmsObject cms = null;
        try {
            // instantiate CMS context
            cms = initCmsObject(req, res);
            // instantiate GWT RPC service
            CmsGwtService rpcService = getGwtService(serviceName, servletConfig);
            // check permissions
            rpcService.checkPermissions(cms);
            // set runtime variables
            rpcService.setCms(cms);
            Object lock = req.getSession();
            if (lock == null) {
                lock = new Object();
            }
            rpcService.service(req, res);
            // update the session info
            m_sessionManager.updateSessionInfo(cms, req);
        } catch (CmsRoleViolationException rv) {
            // don't log these into the error channel
            LOG.debug(rv.getLocalizedMessage(), rv);
            // error code not set - set "unauthorized error" (401)
            int status = HttpServletResponse.SC_UNAUTHORIZED;
            res.setStatus(status);
            try {
                res.sendError(status, rv.toString());
            } catch (IOException e) {
                // can be ignored
                LOG.error(e.getLocalizedMessage(), e);
            }
        } catch (Throwable t) {
            // error code not set - set "internal server error" (500)
            LOG.error(t.getLocalizedMessage(), t);
            int status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
            res.setStatus(status);
            try {
                res.sendError(status, t.toString());
            } catch (IOException e) {
                // can be ignored
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
    }
293497
function Searcher(options) {
		this._registry= options.serviceRegistry;
		this._commandService = options.commandService;
		this._fileClient = options.fileService;
		//TODO clean up the search client API. Make any helper private
		this._registry.registerService("orion.core.search.client", this); //$NON-NLS-1$
	}
982447
public SearchResponse search(SearchRequest request) {
    return call(
      new GetRequest(path("search"))
        .setParam("gateId", request.getGateId())
        .setParam("organization", request.getOrganization())
        .setParam("page", request.getPage())
        .setParam("pageSize", request.getPageSize())
        .setParam("query", request.getQuery())
        .setParam("selected", request.getSelected()),
      SearchResponse.parser());
  }
236245
function newService()
    {
        $service = $this->service;

        $argsAvailable = \Poirot\Std\cast($this->optsData())->toArray();

        // TODO Code Clone of \Poirot\Std\Invokable\resolveArgsForReflection()
        $arguments = array();
        foreach ($argsAvailable as $key => $val) {
            if (is_string($key)) {
                // Create Map Of "field_name" to "fieldName" and "FieldName" to Resolve To Callable
                $res = (string) \Poirot\Std\cast($key)->camelCase();
                if (!isset($parameters[$res]))
                    $arguments[strtolower($res)] = $val;

                $arguments[strtolower($key)] = $val;
            }

            $arguments[$key] = $val;
        }

        $argsAvailable = $arguments;

        // Resolve Callable By Given Arguments or From Services Equal To Arg. Name
        if (is_callable($service)) {
            $reflect = \Poirot\Std\Invokable\reflectCallable($service);

            // Resolve Arguments to constructor and create new instance
            $argsAsService = \Poirot\Ioc\resolveServicesAsArgumentForFunc($reflect, $argsAvailable);
            $argsAvailable = array_merge($argsAsService, $argsAvailable);

            // TODO we can resolve argument from services and create a function with behind argument and let it play!
            //      it can be implemented something like dispatcher
            
            if (! empty($argsAvailable) ) {
                $service = \Poirot\Std\Invokable\resolveCallableWithArgs($service, $argsAvailable);
            }
        }
        elseif (is_string($service)) {

            if ( class_exists($service) )
            {
                $rClass        = new \ReflectionClass($service);

                if ($rClass->hasMethod('__construct'))
                {
                    // Resolve Arguments to constructor and create new instance
                    $argsAsService = $this->_resolveServicesAsArgument($rClass, $argsAvailable);

                    $argsAvailable = array_merge($argsAsService, $argsAvailable);

                    $rMethod  = $rClass->getMethod('__construct');
                    $resolved = \Poirot\Std\Invokable\resolveArgsForReflection($rMethod, $argsAvailable);
                    $service  = $rClass->newInstanceArgs($resolved);

                }
                else
                {
                    // service without constructor
                    $service = new $service;

                }

                // let remind options used as features like configurable
                if (isset($resolved)) {
                    foreach ($resolved as $key => $_) {
                        // Remove Resolved From Available Arguments
                        $key = (string) \Poirot\Std\cast($key)->under_score();
                        if (!isset($argsAvailable[$key])) continue;

                        unset($argsAvailable[$key]);
                    }
                }

            }
            elseif ($this->services()->has($service)) {
                $service = $this->services()->fresh($service, $argsAvailable);
                $argsAvailable = null;
            } else {
                throw new exContainerNoService(sprintf(
                    'Service with name (%s) not found.'
                    , $service
                ));
            }
        }


        if ($service instanceof instance)
            $service = \Poirot\Ioc\newInitIns( $service, $this->services() );

        // TODO can be removed
        if ($argsAvailable) {
            if ($service instanceof ipConfigurable)
                ## using Pact Options Provider Contract
                $service->with($argsAvailable, false);
            elseif ($service instanceof iData)
                $service->import($argsAvailable);
        }

        return $service;
    }
1270808
@Override
	public void injectServices(ServiceRegistryImplementor serviceRegistry) {
		if ( gridDialect instanceof ServiceRegistryAwareService ) {
			( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
		}
	}
5606
function onServices() {
  //debug('onServices');
  var numServices = Object.keys(this.services).length;
  if (!this.properties.tethering && numServices > 0) {
    //debug('update servicesCache');
    _servicesCache = this.services;
  }
}
1294988
function() {
        var cache = OpenLayers.Layer.Google.cache[this.map.id];
        if (cache) {
            // remove shared elements from dom
            var container = this.mapObject && this.getMapContainer();                
            if (container && container.parentNode) {
                container.parentNode.removeChild(container);
            }
            var termsOfUse = cache.termsOfUse;
            if (termsOfUse && termsOfUse.parentNode) {
                termsOfUse.parentNode.removeChild(termsOfUse);
            }
            var poweredBy = cache.poweredBy;
            if (poweredBy && poweredBy.parentNode) {
                poweredBy.parentNode.removeChild(poweredBy);
            }
            if (this.mapObject && window.google && google.maps &&
                    google.maps.event && google.maps.event.clearListeners) {
                google.maps.event.clearListeners(this.mapObject, 'tilesloaded');
            }
        }
    }
1165262
@Override
    public ModelService getModelService(String serviceName){
        ModelService service = null;
        if (getCache().isCached(serviceName)) {
            service = getCache().getService(serviceName);
        } else {
            service= this.getDirectoryServiceClient().getService(serviceName, watcher);
            if(service != null){
                getCache().putService(serviceName, service);
            }
        }
        return service;
    }
820078
@Override
    public void registerService(Class<?> clazz, Object service) {
        this.services.put(clazz, service);
    }
212893
protected void onServiceInstanceAvailable(ServiceInstance instance){
        String serviceName = instance.getServiceName();
        synchronized(notificationHandlers){
            if(notificationHandlers.containsKey(serviceName)){
                for(NotificationHandler h : notificationHandlers.get(serviceName)){
                    h.serviceInstanceAvailable(instance);
                }
            }
        }
    }
144536
function(service) {

		// If the service doesn't exist
		service = service || this.settings.default_service;

		if (!service || !(service in this.services)) {
			return null;
		}

		return this.utils.store(service) || null;
	}
1155166
@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// Eliminamos de la URI el contexto
		String url = request.getRequestURI().substring(request.getContextPath().length());
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("url => {}", url);
			LOGGER.debug("HTTP_METHOD => {}", request.getMethod());
			LOGGER.debug("queryString => {}", request.getQueryString());
			LOGGER.debug("Context [{}]", request.getContextPath());
		}

		HttpMethod requestMethod = HttpMethod.valueOf(request.getMethod());
		if (requestMethod == HttpMethod.POST) {
			String httpMethodParam = request.getParameter(HTTP_METHOD_PARAM);
			LOGGER.debug("param: http_method => {}", httpMethodParam);
			if (httpMethodParam != null) {
				requestMethod = HttpMethod.valueOf(httpMethodParam);
			}
		}
		// Getting all the information from the URL
		UrlInfo urlInfo = urlInspector.getUrlInfo(url, requestMethod);
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("URL info {}", urlInfo.toString());
		}
		// Calling the controller's action
		ResponseHelper responseHelper = new ResponseHelper(this.getServletContext(), request, response, urlInfo, config.getString(Config.VIEWS_DIRECTORY));
		helper.invokeAction(urlInfo, responseHelper);
		responseHelper.doResponse();
	}
1103373
public void setOnQueryTextListener(@NonNull final SearchView.OnQueryTextListener listener) {
        if (searchView != null) {
            searchView.setOnQueryTextListener(listener);
        } else if (supportView != null) {
            supportView.setOnQueryTextListener(new android.support.v7.widget.SearchView.OnQueryTextListener() {
                @Override public boolean onQueryTextSubmit(String query) {
                    return listener.onQueryTextSubmit(query);
                }

                @Override public boolean onQueryTextChange(String newText) {
                    return listener.onQueryTextChange(newText);
                }
            });
        } else {
            throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
        }
    }