diff options
Diffstat (limited to 'src/main/java/org/traccar/broadcast')
3 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/broadcast/BroadcastService.java b/src/main/java/org/traccar/broadcast/BroadcastService.java index 8a2e4bafc..a86c43b5b 100644 --- a/src/main/java/org/traccar/broadcast/BroadcastService.java +++ b/src/main/java/org/traccar/broadcast/BroadcastService.java @@ -18,5 +18,6 @@ package org.traccar.broadcast; import org.traccar.LifecycleObject; public interface BroadcastService extends LifecycleObject, BroadcastInterface { + boolean singleInstance(); void registerListener(BroadcastInterface listener); } diff --git a/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java b/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java index 3eafe07d3..be65b7826 100644 --- a/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java +++ b/src/main/java/org/traccar/broadcast/MulticastBroadcastService.java @@ -71,6 +71,11 @@ public class MulticastBroadcastService implements BroadcastService { } @Override + public boolean singleInstance() { + return false; + } + + @Override public void registerListener(BroadcastInterface listener) { listeners.add(listener); } diff --git a/src/main/java/org/traccar/broadcast/NullBroadcastService.java b/src/main/java/org/traccar/broadcast/NullBroadcastService.java index 3f41299db..f95037990 100644 --- a/src/main/java/org/traccar/broadcast/NullBroadcastService.java +++ b/src/main/java/org/traccar/broadcast/NullBroadcastService.java @@ -18,6 +18,11 @@ package org.traccar.broadcast; public class NullBroadcastService implements BroadcastService { @Override + public boolean singleInstance() { + return true; + } + + @Override public void registerListener(BroadcastInterface listener) { } |