19 package org.sleuthkit.autopsy.guiutils;
21 import com.google.common.util.concurrent.ThreadFactoryBuilder;
22 import java.beans.PropertyChangeEvent;
23 import java.beans.PropertyChangeListener;
24 import java.util.EnumSet;
26 import java.util.concurrent.ScheduledThreadPoolExecutor;
27 import java.util.concurrent.TimeUnit;
28 import java.util.concurrent.atomic.AtomicReference;
60 static ScheduledThreadPoolExecutor refreshExecutor =
new ScheduledThreadPoolExecutor(1,
new ThreadFactoryBuilder().setNameFormat(
"Node Refresh Thread").build());
85 refreshTaskRef.set(null);
93 private final PropertyChangeListener
pcl;
96 this.refreshTaskRef =
new AtomicReference<>(null);
99 pcl = (PropertyChangeEvent evt) -> {
100 String eventType = evt.getPropertyName();
104 if (!refresher.isRefreshRequired(evt)) {
109 if (refreshTaskRef.compareAndSet(null, task)) {
110 refreshExecutor.schedule(task, MIN_SECONDS_BETWEEN_REFRESH, TimeUnit.SECONDS);
void registerForIngestModuleEvents()
void removeIngestModuleEventListener(final PropertyChangeListener listener)
static synchronized IngestManager getInstance()
static final Set< IngestManager.IngestModuleEvent > INGEST_MODULE_EVENTS_OF_INTEREST
void unregisterEventListener()
final PropertyChangeListener pcl
boolean isRefreshRequired(PropertyChangeEvent evt)
static final long MIN_SECONDS_BETWEEN_REFRESH
void addIngestModuleEventListener(final PropertyChangeListener listener)
RefreshThrottler(Refresher r)
final AtomicReference< RefreshTask > refreshTaskRef
final Refresher refresher