Class NodeExecutorRegistry
java.lang.Object
ai.nervemind.app.service.NodeExecutorRegistry
Central registry for all available
NodeExecutor implementations.
Acts as a lookup service used by the ExecutionService to find the
correct
execution logic for any given node type. Supports both built-in executors
(auto-wired
by Spring) and dynamic executors provided by plugins.
Responsibilities
- Auto-Discovery: Collects all Spring beans implementing NodeExecutor on startup.
- Lookup: efficient O(1) retrieval of executors by type string.
- Dynamic Registration: Allows runtime addition/removal of executors (e.g., from plugins).
-
Constructor Summary
ConstructorsConstructorDescriptionNodeExecutorRegistry(List<NodeExecutor> executorList) Creates a new NodeExecutorRegistry with the provided list of executors. -
Method Summary
Modifier and TypeMethodDescriptiongetExecutor(String nodeType) Retrieves the executor for the specified node type.Get all registered node types.booleanhasExecutor(String nodeType) Checks if an executor exists for the specified node type.voidregisterExecutor(NodeExecutor executor) Dynamically register a node executor.booleanunregisterExecutor(String nodeType) Unregister a node executor.
-
Constructor Details
-
NodeExecutorRegistry
Creates a new NodeExecutorRegistry with the provided list of executors.- Parameters:
executorList- the list of node executors to register
-
-
Method Details
-
getExecutor
Retrieves the executor for the specified node type.- Parameters:
nodeType- the type of node to get the executor for- Returns:
- the executor for the node type
- Throws:
IllegalArgumentException- if no executor is found for the node type
-
hasExecutor
Checks if an executor exists for the specified node type.- Parameters:
nodeType- the type of node to check- Returns:
- true if an executor exists for the node type, false otherwise
-
registerExecutor
Dynamically register a node executor. Used by plugin system to add custom node types at runtime.- Parameters:
executor- The executor to register- Throws:
IllegalArgumentException- if an executor for this type already exists
-
unregisterExecutor
Unregister a node executor. Used by plugin system when unloading plugins.- Parameters:
nodeType- The node type to unregister- Returns:
- true if executor was removed, false if it didn't exist
-
getRegisteredNodeTypes
-