Handle bind service event.
@param service Service instance
@param props Service reference properties
506165
public void bind(T service, Map<String, Object> props) {
    synchronized (serviceMap) {
      serviceMap.put(ServiceUtil.getComparableForServiceRanking(props), service);
      updateSortedServices();
    }
  }
810006
private function bindApplicationEvent(ServiceDefinition $application, string $event, string $class, string $property, string $argument = null): void
    {
        $argument = $argument ? ', $'.$argument : '';
        $application->addSetup(
            sprintf(
                '?->?[] = function ($application%s = null) use ($dispatcher) { $dispatcher->dispatch(?, new %s($application%s)); }',
                $argument,
                $class,
                $argument
            ),
            [
                '@self',
                $property,
                $event,
            ]
        );
    }
66797
@Deactivate
    protected void deactivate(ComponentContext context, Map<String, Object> props) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "MongoDBService deactivate: jndiName=" + props.get(JNDI_NAME) + ", database=" + props.get(DATABASE_NAME));

        mongo.unregisterChangeListener(this);
        cctx.set(null);
    }
466612
public void setServices(java.util.Collection<String> services) {
        if (services == null) {
            this.services = null;
            return;
        }

        this.services = new java.util.ArrayList<String>(services);
    }
1373494
@Override
    protected K addService(S service, ServiceProperties props) {
        K key = keyFunction.apply(service, props);
        if (key != null) {
            if (serviceMap.putIfAbsent(key, service) != null) {
                getLogger().error("Duplicate key \"{}\" detected for service {}.", key, props.getServiceId());
                return null;
            }
            return key;
        }
        return null;
    }
1014687
protected synchronized void activate(BundleContext context, Map<String, Object> props) {

        String jndiName = (String) props.get("jndiName");
        String originalValue = (String) props.get("value");
        //Since we declare a default value of false in the metatype, if decode isn't specified, props should return false
        boolean decode = (Boolean) props.get("decode");

        if (jndiName == null || jndiName.isEmpty() || originalValue == null || originalValue.isEmpty()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Unable to register JNDIEntry with jndiName " + jndiName + " and value " + originalValue + " because both must be set");
            }
            return;
        }
        String value = originalValue;
        if (decode) {
            try {
                value = PasswordUtil.decode(originalValue);
            } catch (Exception e) {
                Tr.error(tc, "jndi.decode.failed", originalValue, e);
            }
        }
        Object parsedValue = LiteralParser.parse(value);
        String valueClassName = parsedValue.getClass().getName();
        final Object serviceObject = decode ? new Decode(originalValue) : parsedValue;
        Dictionary<String, Object> propertiesForJndiService = new Hashtable<String, Object>();
        propertiesForJndiService.put("osgi.jndi.service.name", jndiName);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Registering JNDIEntry " + valueClassName + " with value " + parsedValue + " and JNDI name " + jndiName);
        }
        this.serviceRegistration = context.registerService(valueClassName, serviceObject, propertiesForJndiService);
    }
565924
@Override
    @Subscribe
    public void handleServiceCreated(ServiceCreatedEvent event) {
        log.debug("Processing Service Created Event {}", event);
        this.fetchModelsForService(event.getService());
    }
1313768
function restoreService(service) {
  if (services[service]) {
    restoreAllMethods(service);
    if (services[service].stub)
      services[service].stub.restore();
    delete services[service];
  } else {
    console.log('Service ' + service + ' was never instantiated yet you try to restore it.');
  }
}
51997
@Inject
    public void setSpaceService(ContextSpaceService service) {
    	if (this.spaceService != null) {
    		this.spaceService.removeSpaceRepositoryListener(this.serviceListener);
    	}
    	this.spaceService = service;
    	if (this.spaceService != null) {
    		this.spaceService.addSpaceRepositoryListener(this.serviceListener);
    	}
    }
525354
public void processConfig(Dictionary<?, ?> props) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Session manager configuration updated");
        }
        this.myConfig.updated(props);

        String value = (String) props.get("purge.interval");
        if (null != value) {
            try {
                // convert the configuration in seconds to runtime milliseconds
                this.purgeInterval = Long.parseLong(value.trim());
            } catch (NumberFormatException nfe) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Ignoring incorrect purge interval [" + value + "]", nfe.getMessage());
                }
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Config: purge interval [" + this.purgeInterval + "]");
        }
    }
551059
private void processConfigProps(Map<String, Object> props) {
        if (props == null || props.isEmpty())
            return;
        id = (String) props.get(CFG_KEY_ID);
        if (id == null) {
            Tr.error(tc, "AUTHZ_ROLE_ID_IS_NULL");
            return;
        }
        rolePids = (String[]) props.get(CFG_KEY_ROLE);
//        if (rolePids == null || rolePids.length < 1)
//            return;
        processRolePids();
    }
628249
@Override
    protected S addService(S service, ServiceProperties props) {
        if (reference.compareAndSet(null, service)) {
            return service;
        }
        return null;
    }
1201319
public void registerComponentBindingsProvider(ServiceReference reference) {
		log.info("registerComponentBindingsProvider");
		log.info("Registering Component Bindings Provider {} - {}",
				new Object[] { reference.getProperty(Constants.SERVICE_ID),
						reference.getProperty(Constants.SERVICE_PID) });
		String[] resourceTypes = OsgiUtil.toStringArray(reference
				.getProperty(ComponentBindingsProvider.RESOURCE_TYPE_PROP),
				new String[0]);
		for (String resourceType : resourceTypes) {
			if (!this.containsKey(resourceType)) {
				put(resourceType, new HashSet<ServiceReference>());
			}
			log.debug("Adding to resource type {}", resourceType);
			get(resourceType).add(reference);
		}
	}
820078
@Override
    public void registerService(Class<?> clazz, Object service) {
        this.services.put(clazz, service);
    }
809822
private <T extends OrchidService> void initializeService(Class<T> serviceClass, T service) {
        services.put(serviceClass, service);
    }
1270808
@Override
	public void injectServices(ServiceRegistryImplementor serviceRegistry) {
		if ( gridDialect instanceof ServiceRegistryAwareService ) {
			( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
		}
	}
1198491
public void addDefaultValues(Service service) {
		for (ServiceOperation op : (List<ServiceOperation>) service.getOperations()) {
			addDefaultValues(op);
		}
	}