mirror of
https://github.com/LamGC/Oracle-Sentry.git
synced 2025-04-30 14:47:34 +00:00
refactor: 调整类名, 以更符合其意义.
更改类名和相关属性名.
This commit is contained in:
parent
c47ab110bc
commit
bf29faa9a5
@ -6,7 +6,7 @@ import net.lamgc.oracle.sentry.script.tools.http.ScriptHttpClient;
|
|||||||
/**
|
/**
|
||||||
* @author LamGC
|
* @author LamGC
|
||||||
*/
|
*/
|
||||||
public final record ScriptComponent(
|
public final record ScriptComponents(
|
||||||
ScriptHttpClient HTTP,
|
ScriptHttpClient HTTP,
|
||||||
ComputeInstanceManager InstanceManager
|
ComputeInstanceManager InstanceManager
|
||||||
) {
|
) {
|
@ -19,13 +19,13 @@ public final class ScriptManager {
|
|||||||
|
|
||||||
private final Set<ScriptLoader> loaders = new HashSet<>();
|
private final Set<ScriptLoader> loaders = new HashSet<>();
|
||||||
private final File scriptsLocation;
|
private final File scriptsLocation;
|
||||||
private final ScriptComponent context;
|
private final ScriptComponents context;
|
||||||
|
|
||||||
private final Map<ScriptInfo, Script> scripts = new ConcurrentHashMap<>();
|
private final Map<ScriptInfo, Script> scripts = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public ScriptManager(File scriptsLocation, ScriptComponent context) {
|
public ScriptManager(File scriptsLocation, ScriptComponents components) {
|
||||||
this.scriptsLocation = scriptsLocation;
|
this.scriptsLocation = scriptsLocation;
|
||||||
this.context = context;
|
this.context = components;
|
||||||
loadScriptLoaders();
|
loadScriptLoaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class ScriptManagerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void loadScriptTest() {
|
public void loadScriptTest() {
|
||||||
ScriptManager manager = new ScriptManager(new File("./run/scripts"),
|
ScriptManager manager = new ScriptManager(new File("./run/scripts"),
|
||||||
new ScriptComponent(new ScriptHttpClient(HttpClientBuilder.create().build()),
|
new ScriptComponents(new ScriptHttpClient(HttpClientBuilder.create().build()),
|
||||||
new ComputeInstanceManager()));
|
new ComputeInstanceManager()));
|
||||||
|
|
||||||
manager.loadScripts();
|
manager.loadScripts();
|
||||||
|
Loading…
Reference in New Issue
Block a user