This repository was archived by the owner on Dec 10, 2025. It is now read-only.
feat: pass configHolder to connection setup for enhanced configuration flexibility#127
Merged
twisti-dev merged 2 commits intomasterfrom Nov 1, 2025
Merged
Conversation
…ion flexibility - Updated `ServerConnectionListener`, `ConnectionImpl`, and `ClientNettyClientImpl` to include `configHolder` in their connection setup methods. - Simplified logging configuration by directly utilizing `configHolder.config`.
Qodana for JVM513 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Netty configuration initialization to pass the AbstractSurfCloudConfigHolder instance explicitly instead of relying on Spring's bean<>() lookup. This improves testability and reduces coupling to Spring's dependency injection framework.
- Adds
configHolderparameter toConnectionImpl.configureSerialization()andConnectionImpl.connect() - Removes Spring
bean<>()lookup fromconfigureSerialization()to use the passed parameter - Updates all call sites to provide the
configHolderinstance
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/ConnectionImpl.kt | Adds configHolder parameter to connect() and configureSerialization() methods; replaces Spring bean lookup with parameter usage |
| surf-cloud-core/surf-cloud-core-client/src/main/kotlin/dev/slne/surf/cloud/core/client/netty/ClientNettyClientImpl.kt | Updates both ConnectionImpl.connect() call sites to pass configHolder |
| surf-cloud-standalone/src/main/kotlin/dev/slne/surf/cloud/standalone/netty/server/connection/ServerConnectionListener.kt | Updates ConnectionImpl.configureSerialization() call and formats broadcast() method signature |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request updates the client-server connection logic to ensure that serialization and logging handlers use the correct configuration from
configHolder. The main change is passingconfigHolderthrough the connection setup process, allowing for more flexible and accurate configuration management during network initialization.Configuration propagation and serialization updates
ConnectionImpl.connectmethod now accepts aconfigHolderparameter, enabling configuration data to be used when setting up connections. ([[1]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-20cf3f52f4f8e9c6180d76191766936b5515e1a235a5388ac65d593c9d55c694L91-R92),[[2]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-20cf3f52f4f8e9c6180d76191766936b5515e1a235a5388ac65d593c9d55c694L208-R209),[[3]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1224-R1225))configureSerializationmethod inConnectionImplhas been updated to takeconfigHolderas a parameter, ensuring that serialization and logging handlers use the correct logging level from the configuration. ([surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/network/ConnectionImpl.ktL1251-R1278](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1251-R1278))configureSerializationin both client and server connection setup now pass theconfigHolder, making configuration handling consistent across the codebase. ([[1]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-506d22b76b9a082323332c3dc92549cb0beeb7f98ebe28b5421f435a9a398175L94-R95),[[2]](https://github.com/SLNE-Development/surf-cloud/pull/127/files#diff-df77ee0c4e4c29a956ed179b19d51fa84cc61a550eac5d12bc35aeaf169adbfbL1251-R1278))These changes improve maintainability and make it easier to adjust connection behaviors based on configuration settings.