The Plugin Manager
What is the Plugin Manager?
The Plugin Manager is the orchestrator of GL Plugin. It's the central coordinator that wires everything together—handlers, services, and plugins. While it powers the entire system, you interact with it through a simple interface.

The Manager is responsible for:
Holding handlers that define plugin behavior
Storing global services shared across all plugins
Maintaining the Service Registry that resolves injections
Registering and retrieving plugins
Creating a Manager
handlers
List of handler instances that manage plugins
global_services
List of service instances available to all plugins
Registering Plugins
Use register_plugin() to add plugins to the manager:
When you register a plugin, the manager:

Identifies which handler the plugin belongs to (via
@Plugin.for_handler())Collects services from the handler and global services
Creates the plugin instance (
__new__)Injects services into the instance
Calls the handler's
initialize_plugin()methodStores the plugin for later retrieval
Retrieving Plugins
By Name
Retrieve a specific plugin using its name attribute:
By Handler Type
Retrieve all plugins managed by a specific handler:
This is useful for:
Processing all plugins of a category
Polymorphic operations across related plugins
Plugin discovery and introspection
Manager Lifecycle

Complete Example
Summary
PluginManager(handlers, global_services)
Create manager with handlers and global services
register_plugin(PluginClass)
Register a plugin class
get_plugin(name)
Retrieve a plugin by its name
get_plugins(HandlerType)
Retrieve all plugins for a handler type
Last updated