Unregisters a service if one was registered

@param context
192708
protected synchronized void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Unregistering JNDIEntry " + serviceRegistration);
        }
        if (this.serviceRegistration != null) {
            this.serviceRegistration.unregister();
        }
    }
739862
ServerSessionContext unregisterSession(long sessionId) {
    ServerSessionContext session = sessions.remove(sessionId);
    if (session != null) {
      clients.remove(session.client(), session);
      connections.remove(session.client(), session.getConnection());
    }
    return session;
  }
1101271
def unregister(self, provider):
        '''
        '''
        if isinstance(provider, type):
            provider = provider()
        if isinstance(provider, DataProvider):
            provider = provider.code
        return self.pop(str(provider).upper(), None)
487390
private void deregisterServices() {
	Iterator<ServiceRegistration<?>> serviceIterator = serviceRegistrations.iterator();
	while (serviceIterator.hasNext()) {
	    ServiceRegistration<?> serviceReference = serviceIterator.next();
	    serviceReference.unregister();
	    serviceIterator.remove();
	}
    }
336330
@Override
    public synchronized void stop(final StopContext context) {
        httpManagementConsumer.accept(null);
        ListenerRegistry lr = listenerRegistrySupplier.get();
        if(lr != null) {
            lr.removeListener(HTTP_MANAGEMENT);
            lr.removeListener(HTTPS_MANAGEMENT);
        }
        if (serverManagement != null) {
            try {
                serverManagement.stop();
            } finally {
                serverManagement = null;

                // Unregister sockets from the SBM
                if (socketBindingManager != null) {
                    ManagedBindingRegistry registry = useUnmanagedBindings ? socketBindingManager.getUnnamedRegistry() : socketBindingManager.getNamedRegistry();
                    if (basicManagedBinding != null) {
                        registry.unregisterBinding(basicManagedBinding);
                        basicManagedBinding = null;
                    }
                    if (secureManagedBinding != null) {
                        registry.unregisterBinding(secureManagedBinding);
                        secureManagedBinding = null;
                    }
                    socketBindingManager = null;
                    useUnmanagedBindings = false;
                }
            }
        }
    }
147506
@Invalidate
    public void stop() {
        for (ServiceRegistration<Template> reg : registrations.values()) {
            try {
                reg.unregister();
            } catch (Exception e) { //NOSONAR
                // Ignore it.
            }
        }
        registrations.clear();
    }
275046
public void unregister(EventObserver<?> observer){
        for (Map.Entry<Class, Set<EventObserver>> entry : observers.entrySet()) {
            entry.getValue().remove(observer);
        }

    }
434545
@Override
    public void unRegisterEvents(String handlerName) {

        if (handlerEventsMap.containsKey(handlerName)) {

            if (handlerEventsMap.size() == 1) {
                auditStopped(null);
            }

            handlerEventsMap.remove(handlerName);
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "handlerEventsMap: " + handlerEventsMap.toString());
        }
    }
1122141
public static void removeRegistrationId(Context context) {
        final SharedPreferences prefs = getGcmPreferences(context);
        prefs.edit()
                .remove(PROPERTY_REG_ID)
                .remove(PROPERTY_APP_VERSION)
                .apply();
    }
1264810
public static void unregisterLogListener(@NonNull final Context context, @NonNull final DfuLogListener listener) {
		if (mLogBroadcastReceiver != null) {
			final boolean empty = mLogBroadcastReceiver.removeLogListener(listener);

			if (empty) {
				LocalBroadcastManager.getInstance(context).unregisterReceiver(mLogBroadcastReceiver);
				mLogBroadcastReceiver = null;
			}
		}
	}
544290
public void deactivate(ComponentContext context) {
        if (contextRef.get() == null) {
            // Components are only deactivated if they activate successfully,
            // and component instances are discarded after being deactivated.
            // This is either DS or programmer error.
            throw new IllegalStateException("not activated");
        }

        this.contextRef.set(null);
    }
1336234
protected void deactivate(ComponentContext context) {
		log.info("deactivate");

		bundleContext = context.getBundleContext();
		bundleContext.removeServiceListener(sl);

		log.info("Deactivate successful");
	}
143741
def unregisterall(self, runnable):
        '''
        
        '''
        if runnable in self.registerIndex:
            for m in self.registerIndex[runnable]:
                self.matchtree.remove(m, runnable)
                if m.indices[0] == PollEvent._classname0 and len(m.indices) >= 2:
                    self.polling.onmatch(m.indices[1], None if len(m.indices) <= 2 else m.indices[2], False)
            del self.registerIndex[runnable]
            self.daemons.discard(runnable)
420901
@Override
    public void clearRegistry() {
        overriddenInstanceStatusMap.clear();
        recentCanceledQueue.clear();
        recentRegisteredQueue.clear();
        recentlyChangedQueue.clear();
        registry.clear();
    }
141071
public void unregister(final Object listener) {
		for (Class clazz = listener.getClass(); clazz != null; clazz = clazz.getSuperclass()) {
			this.handlersByEventType.removeAll(clazz);
		}
	}
476717
protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(tc, "CommsClientServiceFacade deactivated, reason=");

        performAction(destroyChainAction);
        _sslOptions.deactivate(context);
        _sslFactoryProvider.deactivate(context);
        _isActivated = false;
    }
1331542
public void register(Context context) {
        if (mRegisteredContext != null) {
            throw new IllegalStateException("Already registered");
        }

        mRegisteredContext = context;
        context.registerReceiver(this, mPackageFilter);
    }