/** * 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); }
/** * 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); }
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); }
/** * 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); }
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); }
@Override 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); }
private void createProfileListener() { profileListener = new ProvisioningListener() { public void notify(EventObject o) { if (o instanceof IProfileEvent) { IProfileEvent event = (IProfileEvent) o; if (event.getReason() == IProfileEvent.CHANGED && sameProfile(event.getProfileId())) { triggerNewUpdateNotification(); } } } }; getProvisioningEventBus().addListener(profileListener); }
public void shutdown() { statusLineManager = null; if (profileListener != null) { getProvisioningEventBus().removeListener(profileListener); profileListener = null; } }
protected AbstractRepositoryManager(IProvisioningAgent agent) { super(); this.agent = agent; agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); eventBus.addListener(this); }
@Override public void stop() { IProvisioningEventBus eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); if (eventBus != null) eventBus.removeListener(this); }
protected AbstractRepositoryManager(IProvisioningAgent agent) { super(); this.agent = agent; agentLocation = (IAgentLocation) agent.getService(IAgentLocation.SERVICE_NAME); eventBus = (IProvisioningEventBus) agent.getService(IProvisioningEventBus.SERVICE_NAME); eventBus.addListener(this); }