private void publishEvent(DownloadProgressEvent event) { if (m_agent != null) { IProvisioningEventBus eventBus = (IProvisioningEventBus) m_agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) { eventBus.publishEvent(event); } } }
/** * Adds a {@link SynchronousProvisioningListener} to the event bus for * deleting cache files when the corresponding repository is deleted. */ private void registerRepoEventListener(IProvisioningEventBus eventBus) { if (busListener == null) { busListener = new SynchronousProvisioningListener() { public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (RepositoryEvent.REMOVED == event.getKind() && IRepository.TYPE_METADATA == event.getRepositoryType()) { deleteCache(event.getRepositoryLocation()); } } } }; } // the bus could have disappeared and is now back again - so do this every time eventBus.addListener(busListener); }
/** * Removes the {@link SynchronousProvisioningListener} that cleans up the * cache file from the event bus. */ private void unregisterRepoEventListener(IProvisioningEventBus bus) { if (bus != null && busListener != null) bus.removeListener(busListener); }
eventBus.addListener(listener); } finally { if (eventBus != null) { eventBus.removeListener(listener);
eventBus.addListener(listener); } finally { if (eventBus != null) { eventBus.removeListener(listener);
private void publishDownloadEvent(CollectEvent event) { IProvisioningEventBus bus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (bus != null) bus.publishEvent(event); }
/** * Adds a {@link SynchronousProvisioningListener} to the event bus for * deleting cache files when the corresponding repository is deleted. */ private void registerRepoEventListener(IProvisioningEventBus eventBus) { if (busListener == null) { busListener = new SynchronousProvisioningListener() { public void notify(EventObject o) { if (o instanceof RepositoryEvent) { RepositoryEvent event = (RepositoryEvent) o; if (RepositoryEvent.REMOVED == event.getKind() && IRepository.TYPE_METADATA == event.getRepositoryType()) { deleteCache(event.getRepositoryLocation()); } } } }; } // the bus could have disappeared and is now back again - so do this every time eventBus.addListener(busListener); }
/** * Removes the {@link SynchronousProvisioningListener} that cleans up the * cache file from the event bus. */ private void unregisterRepoEventListener(IProvisioningEventBus bus) { if (bus != null && busListener != null) bus.removeListener(busListener); }
eventBus.addListener(listener); } finally { if (eventBus != null) { eventBus.removeListener(listener);
private void broadcastChangeEvent(String profileId, int reason) { if (eventBus != null) eventBus.publishEvent(new ProfileEvent(profileId, reason)); }
public void start() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus == null) return; eventBus.addListener(this); }
public void stop() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) eventBus.removeListener(this); }
private void publishEvent(DownloadProgressEvent event) { if (m_agent != null) { IProvisioningEventBus eventBus = (IProvisioningEventBus) m_agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) { eventBus.publishEvent(event); } } }
public void start() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus == null) return; eventBus.addListener(this); }
public void stop() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) eventBus.removeListener(this); }
private void publishDownloadEvent(CollectEvent event) { IProvisioningEventBus bus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (bus != null) bus.publishEvent(event); }
public void start() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus == null) return; eventBus.addListener(this); }
public void stop() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) eventBus.removeListener(this); }
private void broadcastChangeEvent(String profileId, int reason) { if (eventBus != null) eventBus.publishEvent(new ProfileEvent(profileId, reason)); }
@Override public void start() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus == null) return; eventBus.addListener(this); }