Skip to content

develop -> main#479

Merged
fengyizhu merged 4 commits intomainfrom
develop
Jan 27, 2026
Merged

develop -> main#479
fengyizhu merged 4 commits intomainfrom
develop

Conversation

@Jiakaic
Copy link
Member

@Jiakaic Jiakaic commented Jan 27, 2026

No description provided.

XinyuZhang132 and others added 4 commits January 23, 2026 12:04
… 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>
@fengyizhu fengyizhu merged commit eceaa78 into main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants