Unbind reference added automatically from addFactory annotation
979948
public void removeFactory(TaskSystemFactory factory) {
		logger.finer("Removing factory: " + factory);
		// this is to avoid adding items to the cache that were removed while
		// iterating
		synchronized (map) {
			filters.remove(factory);
			map.clear();
		}
	}
940731
public static void forceUnload() {
        if(factoryInstance != null) {
            factoryInstance.unload();
        }

        STACK.get().clear();

        factoryInstance = null;
    }
435446
void unbind(String key)
    {
        NamedEntry entry = new NamedEntry(key, null, false);
        localUnbind(key);
        addForDeletion(entry);
    }
304043
@Override
    protected <T> void unbind(LifecycleManager manager, Class<T> clazz, T object) throws ObjectNotAssociatedException {
        // cancel binding

        Binding binding = STORE.get(clazz);
        if (binding == null) {
            throw new ObjectNotAssociatedException();
        }
        if (!binding.containsKey(object)) {
            throw new ObjectNotAssociatedException();
        }
        binding.remove(object);

        // cancel tracking

        Tracking tracking = TRACK.get(manager);
        tracking.remove(clazz);
    }
82764
private void removeFromServerContextBindingMap(String bindingName,
                                                   boolean explicit)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "removeFromServerContextBindingMap : " + bindingName +
                         ", explicit : " + explicit);

        // Re-wrote method to account for explict and implicit bindings. d457053.1

        BindingData bdata = ivServerContextBindingMap.get(bindingName);

        if (bdata != null)
        {
            if (explicit)
            {
                if (ivHomeRecord.j2eeName.equals(bdata.ivExplicitBean))
                {
                    bdata.ivExplicitBean = null;
                    bdata.ivExplicitInterface = null;
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "removeFromServerContextBindingMap : " +
                                     "ERROR : explicit binding for different bean : " +
                                     bdata.ivExplicitBean);
                }
            }
            else
            {
                if (bdata.ivImplicitBeans != null)
                {
                    bdata.ivImplicitBeans.remove(ivHomeRecord.j2eeName);

                    if (bdata.ivImplicitBeans.size() == 0)
                    {
                        bdata.ivImplicitBeans = null;
                    }
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "removeFromServerContextBindingMap : " +
                                     "ERROR : no implicit binding");
                }
            }

            if (bdata.ivExplicitBean == null &&
                bdata.ivImplicitBeans == null)
            {
                ivServerContextBindingMap.remove(bindingName);
            }
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "removeFromServerContextBindingMap : " +
                             "ERROR : no binding data");
        }
    }
1063603
@Trivial
    public void unsetSslSupport(ServiceReference<ChannelFactoryProvider> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.entry(this, tc, "unsetSslSupport", new Object[] { ref.getProperty("type"), ref });
        }
        // see if its for the same service ref, if yes then destroy
        if (_sslFactoryProvider.getReference() == ref)
        {
            if (_isSSLChain) {
                if (_isChainStarted)
                    performAction(destroyChainAction);
            }

        }
        if (_sslFactoryProvider.unsetReference(ref)) {
            _isSSLEnabled = false;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "unsetSslSupport", _isSSLEnabled);
        }

    }
816476
public void unregisterComponentBindingsProvider(ServiceReference reference) {
		log.info("unregisterComponentBindingsProvider");
		String[] resourceTypes = OsgiUtil.toStringArray(reference
				.getProperty(ComponentBindingsProvider.RESOURCE_TYPE_PROP),
				new String[0]);
		for (String resourceType : resourceTypes) {
			if (!this.containsKey(resourceType)) {
				continue;
			}
			get(resourceType).remove(reference);
		}
	}
442716
public <T> void cleanNullReferences(Class<T> clazz) {
		Map<Object, Reference<Object>> objectMap = getMapForClass(clazz);
		if (objectMap != null) {
			cleanMap(objectMap);
		}
	}
989475
private Reference createDefinitionResourceFactoryReference(ComponentNameSpaceConfiguration compNSConfig,
                                                               InjectionScope scope,
                                                               String refName,
                                                               String type,
                                                               @Sensitive Map<String, Object> properties) throws Exception {

        ResourceFactoryBuilder builder = getResourceFactoryBuilder(type);

        J2EEName j2eeName = compNSConfig.getJ2EEName();

        // d660700 - Based on the scope, determine the metadata for recording the
        // resulting reference, and add additional keys to the properties list.
        String appName, moduleName, compName;
        MetaData metaData;
        if (scope == InjectionScope.GLOBAL) {
            metaData = null;
            appName = moduleName = compName = null;
        } else {
            appName = j2eeName.getApplication();

            if (scope == InjectionScope.APP) {
                metaData = compNSConfig.getApplicationMetaData(); // F743-31682
                moduleName = compName = null;
            } else {
                moduleName = j2eeName.getModule();

                if (scope == InjectionScope.MODULE) {
                    metaData = compNSConfig.getModuleMetaData();
                    compName = null;
                } else {
                    compName = j2eeName.getComponent();

                    metaData = compNSConfig.getComponentMetaData();
                    if (metaData == null) {
                        // All components in a web module share the same namespace.
                        metaData = compNSConfig.getModuleMetaData();
                    }
                }
            }
        }

        if (appName == null) {
            properties.remove("application");
        } else {
            properties.put("application", appName);
        }

        if (moduleName == null) {
            properties.remove("module");
        } else {
            properties.put("module", moduleName);
        }

        if (compName == null) {
            properties.remove("component");
        } else {
            properties.put("component", compName);
        }

        properties.put("declaringApplication", j2eeName.getApplication());
        properties.put("jndiName", InjectionScope.denormalize(refName));

        ResourceFactory resourceFactory = builder.createResourceFactory(properties);
        Reference ref = new ResourceFactoryReference(type, resourceFactory, properties);

        // Save the reference in the relevant scope data so that it can be
        // destroyed when the scope is destroyed.
        getInjectionScopeData(metaData).addDefinitionReference(refName, ref);

        return ref;
    }
