mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-23 07:41:19 +01:00
Add static variables to keep classes loaded at JVM shutdown
Affects issues: - Possibly fixed #2198
This commit is contained in:
parent
2af2bfe2f5
commit
a4cf4dd089
@ -17,7 +17,12 @@
|
|||||||
package com.djrapitops.plan.gathering;
|
package com.djrapitops.plan.gathering;
|
||||||
|
|
||||||
import com.djrapitops.plan.TaskSystem;
|
import com.djrapitops.plan.TaskSystem;
|
||||||
|
import com.djrapitops.plan.delivery.domain.ServerIdentifier;
|
||||||
|
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||||
|
import com.djrapitops.plan.gathering.domain.*;
|
||||||
|
import com.djrapitops.plan.identification.ServerUUID;
|
||||||
import net.playeranalytics.plugin.scheduling.RunnableFactory;
|
import net.playeranalytics.plugin.scheduling.RunnableFactory;
|
||||||
|
import org.apache.commons.text.TextStringBuilder;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@ -29,11 +34,25 @@ import javax.inject.Singleton;
|
|||||||
*
|
*
|
||||||
* @author AuroraLS3
|
* @author AuroraLS3
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ShutdownHook extends Thread {
|
public class ShutdownHook extends Thread {
|
||||||
|
|
||||||
private static ShutdownHook activated;
|
private static ShutdownHook activated;
|
||||||
|
|
||||||
|
// Static variables to keep these classes loaded until JVM shutdown hook has run.
|
||||||
|
private static final SessionCache sessionCache = new SessionCache();
|
||||||
|
private static final ActiveSession activeSession = new ActiveSession(null, null, 0, null, null);
|
||||||
|
private static final FinishedSession finishedSession = new FinishedSession(null, null, 0, 0, 0, null);
|
||||||
|
private static final DataMap extraData = new DataMap();
|
||||||
|
private static final WorldTimes worldTimes = new WorldTimes();
|
||||||
|
private static final PlayerKills playerKills = new PlayerKills();
|
||||||
|
private static final PlayerKill playerKill = new PlayerKill(null, null, null, null, 0);
|
||||||
|
private static final ServerIdentifier serverIdentifier = new ServerIdentifier(ServerUUID.randomUUID(), (String) null);
|
||||||
|
private static final MobKillCounter mobKillCounter = new MobKillCounter();
|
||||||
|
private static final DeathCounter deathCounter = new DeathCounter();
|
||||||
|
private static final TextStringBuilder textStringBuilder = new TextStringBuilder(0);
|
||||||
|
|
||||||
private final ShutdownDataPreservation dataPreservation;
|
private final ShutdownDataPreservation dataPreservation;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
Loading…
Reference in New Issue
Block a user