-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register/unregister player graph samplers on join/leave
- Loading branch information
Showing
5 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...c/main/java/com/djrapitops/plan/extension/implementation/ExtensionMethodErrorTracker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* This file is part of Player Analytics (Plan). | ||
* | ||
* Plan is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License v3 as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Plan is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with Plan. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.djrapitops.plan.extension.implementation; | ||
|
||
import com.djrapitops.plan.extension.extractor.ExtensionMethod; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
/** | ||
* In charge of tracking which extension methods got disabled due to an error. | ||
* | ||
* @author AuroraLS3 | ||
*/ | ||
public class ExtensionMethodErrorTracker { | ||
|
||
private static final Set<String> disabledExtensionPlayerGraphMethods = Collections.newSetFromMap(new ConcurrentHashMap<>()); | ||
|
||
private ExtensionMethodErrorTracker() { | ||
/* Static storage class. */ | ||
} | ||
|
||
public static void clear() { | ||
disabledExtensionPlayerGraphMethods.clear(); | ||
} | ||
|
||
public static boolean isDisabled(ExtensionWrapper extension, ExtensionMethod method) { | ||
String name = extension.getPluginName() + "." + method.getMethodName(); | ||
return disabledExtensionPlayerGraphMethods.contains(name); | ||
} | ||
|
||
public static void errored(ExtensionWrapper extension, ExtensionMethod method) { | ||
String name = extension.getPluginName() + "." + method.getMethodName(); | ||
disabledExtensionPlayerGraphMethods.add(name); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters