Skip to content

Move GrpcServer to common shared module#12

Closed
tgasla wants to merge 3 commits into
v2from
claude/move-grpcserver-common-6EqhI
Closed

Move GrpcServer to common shared module#12
tgasla wants to merge 3 commits into
v2from
claude/move-grpcserver-common-6EqhI

Conversation

@tgasla

@tgasla tgasla commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • GrpcServer was duplicated in both domains only because it hardcoded new CloudSimGrpcService() in its constructor, coupling it to domain-specific code
  • Fix by accepting BindableService (gRPC's own interface) via constructor; both Main.java callers now pass new CloudSimGrpcService() explicitly
  • Delete both domain copies; single canonical version lives in common/cloudsimplus-gateway-shared

Bonus fixes

  • Removes the duplicate shutdown hook that GrpcServer.start() was registering alongside the one already in Main.java (both were calling stop() on JVM exit)
  • Drops GrpcServer.isShutdownRequested() — package-private wrapper that was never called externally (dead code)

Test plan

  • make build-gateway domain=vm-management compiles successfully
  • make build-gateway domain=job-placement compiles successfully
  • make run domain=vm-management starts and connects via gRPC
  • make run domain=job-placement starts and connects via gRPC

https://claude.ai/code/session_01GsBJinChRAbqvGNUgsVzDq


Generated by Claude Code

claude and others added 3 commits May 2, 2026 15:26
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
@tgasla tgasla closed this May 2, 2026
@tgasla tgasla deleted the claude/move-grpcserver-common-6EqhI branch May 2, 2026 18:49
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.

2 participants