Declarative Services method to deactivate this component.
Best practice: this should be a protected method, not public or private

@param context context for this component instance.
@throws InstanceNotFoundException
@throws MBeanRegistrationException
356187
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "deactivate", name);

        lock.writeLock().lock();
        try {
            if (pmMBean != null) {
                pmMBean.unregister();
                pmMBean = null;
            }
            pm = null;
            properties = null;
        } finally {
            lock.writeLock().unlock();
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "deactivate");
    }
113166
protected void deactivate(ComponentContext context) throws Exception {

        contextProviders.deactivate(context);
        bvalRef.deactivate(context);
        tranInflowManagerRef.deactivate(context);
        tranSyncRegistryRef.deactivate(context);
        jcaSecurityContextRef.deactivate(context);

        latch.countDown();
        latches.remove(resourceAdapterID, latch);

        FutureMonitor futureMonitor = futureMonitorSvc;
        Future<Boolean> future = appsStoppedFuture.getAndSet(null);
        if (futureMonitor != null && future != null) {
            futureMonitor.onCompletion(future, new CompletionListener<Boolean>() {
                @Override
                public void successfulCompletion(Future<Boolean> future, Boolean result) {
                    stopResourceAdapter();
                }

                @Override
                public void failedCompletion(Future<Boolean> future, Throwable t) {
                    stopResourceAdapter();
                }
            });
        } else {
            stopResourceAdapter();
        }
    }
1253695
protected void deactivate(ComponentContext ctxt, int reason) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Deactivating, reason=" + reason);
        }
        unregisterAll();
    }
519607
protected void deactivate(ComponentContext context) {
        destinationRef.deactivate(context);
        bootstrapContextRef.deactivate(context);
        rrsXAResFactorySvcRef.deactivate(context);
    }
3724
@Deactivate
    protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Deactivating");
        }
        instance.get().compareAndSet(this, null);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Destroying all endpoints");
        }
        EndPointMgrImpl.destroyEndpoints();

        try {
            this.chfw.destroy();
        } catch (Throwable t) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "Error destroying framework: " + t);
            }
        }

        this.chfw.deregisterFactory("TCPChannel");
        this.chfw.deregisterFactory("UDPChannel");
    }
1370908
private BeanDefinitionRegistry getBeanDefinitionRegistry(ApplicationContext context) {
		if (context instanceof BeanDefinitionRegistry) {
			return (BeanDefinitionRegistry) context;
		}
		if (context instanceof AbstractApplicationContext) {
			return (BeanDefinitionRegistry) ((AbstractApplicationContext) context)
					.getBeanFactory();
		}
		throw new IllegalStateException("Could not locate BeanDefinitionRegistry");
	}
188934
protected synchronized void activate(ComponentContext context) {
        cfwBundleRef.activate(context);
        scheduledExecSvcRef.activate(context);
        injectionServiceSRRef.activate(context);
        injectionService12SRRef.activate(context);
        executorServiceRef.activate(context);
        injectionEngineSRRef.activate(context);
    }
1113676
protected void activate(ComponentContext context) {
        securityServiceRef.activate(context);
        unauthSubjectServiceRef.activate(context);
        authServiceRef.activate(context);
        credServiceRef.activate(context);
    }
1240154
public static void shutdown(final LoggerContext context) {
        if (context != null && context instanceof Terminable) {
            ((Terminable) context).terminate();
        }
    }
131017
@Override
	public synchronized void removeContext(Context context) {

        if( log.isDebugEnabled() )
            log.debug("Removing context[" + context.getPath() + "]");

        boolean isContextExists = isContextExists(context);
        if(!isContextExists)
        	return;
        
        // Remove this Context from the associated Host
        if( log.isDebugEnabled() )
            log.debug(" Removing this Context");
        context.getParent().removeChild(context);

    }
1040694
protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "deactivate", "deactivating service references");
        }
        embeddableWebSphereTransactionManagerRef.deactivate(context);
        localTransactionCurrentRef.deactivate(context);
        resourceConfigFactoryRef.deactivate(context);
        dataSourceFactoryRef.deactivate(context);
        uowCurrentRef.deactivate(context);
        userTransactionRef.deactivate(context);
        if (isCompletedPassivation()) { //START 128284
            serializationServiceRef.deactivate(context);
        } else {

            while (!isCompletedPassivation()){
                try {
                    Thread.sleep(100L); // sleep 1/10th of a second
                } catch (InterruptedException e) {
                    FFDCFilter.processException(e, this.getClass().getName(), "180");
                } finally {
                    serializationServiceRef.deactivate(context);
                }
            }
        } // END 128284

    }
1359002
@SuppressWarnings("unchecked")
    public void injectNonContextualInstance(final Object instance) {
        if (instance != null) {
            CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
            InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>) manager
                    .createInjectionTarget(getAnnotatedType(instance));
            injectionTarget.inject(instance, creationalContext);
        }
    }
725529
@Deactivate
    protected void deactivate(ComponentContext context) {
        lock.writeLock().lock();
        try {
            componentContext = null;
            properties = null;
            threadContextConfigurations = null;
        } finally {
            lock.writeLock().unlock();
        }
    }
950934
protected void deactivate(ComponentContext compcontext) {
        if (TC.isDebugEnabled()) {
            Tr.debug(TC, "Deactivating " + this.getClass().getName());
        }
        this.userTransaction.deactivate(compcontext);
        this.transactionManager.deactivate(compcontext);
    }
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();
        }
    }
1370028
public void activate(Map<String, Object> properties, ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "activate");
        chfwRef.activate(context);
        _commonServiceFacadeRef.activate(context);
        alarmManagerRef.activate(context);
        exeServiceRef.activate(context);

        getChannelFramewrok().registerFactory("JFapChannelOutbound", JFapChannelFactory.class);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "activate");
    }
493957
@Override
    protected void deregister(ServiceInstance instance) {

        if (instance.getInstanceId().isPresent()) {
            DeregisterInstanceRequest deregisterInstanceRequest = new DeregisterInstanceRequest().withServiceId(route53AutoRegistrationConfiguration.getAwsServiceId())
                    .withInstanceId(instance.getInstanceId().get());
            getDiscoveryClient().deregisterInstance(deregisterInstanceRequest);
        }
    }