mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-29 12:37:40 +01:00
Moved task system
This commit is contained in:
parent
0e80545e91
commit
8f6b196b60
@ -47,7 +47,7 @@ import com.djrapitops.plan.systems.info.BukkitInformationManager;
|
|||||||
import com.djrapitops.plan.systems.info.ImporterManager;
|
import com.djrapitops.plan.systems.info.ImporterManager;
|
||||||
import com.djrapitops.plan.systems.info.InformationManager;
|
import com.djrapitops.plan.systems.info.InformationManager;
|
||||||
import com.djrapitops.plan.systems.info.server.BukkitServerInfoManager;
|
import com.djrapitops.plan.systems.info.server.BukkitServerInfoManager;
|
||||||
import com.djrapitops.plan.systems.tasks.TaskSystem;
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plan.utilities.file.export.HtmlExport;
|
import com.djrapitops.plan.utilities.file.export.HtmlExport;
|
||||||
import com.djrapitops.plan.utilities.metrics.BStats;
|
import com.djrapitops.plan.utilities.metrics.BStats;
|
||||||
import com.djrapitops.plugin.BukkitPlugin;
|
import com.djrapitops.plugin.BukkitPlugin;
|
||||||
@ -357,6 +357,7 @@ public class Plan extends BukkitPlugin implements PlanPlugin {
|
|||||||
return ConfigSystem.getInstance().getConfig();
|
return ConfigSystem.getInstance().getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public InformationManager getInfoManager() {
|
public InformationManager getInfoManager() {
|
||||||
return infoManager;
|
return infoManager;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ import com.djrapitops.plan.systems.Systems;
|
|||||||
import com.djrapitops.plan.systems.info.BungeeInformationManager;
|
import com.djrapitops.plan.systems.info.BungeeInformationManager;
|
||||||
import com.djrapitops.plan.systems.info.InformationManager;
|
import com.djrapitops.plan.systems.info.InformationManager;
|
||||||
import com.djrapitops.plan.systems.info.server.BungeeServerInfoManager;
|
import com.djrapitops.plan.systems.info.server.BungeeServerInfoManager;
|
||||||
import com.djrapitops.plan.systems.tasks.TaskSystem;
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plan.utilities.file.export.HtmlExport;
|
import com.djrapitops.plan.utilities.file.export.HtmlExport;
|
||||||
import com.djrapitops.plugin.BungeePlugin;
|
import com.djrapitops.plugin.BungeePlugin;
|
||||||
import com.djrapitops.plugin.StaticHolder;
|
import com.djrapitops.plugin.StaticHolder;
|
||||||
|
@ -10,6 +10,7 @@ import com.djrapitops.plan.system.file.FileSystem;
|
|||||||
import com.djrapitops.plan.system.listeners.ListenerSystem;
|
import com.djrapitops.plan.system.listeners.ListenerSystem;
|
||||||
import com.djrapitops.plan.system.processing.ProcessingQueue;
|
import com.djrapitops.plan.system.processing.ProcessingQueue;
|
||||||
import com.djrapitops.plan.system.settings.config.ConfigSystem;
|
import com.djrapitops.plan.system.settings.config.ConfigSystem;
|
||||||
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
||||||
import com.djrapitops.plan.utilities.NullCheck;
|
import com.djrapitops.plan.utilities.NullCheck;
|
||||||
import com.djrapitops.plugin.api.Check;
|
import com.djrapitops.plugin.api.Check;
|
||||||
@ -33,6 +34,7 @@ public abstract class PlanSystem implements SubSystem {
|
|||||||
protected DBSystem databaseSystem;
|
protected DBSystem databaseSystem;
|
||||||
|
|
||||||
protected ListenerSystem listenerSystem;
|
protected ListenerSystem listenerSystem;
|
||||||
|
protected TaskSystem taskSystem;
|
||||||
|
|
||||||
public PlanSystem() {
|
public PlanSystem() {
|
||||||
processingQueue = new ProcessingQueue();
|
processingQueue = new ProcessingQueue();
|
||||||
@ -48,12 +50,14 @@ public abstract class PlanSystem implements SubSystem {
|
|||||||
databaseSystem.enable();
|
databaseSystem.enable();
|
||||||
processingQueue.enable();
|
processingQueue.enable();
|
||||||
listenerSystem.enable();
|
listenerSystem.enable();
|
||||||
|
taskSystem.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disable() {
|
public void disable() {
|
||||||
processingQueue.disable();
|
processingQueue.disable();
|
||||||
databaseSystem.disable();
|
databaseSystem.disable();
|
||||||
|
taskSystem.disable();
|
||||||
configSystem.disable();
|
configSystem.disable();
|
||||||
fileSystem.disable();
|
fileSystem.disable();
|
||||||
versionCheckSystem.disable();
|
versionCheckSystem.disable();
|
||||||
@ -114,4 +118,8 @@ public abstract class PlanSystem implements SubSystem {
|
|||||||
public ListenerSystem getListenerSystem() {
|
public ListenerSystem getListenerSystem() {
|
||||||
return listenerSystem;
|
return listenerSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TaskSystem getTaskSystem() {
|
||||||
|
return taskSystem;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,10 +1,18 @@
|
|||||||
package com.djrapitops.plan.system.listeners;
|
package com.djrapitops.plan.system.listeners;
|
||||||
|
|
||||||
|
import com.djrapitops.plan.system.PlanSystem;
|
||||||
import com.djrapitops.plan.system.SubSystem;
|
import com.djrapitops.plan.system.SubSystem;
|
||||||
|
import com.djrapitops.plan.utilities.NullCheck;
|
||||||
import com.djrapitops.plugin.api.Benchmark;
|
import com.djrapitops.plugin.api.Benchmark;
|
||||||
|
|
||||||
public abstract class ListenerSystem implements SubSystem {
|
public abstract class ListenerSystem implements SubSystem {
|
||||||
|
|
||||||
|
public static ListenerSystem getInstance() {
|
||||||
|
ListenerSystem listenerSystem = PlanSystem.getInstance().getListenerSystem();
|
||||||
|
NullCheck.check(listenerSystem, new IllegalStateException("Listener system was not initialized."));
|
||||||
|
return listenerSystem;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
Benchmark.start("Register Listeners");
|
Benchmark.start("Register Listeners");
|
||||||
|
@ -5,7 +5,7 @@ import com.djrapitops.plan.data.container.Session;
|
|||||||
import com.djrapitops.plan.system.processing.processors.info.NetworkPageUpdateProcessor;
|
import com.djrapitops.plan.system.processing.processors.info.NetworkPageUpdateProcessor;
|
||||||
import com.djrapitops.plan.system.processing.processors.player.*;
|
import com.djrapitops.plan.system.processing.processors.player.*;
|
||||||
import com.djrapitops.plan.systems.cache.DataCache;
|
import com.djrapitops.plan.systems.cache.DataCache;
|
||||||
import com.djrapitops.plan.systems.tasks.TaskSystem;
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plan.utilities.MiscUtils;
|
import com.djrapitops.plan.utilities.MiscUtils;
|
||||||
import com.djrapitops.plugin.api.systems.NotificationCenter;
|
import com.djrapitops.plugin.api.systems.NotificationCenter;
|
||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* Licence is provided in the jar as license.yml also here:
|
* Licence is provided in the jar as license.yml also here:
|
||||||
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
||||||
*/
|
*/
|
||||||
package com.djrapitops.plan.systems.tasks;
|
package com.djrapitops.plan.system.tasks;
|
||||||
|
|
||||||
import com.djrapitops.plan.Plan;
|
import com.djrapitops.plan.Plan;
|
||||||
import com.djrapitops.plan.settings.locale.Locale;
|
import com.djrapitops.plan.settings.locale.Locale;
|
||||||
@ -21,7 +21,7 @@ import com.djrapitops.plugin.task.RunnableFactory;
|
|||||||
*
|
*
|
||||||
* @author Rsl1122
|
* @author Rsl1122
|
||||||
*/
|
*/
|
||||||
public class PlanTaskSystem extends TaskSystem {
|
public class BukkitTaskSystem extends TaskSystem {
|
||||||
|
|
||||||
// TODO Remove Plan.getInstance requirement.
|
// TODO Remove Plan.getInstance requirement.
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
* Licence is provided in the jar as license.yml also here:
|
* Licence is provided in the jar as license.yml also here:
|
||||||
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
||||||
*/
|
*/
|
||||||
package com.djrapitops.plan.systems.tasks;
|
package com.djrapitops.plan.system.tasks;
|
||||||
|
|
||||||
import com.djrapitops.plan.PlanBungee;
|
import com.djrapitops.plan.PlanBungee;
|
||||||
import com.djrapitops.plan.systems.info.BungeeInformationManager;
|
import com.djrapitops.plan.systems.info.BungeeInformationManager;
|
||||||
@ -14,7 +14,7 @@ import com.djrapitops.plugin.task.AbsRunnable;
|
|||||||
*
|
*
|
||||||
* @author Rsl1122
|
* @author Rsl1122
|
||||||
*/
|
*/
|
||||||
public class PlanBungeeTaskSystem extends TaskSystem {
|
public class BungeeTaskSystem extends TaskSystem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.djrapitops.plan.systems.tasks;
|
package com.djrapitops.plan.system.tasks;
|
||||||
|
|
||||||
import com.djrapitops.plan.Plan;
|
import com.djrapitops.plan.Plan;
|
||||||
import com.djrapitops.plan.PlanBungee;
|
import com.djrapitops.plan.PlanBungee;
|
@ -2,10 +2,11 @@
|
|||||||
* Licence is provided in the jar as license.yml also here:
|
* Licence is provided in the jar as license.yml also here:
|
||||||
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
* https://github.com/Rsl1122/Plan-PlayerAnalytics/blob/master/Plan/src/main/resources/license.yml
|
||||||
*/
|
*/
|
||||||
package com.djrapitops.plan.systems.tasks;
|
package com.djrapitops.plan.system.tasks;
|
||||||
|
|
||||||
|
import com.djrapitops.plan.PlanPlugin;
|
||||||
|
import com.djrapitops.plan.system.PlanSystem;
|
||||||
import com.djrapitops.plan.system.SubSystem;
|
import com.djrapitops.plan.system.SubSystem;
|
||||||
import com.djrapitops.plan.systems.Systems;
|
|
||||||
import com.djrapitops.plugin.api.systems.TaskCenter;
|
import com.djrapitops.plugin.api.systems.TaskCenter;
|
||||||
import com.djrapitops.plugin.task.AbsRunnable;
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
import com.djrapitops.plugin.task.IRunnable;
|
import com.djrapitops.plugin.task.IRunnable;
|
||||||
@ -21,7 +22,7 @@ public abstract class TaskSystem implements SubSystem {
|
|||||||
protected TPSCountTimer tpsCountTimer;
|
protected TPSCountTimer tpsCountTimer;
|
||||||
|
|
||||||
public static TaskSystem getInstance() {
|
public static TaskSystem getInstance() {
|
||||||
return Systems.getInstance().getTaskSystem();
|
return PlanSystem.getInstance().getTaskSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IRunnable registerTask(AbsRunnable runnable) {
|
protected IRunnable registerTask(AbsRunnable runnable) {
|
@ -17,9 +17,9 @@ import com.djrapitops.plan.system.settings.config.BungeeConfigSystem;
|
|||||||
import com.djrapitops.plan.system.settings.config.ConfigSystem;
|
import com.djrapitops.plan.system.settings.config.ConfigSystem;
|
||||||
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
||||||
import com.djrapitops.plan.system.webserver.WebServerSystem;
|
import com.djrapitops.plan.system.webserver.WebServerSystem;
|
||||||
import com.djrapitops.plan.systems.tasks.PlanBungeeTaskSystem;
|
import com.djrapitops.plan.system.tasks.BungeeTaskSystem;
|
||||||
import com.djrapitops.plan.systems.tasks.PlanTaskSystem;
|
import com.djrapitops.plan.system.tasks.BukkitTaskSystem;
|
||||||
import com.djrapitops.plan.systems.tasks.TaskSystem;
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class Systems {
|
|||||||
databaseSystem = new BukkitDBSystem();
|
databaseSystem = new BukkitDBSystem();
|
||||||
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
|
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
|
||||||
|
|
||||||
taskSystem = new PlanTaskSystem();
|
taskSystem = new BukkitTaskSystem();
|
||||||
|
|
||||||
webServerSystem = new WebServerSystem();
|
webServerSystem = new WebServerSystem();
|
||||||
themeSystem = new Theme();
|
themeSystem = new Theme();
|
||||||
@ -69,7 +69,7 @@ public class Systems {
|
|||||||
databaseSystem = new BungeeDBSystem();
|
databaseSystem = new BungeeDBSystem();
|
||||||
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
|
versionCheckSystem = new VersionCheckSystem(plugin.getVersion());
|
||||||
|
|
||||||
taskSystem = new PlanBungeeTaskSystem();
|
taskSystem = new BungeeTaskSystem();
|
||||||
|
|
||||||
webServerSystem = new WebServerSystem();
|
webServerSystem = new WebServerSystem();
|
||||||
themeSystem = new Theme();
|
themeSystem = new Theme();
|
||||||
|
@ -21,6 +21,7 @@ import java.util.*;
|
|||||||
*
|
*
|
||||||
* @author Rsl1122
|
* @author Rsl1122
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public abstract class InformationManager {
|
public abstract class InformationManager {
|
||||||
boolean usingAnotherWebServer;
|
boolean usingAnotherWebServer;
|
||||||
String webServerAddress;
|
String webServerAddress;
|
||||||
|
@ -16,8 +16,8 @@ import com.djrapitops.plan.systems.cache.DataCache;
|
|||||||
import com.djrapitops.plan.systems.cache.SessionCache;
|
import com.djrapitops.plan.systems.cache.SessionCache;
|
||||||
import com.djrapitops.plan.systems.info.BukkitInformationManager;
|
import com.djrapitops.plan.systems.info.BukkitInformationManager;
|
||||||
import com.djrapitops.plan.systems.info.InformationManager;
|
import com.djrapitops.plan.systems.info.InformationManager;
|
||||||
import com.djrapitops.plan.systems.tasks.PlanTaskSystem;
|
import com.djrapitops.plan.system.tasks.BukkitTaskSystem;
|
||||||
import com.djrapitops.plan.systems.tasks.TaskSystem;
|
import com.djrapitops.plan.system.tasks.TaskSystem;
|
||||||
import com.djrapitops.plugin.StaticHolder;
|
import com.djrapitops.plugin.StaticHolder;
|
||||||
import com.djrapitops.plugin.api.Benchmark;
|
import com.djrapitops.plugin.api.Benchmark;
|
||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
@ -55,7 +55,7 @@ public class Analysis {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
((PlanTaskSystem) TaskSystem.getInstance()).cancelBootAnalysis();
|
((BukkitTaskSystem) TaskSystem.getInstance()).cancelBootAnalysis();
|
||||||
|
|
||||||
Benchmark.start("Analysis");
|
Benchmark.start("Analysis");
|
||||||
log(Locale.get(Msg.ANALYSIS_START).toString());
|
log(Locale.get(Msg.ANALYSIS_START).toString());
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.djrapitops.plan.utilities.html.graphs.line;
|
package com.djrapitops.plan.utilities.html.graphs.line;
|
||||||
|
|
||||||
import com.djrapitops.plan.data.container.TPS;
|
import com.djrapitops.plan.data.container.TPS;
|
||||||
import com.djrapitops.plan.systems.tasks.TPSCountTimer;
|
import com.djrapitops.plan.system.tasks.TPSCountTimer;
|
||||||
import com.djrapitops.plan.utilities.analysis.Point;
|
import com.djrapitops.plan.utilities.analysis.Point;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.djrapitops.plan.utilities.html.graphs.line;
|
package com.djrapitops.plan.utilities.html.graphs.line;
|
||||||
|
|
||||||
import com.djrapitops.plan.data.container.TPS;
|
import com.djrapitops.plan.data.container.TPS;
|
||||||
import com.djrapitops.plan.systems.tasks.TPSCountTimer;
|
import com.djrapitops.plan.system.tasks.TPSCountTimer;
|
||||||
import com.djrapitops.plan.utilities.analysis.Point;
|
import com.djrapitops.plan.utilities.analysis.Point;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
Loading…
Reference in New Issue
Block a user