Called during service deactivation.

@param context
188226
protected void deactivate(ComponentContext context) {
        securityServiceRef.deactivate(context);
        unauthSubjectServiceRef.deactivate(context);
        authServiceRef.deactivate(context);
        credServiceRef.deactivate(context);

    }
664481
@Deactivate
    protected void deactivate(ComponentContext cc) {
        globalHandlerServiceSR.deactivate(cc);

        this.cContext = null;

        if (listener != null) {
            LibertyApplicationBusFactory.getInstance().unregisterApplicationBusListener(listener);
        }

    }
1168287
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();

        // Block the progress of deactivate so that session manager is able to access the cache until it finishes stopping applications.
        // The approach of blocking is copied from DatabaseStoreService as a temporary workaround. It would be nice to have a better solution here.
        final long MAX_WAIT = TimeUnit.SECONDS.toNanos(10);
        for (long start = System.nanoTime(); !completedPassivation && System.nanoTime() - start < MAX_WAIT; )
            try {
                TimeUnit.MILLISECONDS.sleep(100); // sleep 1/10th of a second
            } catch (InterruptedException e) {
            }

        if (cachingProvider != null) {
            if (trace && tc.isDebugEnabled())
                CacheHashMap.tcInvoke(tcCachingProvider, "close");

            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
                cachingProvider.close();
                return null;
            });

            if (trace && tc.isDebugEnabled())
                CacheHashMap.tcReturn(tcCachingProvider, "close");

            cachingProvider = null;
            cacheManager = null;
        }
    }
348947
@SuppressWarnings("unchecked")
	public void contextDestroyed(ServletContextEvent sce) {
		WebContext<ServletContext> context = (WebContext<ServletContext>) container.component(container.contexts().get(Application.class));
		context.deassociate(sce.getServletContext());
		
		synchronized (Jaguar.class) {
			if (running()) {
				shutdown();
			}
		}
	}
1363849
public void contextDestroyed(ServletContextEvent event) {
        // Output a simple message to the server's console
        System.out.println("The Simple Web App. Has Been Removed");
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                "/client.xml");
        LocatorService client = (LocatorService) context
                .getBean("locatorService");

        String serviceHost = this.context.getInitParameter("serviceHost");

        try {
            client.unregisterEndpoint(new QName("http://talend.org/esb/examples/", "GreeterService"), serviceHost);
        } catch (InterruptedExceptionFault e) {
            e.printStackTrace();
        } catch (ServiceLocatorFault e) {
            e.printStackTrace();
        }
        this.context = null;
    }
1052966
@Deactivate
    protected void deactivate(int reason) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "File monitor service deactivated", "reason=" + reason, fileMonitors);
        }

        for (Map.Entry<ServiceReference<FileMonitor>, MonitorHolder> entry : fileMonitors.entrySet()) {
            entry.getValue().destroy();
        }
        fileMonitors.clear();
        this.cContext = null;
    }
512556
@Override
	public void stop(BundleContext context) throws Exception {
		final String sourceMethod = "stop"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(Activator.class.getName(), sourceMethod, new Object[]{context});
		}
		super.stop(context);
		// Shutdown the aggregator instances
		ServiceReference<?>[] refs = context.getServiceReferences(IAggregator.class.getName(), null);
		if (refs != null) {
			for (ServiceReference<?> ref : refs) {
				AggregatorImpl aggr = (AggregatorImpl)context.getService(ref);
				if (aggr != null) {
					try {
						aggr.shutdown();
					} catch (Exception e) {
						if (log.isLoggable(Level.SEVERE)) {
							log.log(Level.SEVERE, e.getMessage(), e);
						}
					}
				}
			}
		}

		for (ServiceRegistration<?> reg : serviceRegistrations) {
			reg.unregister();
		}
		if (executors != null) {
			executors.shutdown();
		}
		this.executors = null;
		Activator.context = null;

		if (isTraceLogging) {
			log.exiting(Activator.class.getName(), sourceMethod);
		}
	}
1067391
protected void fireContextDestroyed(AgentContext context) {
		final ContextRepositoryListener[] ilisteners = this.listeners.getListeners(ContextRepositoryListener.class);
		this.logger.getKernelLogger().info(MessageFormat.format(Messages.StandardContextSpaceService_1, context.getID()));
		for (final ContextRepositoryListener listener : ilisteners) {
			listener.contextDestroyed(context);
		}
	}
891667
void onContextStopped(Context context) {
		TinyBus bus = mBuses.get(context);
		if (bus != null) {
			bus.getLifecycleCallbacks().onStop();
		}
		if (DEBUG) Log.d(TAG, " ### STOPPED, bus count: " + mBuses.size());
	}
714132
static void releaseContext(SeaGlassContext context) {
        synchronized (contextMap) {
            List instances = (List) contextMap.get(context.getClass());

            if (instances == null) {
                instances = new ArrayList(5);
                contextMap.put(context.getClass(), instances);
            }

            instances.add(context);
        }
    }
723774
private void releaseContext(String contextId) {
        if (mode == ContextLockingMode.DEACTIVATED) {
            return;
        }
        synchronized (activeWritingContexts) {
            activeWritingContexts.remove(contextId);
        }
    }
786980
protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(this, tc, "activate", context);
        configAdminRef.activate(context);
        variableRegistryRef.activate(context);
        metaTypeServiceRef.activate(context);
        wsConfigurationHelperRef.activate(context);
        bundleContext = priv.getBundleContext(context);

    }
1277744
private synchronized void removeContext(final EvaluatorContext context) {
    this.contextStack.remove(context);
    this.contextIds.remove(context.getId());
  }
1032064
@Override
	public void onStart(TestContext<Object> context) {
		oldErr = System.err;
		oldOut = System.out;
		try {
			System.setErr(remplacementErr);
			System.setOut(remplacementOut);
		} catch (SecurityException e) {
			// ignored
		}
	}
53229
protected void deactivate(ComponentContext cc) {
        // Clean JmxInitializer
        LibertyApplicationBusFactory busFactory = LibertyApplicationBusFactory.getInstance();
        busFactory.unregisterApplicationBusListener(jmxInitializer);

        // Unregister all existing services for Delayed MBean
        // And clean up local variables.
        if (null != serviceTable) {
            Enumeration<String> keys = serviceTable.keys();
            while (keys.hasMoreElements()) {
                String k = keys.nextElement();
                ServiceRegistration<?> r = serviceTable.get(k);
                if (null != r) {
                    r.unregister();
                }
            }
            serviceTable.clear();
        }
    }
974155
protected synchronized void deactivate(ComponentContext context) {
        cfwBundleRef.deactivate(context);
        scheduledExecSvcRef.deactivate(context);
        injectionServiceSRRef.deactivate(context);
        injectionService12SRRef.deactivate(context);
        executorServiceRef.deactivate(context);
        injectionEngineSRRef.deactivate(context);
    }
486042
@Override
  public void onContextClose(final String contextId) {
    this.serviceStub.activeContextOp(
        ActiveContextRequest.newBuilder()
            .setContextId(contextId)
            .setCloseContext(true)
            .build());
  }