mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(runner): add policy listener registering function and support registering McpConfigWatcher after starting
This commit is contained in:
@@ -95,6 +95,7 @@ public class LocalRunnerClient extends RunnerClient implements AutoCloseable {
|
|||||||
executor
|
executor
|
||||||
);
|
);
|
||||||
configWatcher.start();
|
configWatcher.start();
|
||||||
|
configWatcher.registerPolicyListener();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
closeQuietly(configWatcher);
|
closeQuietly(configWatcher);
|
||||||
closeQuietly(dynamicManager);
|
closeQuietly(dynamicManager);
|
||||||
|
|||||||
@@ -112,4 +112,8 @@ abstract class PolicyProvider(
|
|||||||
|
|
||||||
interface RunnerExecutionPolicyListener {
|
interface RunnerExecutionPolicyListener {
|
||||||
fun onPolicyChanged(policy: ExecutionPolicy)
|
fun onPolicyChanged(policy: ExecutionPolicy)
|
||||||
|
|
||||||
|
fun registerPolicyListener() {
|
||||||
|
ExecutionPolicyRegistry.addListener(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user