Skip to content

Commit 32a50d7

Browse files
committed
Use TIMER from UpdateThrottle
1 parent 74df9bd commit 32a50d7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

app/alarm/model/src/main/java/org/phoebus/applications/alarm/ResettableTimeout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018-2022 Oak Ridge National Laboratory.
2+
* Copyright (c) 2018 Oak Ridge National Laboratory.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@ public class ResettableTimeout
3131
{
3232
private final long timeout_secs;
3333

34-
public static final ScheduledExecutorService timer = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("ResettableTimeout"));
34+
private final ScheduledExecutorService timer = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("ResettableTimeout"));
3535
private final CountDownLatch no_more_messages = new CountDownLatch(1);
3636
private final Runnable signal_no_more_messages = () -> no_more_messages.countDown();
3737
private final AtomicReference<ScheduledFuture<?>> timeout = new AtomicReference<>();

app/alarm/ui/src/main/java/org/phoebus/applications/alarm/ui/tree/AlarmTreeView.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.stream.Collectors;
2424

2525
import org.phoebus.applications.alarm.AlarmSystem;
26-
import org.phoebus.applications.alarm.ResettableTimeout;
2726
import org.phoebus.applications.alarm.client.AlarmClient;
2827
import org.phoebus.applications.alarm.client.AlarmClientLeaf;
2928
import org.phoebus.applications.alarm.client.AlarmClientListener;
@@ -182,7 +181,7 @@ public AlarmTreeView(final AlarmClient model)
182181
model.addListener(AlarmTreeView.this);
183182
}
184183
else
185-
ResettableTimeout.timer.schedule(this::startup, AlarmSystem.alarm_tree_startup_ms, TimeUnit.MILLISECONDS);
184+
UpdateThrottle.TIMER.schedule(this::startup, AlarmSystem.alarm_tree_startup_ms, TimeUnit.MILLISECONDS);
186185

187186
// Caller will start the model once we return from constructor
188187
}

0 commit comments

Comments
 (0)