Package net.devh.boot.grpc.server.event
Class GrpcServerStartedEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
net.devh.boot.grpc.server.event.GrpcServerLifecycleEvent
net.devh.boot.grpc.server.event.GrpcServerStartedEvent
- All Implemented Interfaces:
Serializable
This event will be fired after the server has been started.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionGrpcServerStartedEvent
(GrpcServerLifecycle lifecyle, Server server, String address, int port) Creates a new GrpcServerStartedEvent.GrpcServerStartedEvent
(GrpcServerLifecycle lifecyle, Clock clock, Server server, String address, int port) Creates a new GrpcServerStartedEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the address the server server was started with.int
getPort()
Gets the main port the server uses.Methods inherited from class net.devh.boot.grpc.server.event.GrpcServerLifecycleEvent
getServer, getSource
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
GrpcServerStartedEvent
public GrpcServerStartedEvent(GrpcServerLifecycle lifecyle, Clock clock, 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, 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
Gets the address the server 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.
-