Move GrpcServer to common shared module#12
Closed
tgasla wants to merge 3 commits into
Closed
Conversation
GrpcServer had no domain-specific logic — it was duplicated in both domains only because it instantiated CloudSimGrpcService directly. Fix by accepting BindableService via constructor (DI); both Main.java callers now pass new CloudSimGrpcService() explicitly. Also removes the duplicate shutdown hook that GrpcServer.start() was registering alongside the one already in Main.java, and drops the dead isShutdownRequested() wrapper that was never called externally. https://claude.ai/code/session_01GsBJinChRAbqvGNUgsVzDq
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.
Summary
GrpcServerwas duplicated in both domains only because it hardcodednew CloudSimGrpcService()in its constructor, coupling it to domain-specific codeBindableService(gRPC's own interface) via constructor; bothMain.javacallers now passnew CloudSimGrpcService()explicitlycommon/cloudsimplus-gateway-sharedBonus fixes
GrpcServer.start()was registering alongside the one already inMain.java(both were callingstop()on JVM exit)GrpcServer.isShutdownRequested()— package-private wrapper that was never called externally (dead code)Test plan
make build-gateway domain=vm-managementcompiles successfullymake build-gateway domain=job-placementcompiles successfullymake run domain=vm-managementstarts and connects via gRPCmake run domain=job-placementstarts and connects via gRPChttps://claude.ai/code/session_01GsBJinChRAbqvGNUgsVzDq
Generated by Claude Code