/** * Called by OSGi framework when starting this bundle. It will start a bare dependency manager for tracking several * of the (configurable) services. Once all dependencies are satisfied, {@link #componentStarted(BundleContext)} * will be called. */ @Override public void start(BundleContext bundleContext) throws Exception { // Essentially a two-threaded executor with scheduling support, one thread is "reserved" for the controller... m_executorService = new ScheduledThreadPoolExecutor(2 /* core pool size */, new InternalThreadFactory()); m_dependencyTracker = new DependencyTrackerImpl(bundleContext, this); addPackageAdminDependency(m_dependencyTracker); if (getBoolean(bundleContext, AgentConstants.CONFIG_IDENTIFICATION_DISABLED)) { addIdentificationHandlerDependency(m_dependencyTracker); } if (getBoolean(bundleContext, AgentConstants.CONFIG_DISCOVERY_DISABLED)) { addDiscoveryHandlerDependency(m_dependencyTracker); } if (getBoolean(bundleContext, AgentConstants.CONFIG_CONNECTION_DISABLED)) { addConnectionHandlerDependency(m_dependencyTracker); } // Create the controller in this method will ensure that if this fails, this bundle is *not* started... m_controller = createAgentController(bundleContext); m_dependencyTracker.startTracking(); }