Class GrpcServerStartedEvent

java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.grpc.server.lifecycle.GrpcServerLifecycleEvent
org.springframework.grpc.server.lifecycle.GrpcServerStartedEvent
All Implemented Interfaces:
Serializable

public class GrpcServerStartedEvent extends GrpcServerLifecycleEvent
This event will be fired after the server has been started.
Author:
Daniel Theuke ([email protected])
See Also:
  • Constructor Details

    • GrpcServerStartedEvent

      public GrpcServerStartedEvent(GrpcServerLifecycle lifecyle, Clock clock, io.grpc.Server server, String address, int port)
      Creates a new GrpcServerStartedEvent.
      Parameters:
      lifecyle - The lifecycle that caused this event.
      clock - The clock used to determine the timestamp.
      server - The server related to this event.
      address - The address the server is bound to.
      port - The port the server is bound to or -1 if it isn't bound to a particular port.
    • GrpcServerStartedEvent

      public GrpcServerStartedEvent(GrpcServerLifecycle lifecyle, io.grpc.Server server, String address, int port)
      Creates a new GrpcServerStartedEvent.
      Parameters:
      lifecyle - The lifecycle that caused this event.
      server - The server related to this event.
      address - The address the server is bound to.
      port - The port the server is bound to or -1 if it isn't bound to a particular port.
  • Method Details

    • getAddress

      public String getAddress()
      Gets the address the server was started with.
      Returns:
      The address to use.
    • getPort

      public int getPort()
      Gets the main port the server uses.
      Returns:
      The main port of the server. -1 indicates that the server isn't bound to a particular port.