Conversation
… singleton Refactor AdaptorManager to static singleton pattern to resolve circular dependency issue exposed by @lazy injection in previous commit. Problem: - Previous commit used @lazy to inject AdaptorManager into ChannelRouter - This exposed circular dependency: ChannelRouter → AdaptorManager ← ChannelService → ChannelRouter - @lazy is a workaround that masks the architectural issue - Inner layer (ChannelRouter) should not depend on outer context (AdaptorManager bean) Solution: - Convert AdaptorManager to static singleton pattern with getInstance() - Remove all Spring dependency injection for AdaptorManager in ChannelRouter and ChannelService - BellaAutoConf now initializes the singleton instead of creating new instance - Direct static access eliminates circular dependency without @lazy workaround Changes: - AdaptorManager: Add private constructor, static INSTANCE field, and getInstance() method - BellaAutoConf: Call AdaptorManager.getInstance() in @bean adaptorManager() - ChannelRouter: Remove @lazy @Autowired, use AdaptorManager.getInstance().support() - ChannelService: Remove @Autowired, use AdaptorManager.getInstance().support() Impact: - Eliminates circular dependency without workarounds - Minimal code changes (15 lines) - No new components or files added - Zero performance impact (still in-memory lookup) - AdaptorManager naturally fits singleton utility pattern 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.