Interface ServiceContainer

All Known Subinterfaces:
GrpcIoServer, GrpcServer

public interface ServiceContainer
A contract for registering gRPC service method handlers, without requiring a specific transport.

Generated gRPC service stubs use this interface as their binding abstraction, allowing them to work with any implementation - HTTP/2 via GrpcServer, event bus, etc.

  • Method Details

    • addService

      ServiceContainer addService(Service service)
      Add a service to this server.
      Parameters:
      service - the service to add
      Returns:
      a reference to this, so the API can be used fluently
      Throws:
      IllegalStateException - if a service with the same name is already registered
    • services

      List<Service> services()
      Get a list of all services registered with this server.
      Returns:
      an unmodifiable list of all registered services