Register the PauseableComponentController class as a service in the OSGi registry

@param systemBundleCtx
The framework system bundle context
979480
protected void registerPauseableComponentController(BundleContext systemContext) {
        PauseableComponentControllerImpl pauseableComponentController = new PauseableComponentControllerImpl(systemContext);
        if (pauseableComponentController != null) {
            Hashtable<String, String> svcProps = new Hashtable<String, String>();
            systemContext.registerService(PauseableComponentController.class.getName(), pauseableComponentController, svcProps);
        }
    }
667101
protected void activate(ComponentContext context) throws UnableToAdaptException, MalformedURLException {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "activate", context.getProperties());

        id = (String) context.getProperties().get(Constants.ID);
        rarFilePath = (String) context.getProperties().get(Constants.LOCATION);
        bundleContext = Utils.priv.getBundleContext(context);
        bundle = bundleContext.getBundle();

        // This is here so that the RAR class loader is set before providing it
        // to the bundle service for the RAR below.
        getClassLoader();

        // Provide the classloader identity to the bundle service associated
        // with the RAR so it may complete initialization before the RAR is
        // installed.
        raBundleSvc.setClassLoaderID(rarClassLoaderId);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "activate");
    }
106898
public void start(BundleContext bc) throws Exception {
		httpServiceRef = bc.getServiceReference(HttpService.class);
		if (httpServiceRef != null) {
			httpService = (HttpService) bc.getService(httpServiceRef);
			httpService.registerServlet("/status", new StatusServlet(), null,
					null);
			httpService.registerServlet("/status-with-auth",
					new StatusServlet(), null, new AuthHttpContext());
		}
	}
633855
@Override
	public void start(BundleContext context) throws Exception {
		final String sourceMethod = "start"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(Activator.class.getName(), sourceMethod, new Object[]{context});
		}
		super.start(context);

		// Verify the bundle id.
		if (!context.getBundle().getSymbolicName().equals(BUNDLE_NAME)) {
			throw new IllegalStateException();
		}
		serviceRegistrations = new LinkedList<ServiceRegistration<?>>();
		Activator.context = context;
		Dictionary<String, String> dict = new Hashtable<String, String>();
		dict.put("name", BUNDLE_NAME); //$NON-NLS-1$

		ServiceRegistration<?> commandProviderReg = registerCommandProvider();
		if (commandProviderReg != null) {
			serviceRegistrations.add(commandProviderReg);
		}
		// Create the executors provider.  The executors provider is created by the
		// activator primarily to allow executors to be shared by all of the
		// aggregators created by this bundle.
		dict = new Hashtable<String, String>();
		dict.put("name", BUNDLE_NAME); //$NON-NLS-1$
		executors = newExecutors();
		serviceRegistrations.add(
				context.registerService(IExecutors.class.getName(), executors, dict));

		if (isTraceLogging) {
			log.exiting(Activator.class.getName(), sourceMethod);
		}
	}
568717
protected void displaySystem (String bundle, String message, byte attLevel, String localtype)
    {
        // nothing should be untranslated, so pass the default bundle if need be.
        if (bundle == null) {
            bundle = _bundle;
        }
        SystemMessage msg = new SystemMessage(message, bundle, attLevel);
        dispatchMessage(msg, localtype);
    }
561208
protected void activate(ComponentContext cc) {
        Bundle usingBundle = cc.getUsingBundle();
        userContext = usingBundle.getBundleContext();
    }
406272
public void registerLookupBundles(final List<GuiceyBundle> bundles) {
        setScope(ConfigScope.BundleLookup.getType());
        for (GuiceyBundle bundle : bundles) {
            register(ConfigItem.Bundle, bundle);
        }
        closeScope();
        lifecycle().bundlesFromLookupResolved(bundles);
        lifecycle().bundlesResolved(getEnabledBundles(), getDisabledBundles());
    }
518605
protected void activate(ComponentContext cc) {
        // Save bundle context for later usage
        BundleContext context = cc.getBundleContext();
        JMXMBeanServerDelegation.INSTANCE.context = context;

        // Create instance of JmxInitializer, set single instance of this class
        // into JmxInitializer as MBeanServer
        LibertyApplicationBusFactory busFactory = LibertyApplicationBusFactory.getInstance();
        jmxInitializer = new JMXBusInitializer(JMXMBeanServerDelegation.getInstance());
        busFactory.registerApplicationBusListener(jmxInitializer);
    }
158133
@Override
    public boolean isPaused(String targets) throws PauseableComponentControllerRequestFailedException {

        Set<String> foundTargets = new HashSet<String>();

        Set<String> targetList = createTargetList(targets);

        if (targetList.isEmpty()) {
            Tr.warning(tc, "warning.server.status.invalid.targets");
            throw new PauseableComponentControllerRequestFailedException(Tr.formatMessage(tc, "warning.server.status.invalid.targets"));
        }

        //Add each pauseable component to this list. If the tracked values get modified
        //while we are iterating and we start over, skip anyone already in this list
        Set<PauseableComponent> processedList = new HashSet<PauseableComponent>();

        // Sync with other methods changing/querying states for PauseableComponents
        synchronized (this) {
            while (true) {
                try {
                    for (PauseableComponent pauseableComponent : tracker.getTracked().values()) {

                        if (processedList.add(pauseableComponent)) {

                            if (targetList.contains(pauseableComponent.getName())) {
                                foundTargets.add(pauseableComponent.getName());

                                if (!pauseableComponent.isPaused()) {
                                    return false;
                                }
                            }
                        }
                    }

                    break;
                } catch (Throwable t) {
                    // Someone modified our list of services. Retry.
                }
            }
        }

        //Check which (if any) targets were not found
        targetList.removeAll(foundTargets);
        if (!targetList.isEmpty()) {
            // We could not find targets specified. Return false: not everyone was paused
            Tr.warning(tc, "warning.server.status.missing.targets", Arrays.toString(targetList.toArray()));
            throw new PauseableComponentControllerRequestFailedException(Tr.formatMessage(tc, "warning.server.status.missing.targets", Arrays.toString(targetList.toArray())));

        } else {
            return true;
        }

    }
