Declarative Services method for adding a thread context provider.

@param ref reference to the service
970745
@Reference(name = THREAD_CONTEXT_PROVIDER,
               service = ThreadContextProvider.class,
               cardinality = ReferenceCardinality.MULTIPLE,
               policy = ReferencePolicy.DYNAMIC,
               policyOption = ReferencePolicyOption.GREEDY)
    protected void setThreadContextProvider(ServiceReference<ThreadContextProvider> ref) {
        String threadContextProviderName = (String) ref.getProperty(COMPONENT_NAME);
        threadContextProviders.putReference(threadContextProviderName, ref);
        if (Boolean.TRUE.equals(ref.getProperty(ThreadContextProvider.ALWAYS_CAPTURE_THREAD_CONTEXT)))
            alwaysEnabled.add(threadContextProviderName);
    }
795889
@Reference(service = ApplicationTracker.class)
    protected void setApplicationTracker(ServiceReference<ApplicationTracker> ref) {
        appTrackerRef.setReference(ref);
    }
694345
public void setReference(final Reference reference) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "setReference", reference);
        }

        // Make sure no-one can pull the rug from beneath us.
        synchronized (_properties) {
            _properties = JmsJcaReferenceUtils.getInstance()
                            .getMapFromReference(reference, defaultJNDIProperties);
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "setReference");
        }

    }
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);
		}
	}
1308124
public boolean addReference(ServiceReference<T> reference) {
        if (reference == null)
            return false;

        ConcurrentServiceReferenceElement<T> element = new ConcurrentServiceReferenceElement<T>(referenceName, reference);

        synchronized (elementMap) {
            ConcurrentServiceReferenceElement<T> oldElement = elementMap.put(reference, element);
            if (oldElement != null) {
                if (!element.getRanking().equals(oldElement.getRanking())) {
                    elementSetUnsorted = true;
                }
                return true;
            }

            elementSet.add(element);
        }
        return false;
    }
17953
public void modifiedService(ServiceReference<WebApplicationFactory<?>> reference,
            WebApplicationFactory<?> service) {
        removeApplication(reference);
        PaxWicketApplicationFactory internalFactory =
            PaxWicketApplicationFactory.createPaxWicketApplicationFactory(context, service,
                reference);
        addApplication(reference, internalFactory);
    }
618634
@Override
  public ServiceRefAmp ref()
  {
    if (_isForeign) {
      return null;
    }

    if (workers() > 1) {
      return buildWorkers();
    }
    
    if (_worker != null) {
      return buildWorker();
    }
    else {
      //throw new IllegalStateException(L.l("build() requires a worker or resource."));
      return buildService();
    }
  }
1122129
protected void setResourceConfigFactory(ServiceReference<ResourceConfigFactory> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "setResourceConfigFactory", "setting " + ref);
        }
        resourceConfigFactoryRef.setReference(ref);
    }
856342
@Reference(name = KEY_MESSAGE_STORE, service = MessageStore.class)
    protected void setMessageStore(ServiceReference<MessageStore> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.entry(tc, "setMessageStore", ref);
        messageStoreRef.setReference(ref);

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.exit(tc, "setMessageStore");
    }
338238
public void add(ServiceReference<D> declarationSRef) {
        D declaration = getDeclaration(declarationSRef);
        boolean matchFilter = declarationFilter.matches(declaration.getMetadata());
        declarations.put(declarationSRef, matchFilter);
    }
647474
protected void setDataSourceFactory(ServiceReference<ResourceFactory> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "setDataSourceFactory", "setting " + ref);
        }
        dataSourceFactoryRef.setReference(ref);
    }
1015586
@Reference(name = "rRSXAResourceFactory", service = RRSXAResourceFactory.class, policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL)
    protected void setRRSXAResourceFactory(ServiceReference<RRSXAResourceFactory> ref) {
        rrsXAResFactorySvcRef.setReference(ref);
    }
494678
protected void setRRSXAResourceFactory(ServiceReference<Object> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setRRSXAResourceFactory", ref);
        rrsXAResFactorySvcRef.setReference(ref);
    }
34510
protected void unsetDeferrableScheduledExecutor(ServiceReference<ScheduledExecutorService> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "unsetDeferrableScheduledExecutor", ref);
        deferrableSchedXSvcRef.unsetReference(ref);
    }
6636
@Reference(name = REFERENCE_ADMIN_OBJECT_SERVICES,
               service = AdminObjectService.class,
               policy = ReferencePolicy.DYNAMIC,
               cardinality = ReferenceCardinality.MULTIPLE)
    protected synchronized void addAdminObjectService(ServiceReference<AdminObjectService> reference) {
        String id = (String) reference.getProperty(ADMIN_OBJECT_CFG_ID);
        if (id != null) {
            String jndiName = (String) reference.getProperty(ADMIN_OBJECT_CFG_JNDI_NAME);

            addAdminObjectService(reference, id, false);
            if (jndiName != null && !jndiName.equals(id)) {
                addAdminObjectService(reference, jndiName, true);
            }
        }
    }
1030289
@Reference(service = ChannelFactoryProvider.class,
               cardinality = ReferenceCardinality.MULTIPLE,
               policy = ReferencePolicy.DYNAMIC,
               policyOption = ReferencePolicyOption.GREEDY)
    protected void setFactoryProvider(ChannelFactoryProvider provider) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "Add factory provider; " + provider);
        }

        this.chfw.registerFactories(provider);
    }
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);
    }