From c674b38d1c2bf15db1ea029aa707609084cb2fb2 Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Tue, 16 Oct 2018 21:57:36 -0400 Subject: Putting watcher threads in map so they can be accessed later --- src/main/java/soundchan/BotListener/BotListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java index 02c3acd..799b547 100644 --- a/src/main/java/soundchan/BotListener/BotListener.java +++ b/src/main/java/soundchan/BotListener/BotListener.java @@ -36,7 +36,7 @@ public class BotListener extends ListenerAdapter{ private final AudioPlayerManager playerManager; private final Map musicManagers; private BotListenerHelpers helper = new BotListenerHelpers(); - private Future future; + private Map > otherTasks; // From configuration file private static String followingUser; @@ -71,7 +71,7 @@ public class BotListener extends ListenerAdapter{ if(settingEnableCheck(properties.getProperty("watchUserSoundFile"))) { ExecutorService executorService = Executors.newSingleThreadExecutor(); UserSoundWatcher userSoundWatcher = new UserSoundWatcher(localManager, userAudioPath); - future = executorService.submit(userSoundWatcher); + otherTasks.put("watchUserSoundFile", executorService.submit(userSoundWatcher)); executorService.shutdown(); } } @@ -81,7 +81,7 @@ public class BotListener extends ListenerAdapter{ if(settingEnableCheck(properties.getProperty("watchLocalFilePath"))) { ExecutorService executorService = Executors.newSingleThreadExecutor(); DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath); - future = executorService.submit(directoryWatcher); + otherTasks.put("watchLocalFilePath", executorService.submit(directoryWatcher)); executorService.shutdown(); } -- cgit v1.2.3