1023379
public void unbind() throws Throwable
   {
      if (name == null)
         throw new IllegalArgumentException("Name is null");

      if (trace)
         log.trace("Unbinding " + name);

      Context context = null;
      try
      {
         Properties properties = new Properties();
         properties.setProperty(Context.PROVIDER_URL, jndiProtocol + "://" + jndiHost + ":" + jndiPort);
         context = new InitialContext(properties);


         Util.unbind(context, name);

         objs.remove(name);

         if (log.isDebugEnabled())
            log.debug("Unbound " + name);
      }
      catch (Throwable t)
      {
         log.exceptionDuringUnbind(t);
      }
      finally
      {
         if (context != null)
         {
            try
            {
               context.close();
            }
            catch (NamingException ne)
            {
               // Ignore
            }
         }
      }
   }
15731
public void unbindView() {
        if (mContentView != null) {
            this.mContentView.setAdapter(null);
            this.mContentView.setLayoutManager(null);
            this.mContentView = null;
        }
    }
245411
private void unlinkAllReferences() {
    Collection<Attribute<?>> attributes = elementType.getAllAttributes();
    for (Attribute<?> attribute : attributes) {
      Object identifier = attribute.getValue(this);
      if (identifier != null) {
        ((AttributeImpl<?>) attribute).unlinkReference(this, identifier);
      }
    }
  }
984706
@Unbind(id = "importerServices")
    void unbindImporterService(ServiceReference<ImporterService> serviceReference) {

        LOG.debug(linkerName + " : Unbind the ImporterService " + importersManager.getDeclarationBinder(serviceReference));
        synchronized (lock) {
            importersManager.removeLinks(serviceReference);
            importersManager.remove(serviceReference);
        }
    }
532463
function unbindEvents(target, events, listener) {
    events.split(' ').forEach(function (event) {
        return target.removeEventListener(event, listener, false);
    });
}
266089
protected synchronized void unsetHandler(ServiceReference<Handler> handlerRef) {

        jaxwsInFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxwsOutFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxwsInFlowServerSideGlobalHandlers.removeReference(handlerRef);
        jaxwsOutFlowServerSideGlobalHandlers.removeReference(handlerRef);

        jaxrsInFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxrsOutFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxrsInFlowServerSideGlobalHandlers.removeReference(handlerRef);
        jaxrsOutFlowServerSideGlobalHandlers.removeReference(handlerRef);

        String importPackage = handlerRef.getBundle().getHeaders("").get("Import-package");
        String dynamicImportPackage = handlerRef.getBundle().getHeaders("").get("DynamicImport-Package");

        if ((importPackage != null && importPackage.contains("javax.xml.ws.handler.soap")) ||
            (dynamicImportPackage != null && dynamicImportPackage.contains("javax.xml.ws.handler.soap")))
        {
            saajCount.getAndDecrement();
        }

        clearAllList();

        //jaxws
        Iterator<Handler> registeredHandlers = jaxwsInFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsInFlowServerSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxwsOutFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsOutFlowServerSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxwsInFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsInFlowClientSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxwsOutFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsOutFlowClientSideGlobalHandlers1.add(0, registeredHandlers.next());
        }
        //jaxrs
        registeredHandlers = jaxrsOutFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsOutFlowServerSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxrsInFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsInFlowServerSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxrsOutFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsOutFlowClientSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxrsInFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsInFlowClientSideGlobalHandlers1.add(registeredHandlers.next());
        }

    }
845236
private Reference createDefinitionResourceBindingListenerReference(String refName,
                                                                       String bindingName,
                                                                       String type,
                                                                       @Sensitive Map<String, Object> properties) {
        Boolean transactional = (Boolean) properties.get("transactional");
        Map<String, Object> bindingProperties = Collections.<String, Object> singletonMap("transactional", transactional == null || transactional);

        ResourceBindingImpl binding = resourceBindingListenerManager.binding(refName, bindingName, type, bindingProperties);
        if (binding != null) {
            return new IndirectReference(refName, binding.getBindingName(), type, null, binding.getBindingListenerName(), false);
        }

        return null;
    }
480476
public void modifed(ServiceReference<ResourceFactory> ref) {
        String[] newInterfaces = getServiceInterfaces(ref);
        if (!Arrays.equals(interfaces, newInterfaces)) {
            unregister();
            register(ref, newInterfaces);
        } else {
            registration.setProperties(getServiceProperties(ref));
        }
    }