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
This event will be fired after the server has been started.
- Author:
- Daniel Theuke ([email protected])
- See Also:
-
Field Summary
Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionGrpcServerStartedEvent(GrpcServerLifecycle lifecyle, io.grpc.Server server, String address, int port) Creates a new GrpcServerStartedEvent.GrpcServerStartedEvent(GrpcServerLifecycle lifecyle, Clock clock, io.grpc.Server server, String address, int port) Creates a new GrpcServerStartedEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the address the server was started with.intgetPort()Gets the main port the server uses.Methods inherited from class GrpcServerLifecycleEvent
getServer, getSourceMethods inherited from class org.springframework.context.ApplicationEvent
getTimestampMethods inherited from class EventObject
toString
-
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-1if 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-1if it isn't bound to a particular port.
-
-
Method Details
-
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.
-1indicates that the server isn't bound to a particular port.
-