mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +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
|
||||
);
|
||||
configWatcher.start();
|
||||
configWatcher.registerPolicyListener();
|
||||
} catch (Exception e) {
|
||||
closeQuietly(configWatcher);
|
||||
closeQuietly(dynamicManager);
|
||||
|
||||
@@ -112,4 +112,8 @@ abstract class PolicyProvider(
|
||||
|
||||
interface RunnerExecutionPolicyListener {
|
||||
fun onPolicyChanged(policy: ExecutionPolicy)
|
||||
|
||||
fun registerPolicyListener() {
|
||||
ExecutionPolicyRegistry.addListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user