private BundleEvent initializeEvent(Bundle bundle) { switch (bundle.getState()) { case Bundle.INSTALLED: return new BundleEvent(BundleEvent.INSTALLED, bundle); case Bundle.RESOLVED: return new BundleEvent(BundleEvent.RESOLVED, bundle); default: return new BundleEvent(BundleEvent.STARTED, bundle); } }
private BundleEvent initializeEvent(Bundle bundle) { switch (bundle.getState()) { case Bundle.INSTALLED: return new BundleEvent(BundleEvent.INSTALLED, bundle); case Bundle.RESOLVED: return new BundleEvent(BundleEvent.RESOLVED, bundle); default: return new BundleEvent(BundleEvent.STARTED, bundle); } }
void setUnResolved() { state = INSTALLED; BundleEvent event = new BundleEvent(BundleEvent.UNRESOLVED, this); osgi.fireBundleEvent(event); }
/** * Fires bundle events. * * @param type The type of bundle event to fire. * @param bundle The bundle associated with the event. **/ void fireBundleEvent(int type, Bundle bundle) { m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle), this); }
/** * Deliver a BundleEvent to SynchronousBundleListeners (synchronous). and * BundleListeners (asynchronous). * * @param type * BundleEvent type. * @param bundle * Affected bundle or null. */ public void publishBundleEvent(int type, Bundle bundle) { publishBundleEvent(new BundleEvent(type, bundle)); }
void setUninstalled() { if (state == UNINSTALLED) { return; } lastModified = System.currentTimeMillis(); state = UNINSTALLED; BundleEvent event = new BundleEvent(BundleEvent.UNINSTALLED, this); osgi.fireBundleEvent(event); }
void setStarting() { if (state != RESOLVED) { return; } state = STARTING; BundleEvent event = new BundleEvent(BundleEvent.STARTING, this); osgi.fireBundleEvent(event); }
void setStopping() { if (state != ACTIVE) { return; } state = STOPPING; BundleEvent event = new BundleEvent(BundleEvent.STOPPING, this); osgi.fireBundleEvent(event); }
/** * Fires bundle events. * * @param type The type of bundle event to fire. * @param bundle The bundle associated with the event. **/ private void fireBundleEvent(int type, Bundle bundle) { m_dispatcher.fireBundleEvent(new BundleEvent(type, bundle)); }
void setInstalled() { if (state == INSTALLED) { return; } lastModified = System.currentTimeMillis(); state = INSTALLED; BundleEvent event = new BundleEvent(BundleEvent.INSTALLED, this); osgi.fireBundleEvent(event); }
void setStopped() { if (state != STOPPING) { return; } state = RESOLVED; BundleEvent event = new BundleEvent(BundleEvent.STOPPED, this); osgi.fireBundleEvent(event); }
void setResolved() { if (state == RESOLVED) { return; } state = RESOLVED; BundleEvent event = new BundleEvent(BundleEvent.RESOLVED, this); osgi.fireBundleEvent(event); }
void setStarted() { if (state != STARTING) { return; } state = ACTIVE; BundleEvent event = new BundleEvent(BundleEvent.STARTED, this); osgi.fireBundleEvent(event); }
/** * Deliver a BundleEvent to SynchronousBundleListeners (synchronous). and * BundleListeners (asynchronous). * * @param type * BundleEvent type. * @param bundle * Affected bundle or null. */ public void publishBundleEvent(int type, Bundle bundle) { publishBundleEvent(new BundleEvent(type, bundle)); }
public synchronized void destroy() throws Exception { for (Bundle bundle : bundles) { bundleChanged(new BundleEvent(BundleEvent.STOPPING, bundle)); } deployedComponentsTracker.close(); deployedAssembliesTracker.close(); bundleContext.removeBundleListener(this); }
public void afterPropertiesSet() throws Exception { bundleContext.addBundleListener(this); for (Bundle bundle : bundleContext.getBundles()) { bundleChanged(new BundleEvent(BundleEvent.INSTALLED, bundle)); } }
public void init() throws Exception { bundleContext.addBundleListener(this); loadProperties(); // Scan bundles for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING || bundle.getState() == Bundle.ACTIVE) bundleChanged(new BundleEvent(BundleEvent.RESOLVED, bundle)); } }
public void init() throws Exception { bundleContext.addBundleListener(this); loadProperties(); // Scan bundles for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING || bundle.getState() == Bundle.ACTIVE) bundleChanged(new BundleEvent(BundleEvent.RESOLVED, bundle)); } }
void startFailed() { // 8: state = STOPPING; fwCtx.listeners.bundleChanged(new BundleEvent(BundleEvent.STOPPING, this)); removeBundleResources(); bundleContext.invalidate(); bundleContext = null; state = RESOLVED; fwCtx.listeners.bundleChanged(new BundleEvent(BundleEvent.STOPPED, this)); }
@Override public void moduleChanged(ModuleEvent event) { int type = event.getType(); Module module = event.getModule(); BundleEvent bundleEvent = new BundleEvent(type, new BundleAdaptor(module)); delegate.bundleChanged(bundleEvent); }