Solon's AppContext API Explained: Programmatic Bean Control Beyond Annotations
Solon's AppContext is the core container where IoC/AOP operations live, enabling developers to manage beans and annotation processors programmatically when standard annotations fall short. Developers can access AppContext in three ways: globally via Solon.context(), through injection into a component, or via the Plugin.start() lifecycle method. Because Solon builds its container incrementally rather than all at once, calling getBean() too early can return null, making async methods like getBeanAsync() the safer choice during startup. Two method families handle async retrieval: getBeanAsync() for a single bean and subBeansOfType() for all beans of a given base type as they become available. The API also distinguishes between baseType lookups, which return batches of matching beans, and concrete type lookups, which use hash-based matching for faster single-bean retrieval.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in