public void run() { isStarted = true; final DummyEvent theEvent = new DummyEvent(); try { Thread.sleep(myWaitingTime); } catch (InterruptedException e) { throw new RuntimeException("Sleep of " + AddEventRunnable.class.getName() + " aborted!", e); } if (myDomain != null) { myEventExecutorService.addEvent(myDomain, theEvent); } else { myEventExecutorService.addEventUserSpecific(theEvent); } }
/** * handle * * @param def a {@link org.opennms.netmgt.model.OnmsMonitoringLocationDefinition} object. */ public void handle(final OnmsMonitoringLocationDefinition def) { final GWTLatLng latLng = m_locationDataService.getLatLng(def, false); if (latLng != null) { def.setCoordinates(latLng.getCoordinates()); } final Date now = new Date(); if (now.getTime() - m_date.getTime() >= 500) { m_eventService.addEventUserSpecific(new GeocodingUpdatingRemoteEvent(m_count, m_size)); LogUtils.debugf(this, "initializing locations (" + m_count + "/" + m_size + ")"); m_date = now; } m_count++; }
/** finish */ public void finish() { m_eventService.addEventUserSpecific(new GeocodingFinishedRemoteEvent(m_size)); }
/** {@inheritDoc} */ public void start(final int size) { m_size = size; m_eventService.addEventUserSpecific(new GeocodingUpdatingRemoteEvent(0, size)); }