{@inheritDoc}

Adding service.
@see ServiceTracker#addingService(ServiceReference)
542697
@Override
    public final SessionDestroyedListener addingService(ServiceReference<SessionDestroyedListener> serviceReference) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Listener [" + serviceReference + "] has been added.");
        }

        final SessionDestroyedListener listener = context.getService(serviceReference);
        handler.addListener(listener);

        return listener;
    }
498174
@Override
    public void registerService(ServiceInstance<T> service) throws Exception
    {
        Entry<T> newEntry = new Entry<T>(service);
        Entry<T> oldEntry = services.putIfAbsent(service.getId(), newEntry);
        Entry<T> useEntry = (oldEntry != null) ? oldEntry : newEntry;
        synchronized(useEntry)
        {
            if ( useEntry == newEntry ) // i.e. is new
            {
                useEntry.cache = makeNodeCache(service);
            }
            internalRegisterService(service);
        }
    }
1270808
@Override
	public void injectServices(ServiceRegistryImplementor serviceRegistry) {
		if ( gridDialect instanceof ServiceRegistryAwareService ) {
			( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
		}
	}
809822
private <T extends OrchidService> void initializeService(Class<T> serviceClass, T service) {
        services.put(serviceClass, service);
    }
582719
def addService(self, moduleName, serviceName, service):
        
        serviceIdentifier = "{}.{}".format(moduleName, serviceName)
        if serviceIdentifier not in self._services:
            self._services[serviceIdentifier] = service
        else:
            message = "Application - addService() - " \
                      "A service with the identifier {} already exists." \
                      .format(serviceIdentifier)
            raise Exception(message)
1361928
public void add(EndpointService<L, S> newEndpointService) {
        if (newEndpointService == null) {
            throw new IllegalArgumentException("New endpoint service must not be null");
        }

        synchronized (this.inventoryListeners) {
            for (InventoryListener listener : this.inventoryListeners) {
                newEndpointService.addInventoryListener(listener);
            }
        }

        endpointServices.put(newEndpointService.getMonitoredEndpoint().getName(), newEndpointService);
        newEndpointService.start();
        log.infoAddedEndpointService(newEndpointService.toString());

        newEndpointService.discoverAll();
    }
284942
@Override
    public void addResource(String namespace, String service, Object resource) {
        ServiceEndPoint endPoint = toEndPoint(namespace, service, resource);
        _environment.lifecycle().manage(new ManagedRegistration(_serviceRegistry, endPoint));
        _environment.jersey().register(resource);
    }
607522
public boolean putReference(K key, ServiceReference<V> reference) {
        if (key == null || reference == null)
            return false;

        ConcurrentServiceReferenceSet<V> csrs = elementMap.get(key);
        if (csrs == null) {
            // No set for this key: allocate a new set that shares a context reference.
            ConcurrentServiceReferenceSet<V> newSet = new ConcurrentServiceReferenceSet<V>(referenceName, contextRef);

            // Try to add the set to the map: the value returned will be non-null if something else beat us there.
            ConcurrentServiceReferenceSet<V> currentSet = elementMap.putIfAbsent(key, newSet);
            csrs = (currentSet == null) ? newSet : currentSet;
        }

        return csrs.addReference(reference);
    }
78115
@Override
  public <T> ServiceRef.ServiceBuilder service(Class<T> serviceClass)
  {
    Objects.requireNonNull(serviceClass);

    validator().serviceClass(serviceClass);

    Key<?> key = Key.of(serviceClass, ServiceImpl.class);

    ServiceBuilderWebImpl service
      = new ServiceBuilderWebImpl(this, key, serviceClass);

    _includes.add(service);

    return service;
  }
33209
@Reference(service = Application.class,
               cardinality = ReferenceCardinality.MULTIPLE,
               policy = ReferencePolicy.DYNAMIC,
               target = "(application.state=STARTED)")
    protected void addStartedApplication(ServiceReference<Application> ref) {
        ExecutorService executor;
        String appName = (String) ref.getProperty(NAME);
        Set<Runnable> tasks;
        lock.writeLock().lock();
        try {
            executor = this.executor;
            appStates.put(appName, ApplicationState.STARTED);
            tasks = deferredTasks.remove(appName);
        } finally {
            lock.writeLock().unlock();
        }

        if (tasks != null)
            for (Runnable task : tasks)
                executor.submit(task);
    }
681722
public void addDependency(Service service) {
        assertDuringInitialization();
        LOG.info("Adding a dependency on {} to {}", service.getName(), getName());
        addDependsOn(service);
        service.addDependedBy(this);
    }
1108479
@Reference(service=ClassLoadingService.class, name="classLoadingService")
    protected void setClassLoadingService(ServiceReference<ClassLoadingService> ref) {
        classLoadingSRRef.setReference(ref);
    }
81744
@Reference(service = WSContextService.class,
               policy = ReferencePolicy.DYNAMIC,
               policyOption = ReferencePolicyOption.GREEDY,
               target = "(id=unbound)")
    protected void setContextService(ServiceReference<WSContextService> ref) {
        contextSvcRef.setReference(ref);
    }
1149811
@Reference(name = "listener", service = VirtualHostListener.class, policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.MULTIPLE)
    protected void setListener(ServiceReference<VirtualHostListener> reference) {
        _listeners.addReference(reference);
        notifyListener(_listeners.getService(reference));
    }
622930
@Modified(id = "importerServices")
    void modifiedImporterService(ServiceReference<ImporterService> serviceReference) {
        try {
            importersManager.modified(serviceReference);
        } catch (InvalidFilterException invalidFilterException) {
            LOG.error("The ServiceProperty \"" + TARGET_FILTER_PROPERTY + "\" of the ImporterService "
                            + bundleContext.getService(serviceReference) + " doesn't provides a valid Filter."
                            + " To be used, it must provides a correct \"" + TARGET_FILTER_PROPERTY + "\" ServiceProperty.",
                    invalidFilterException
            );
            importersManager.removeLinks(serviceReference);
            return;
        }
        if (importersManager.matched(serviceReference)) {
            importersManager.updateLinks(serviceReference);
        } else {
            importersManager.removeLinks(serviceReference);
        }
    }
415933
public GrpcServerBuilder addService(GrpcService serviceDefinition) {
    ServerServiceDefinition service = serviceDefinition.getServiceDefinition();
    if (SecurityUtils.isAuthenticationEnabled(mConfiguration)
        && serviceDefinition.isAuthenticated()) {
      // Intercept the service with authenticated user injector.
      service = ServerInterceptors.intercept(service,
          new AuthenticatedUserInjector(mAuthenticationServer));
    }
    mNettyServerBuilder = mNettyServerBuilder.addService(service);
    return this;
  }
1029282
@Override
	public void removedService(
			final ServiceReference<HttpService> serviceReference,
			final HttpService service) {
		LOG.debug("HttpService removed {}", serviceReference);
		lock.lock();
		HttpService removedHttpService = null;
		try {
			if (context != null) {
				super.removedService(serviceReference, service);
			}
			if (httpService != service) {
				return;
			}
			removedHttpService = httpService;
			httpService = null;
		} finally {
			lock.unlock();
		}
		listener.unavailable(removedHttpService);
	}