175696
protected void registerInstrumentationService(BundleContext systemContext) {
        Instrumentation inst = config.getInstrumentation();
        if (inst != null) {
            // Register a wrapper so we can trace callers.
            inst = (Instrumentation) Proxy.newProxyInstance(TraceInstrumentation.class.getClassLoader(),
                                                            new Class[] { Instrumentation.class },
                                                            new TraceInstrumentation(inst));
            Hashtable<String, String> svcProps = new Hashtable<String, String>();
            systemContext.registerService(Instrumentation.class.getName(), inst, svcProps);
        }
    }
1007663
public void stop(BundleContext context) throws Exception {
        this.log(context, LogService.LOG_INFO, "Stopping the " + this.getClass().getName() + " ClassService bundle");
        // I'm unregistered automatically

        bundleContext = null;
    }
14556
@FFDCIgnore(Exception.class)
    public void deactivate(ComponentContext componentContext) {
        String methodName = "deactivate";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Deactivating the WebContainer bundle");
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posting STOPPED_EVENT");
        }
        Event event = this.eventService.createEvent(WebContainerConstants.STOPPED_EVENT);
        this.eventService.postEvent(event);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Posted STOPPED_EVENT");
        }

        this.classLoadingSRRef.deactivate(componentContext);
        this.sessionHelperSRRef.deactivate(componentContext);
        this.cacheManagerSRRef.deactivate(componentContext);
        this.injectionEngineSRRef.deactivate(componentContext);
        this.managedObjectServiceSRRef.deactivate(context);
        this.servletContainerInitializers.deactivate(componentContext);
        this.transferContextServiceRef.deactivate(componentContext);
        this.webMBeanRuntimeServiceRef.deactivate(componentContext);

        // will now purge each host as it becomes redundant rather than all here.
        //this.vhostManager.purge(); // Clear/purge all maps.

        WebContainer.instance.compareAndSet(this, null);
        extensionFactories.clear();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, "Deactivating the WebContainer bundle: Complete");
        }                
    }
794362
protected void activate(final ComponentContext context)
			throws InvalidSyntaxException {
		log.info("activate");

		bundleContext = context.getBundleContext();

		sl = new ServiceListener() {
			public void serviceChanged(ServiceEvent event) {
				if (event.getType() == ServiceEvent.UNREGISTERING) {
					cache.unregisterComponentBindingsProvider(event
							.getServiceReference());
				} else if (event.getType() == ServiceEvent.REGISTERED) {
					cache.registerComponentBindingsProvider(event
							.getServiceReference());
				}
			}
		};
		bundleContext.addServiceListener(sl, "(" + Constants.OBJECTCLASS + "="
				+ ComponentBindingsProvider.class.getName() + ")");
		reloadCache();
		log.info("Activation successful");
	}
288772
@Activate
    protected void activate(ComponentContext cContext, Map<String, Object> properties) throws Exception {
        this.cContext = cContext;
        globalHandlerServiceSR.activate(cContext);
        listener = new JaxRSGlobalHandlerBusListener();
        LibertyApplicationBusFactory.getInstance().registerApplicationBusListener(listener);
    }
178925
protected void getServices(BundleContext bundleCtx) {
        context = bundleCtx;

        // OSGi 4.3 uses the bundle.adapt() mechanism as a way to get to
        // behavior that is fundamentally a part of the framework
        frameworkStartLevel = bundleCtx.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkStartLevel.class);
        frameworkStartLevel.setInitialBundleStartLevel(KernelStartLevel.ACTIVE.getLevel());

        serviceTracker = new ServiceTracker<LibertyBootRuntime, LibertyBootRuntime>(context, LibertyBootRuntime.class, null);
        serviceTracker.open();
    }
266791
public void onCreate(Bundle bundle) {
		if (mParentDelegate == null && bundle != null) {
			bundle = bundle.getBundle(MOXY_DELEGATE_TAGS_KEY);
		}

		mIsAttached = false;
		mBundle = bundle != null ? bundle : new Bundle();

		//get base tag for presenters
		if (bundle == null || !mBundle.containsKey(mKeyTag)) {
			mDelegateTag = generateTag();
		} else {
			mDelegateTag = bundle.getString(mKeyTag);
		}

		//bind presenters to view
		mPresenters = MvpFacade.getInstance().getMvpProcessor().getMvpPresenters(mDelegated, mDelegateTag);

		for (MvpDelegate childDelegate : mChildDelegates) {
			childDelegate.onCreate(bundle);
		}
	}
1336234
protected void deactivate(ComponentContext context) {
		log.info("deactivate");

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

		log.info("Deactivate successful");
	}