Class NettyRSocketServerFactory
java.lang.Object
org.springframework.boot.rsocket.netty.NettyRSocketServerFactory
- All Implemented Interfaces:
ConfigurableRSocketServerFactory
,RSocketServerFactory
public class NettyRSocketServerFactory
extends Object
implements RSocketServerFactory, ConfigurableRSocketServerFactory
RSocketServerFactory
that can be used to create RSocketServer
s backed
by Netty.- Since:
- 2.2.0
- Author:
- Brian Clozel, Chris Bono
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRSocketServerCustomizers
(RSocketServerCustomizer... rSocketServerCustomizers) AddRSocketServerCustomizer
s that should be called to configure theRSocketServer
.create
(io.rsocket.SocketAcceptor socketAcceptor) Gets a new fully configured but pausedRSocketServer
instance.void
setAddress
(InetAddress address) Set the specific network address that the server should bind to.void
setFragmentSize
(DataSize fragmentSize) Specify the maximum transmission unit.void
setLifecycleTimeout
(Duration lifecycleTimeout) Set the maximum amount of time that should be waited when starting or stopping the server.void
setPort
(int port) Set the port that the server should listen on.void
setResourceFactory
(ReactorResourceFactory resourceFactory) Set theReactorResourceFactory
to get the shared resources from.void
setRSocketServerCustomizers
(Collection<? extends RSocketServerCustomizer> rSocketServerCustomizers) SetRSocketServerCustomizer
s that should be called to configure theRSocketServer
while building the server.void
Sets the SSL configuration that will be applied to the server's default connector.void
setSslStoreProvider
(SslStoreProvider sslStoreProvider) Sets a provider that will be used to obtain SSL stores.void
setTransport
(RSocketServer.Transport transport) Set the transport that the RSocket server should use.
-
Constructor Details
-
NettyRSocketServerFactory
public NettyRSocketServerFactory()
-
-
Method Details
-
setPort
public void setPort(int port) Description copied from interface:ConfigurableRSocketServerFactory
Set the port that the server should listen on. If not specified port '9898' will be used.- Specified by:
setPort
in interfaceConfigurableRSocketServerFactory
- Parameters:
port
- the port to set
-
setFragmentSize
Description copied from interface:ConfigurableRSocketServerFactory
Specify the maximum transmission unit. Frames larger than the specifiedfragmentSize
are fragmented.- Specified by:
setFragmentSize
in interfaceConfigurableRSocketServerFactory
- Parameters:
fragmentSize
- the fragment size
-
setAddress
Description copied from interface:ConfigurableRSocketServerFactory
Set the specific network address that the server should bind to.- Specified by:
setAddress
in interfaceConfigurableRSocketServerFactory
- Parameters:
address
- the address to set (defaults tonull
)
-
setTransport
Description copied from interface:ConfigurableRSocketServerFactory
Set the transport that the RSocket server should use.- Specified by:
setTransport
in interfaceConfigurableRSocketServerFactory
- Parameters:
transport
- the transport protocol to use
-
setSsl
Description copied from interface:ConfigurableRSocketServerFactory
Sets the SSL configuration that will be applied to the server's default connector.- Specified by:
setSsl
in interfaceConfigurableRSocketServerFactory
- Parameters:
ssl
- the SSL configuration
-
setSslStoreProvider
Description copied from interface:ConfigurableRSocketServerFactory
Sets a provider that will be used to obtain SSL stores.- Specified by:
setSslStoreProvider
in interfaceConfigurableRSocketServerFactory
- Parameters:
sslStoreProvider
- the SSL store provider
-
setResourceFactory
Set theReactorResourceFactory
to get the shared resources from.- Parameters:
resourceFactory
- the server resources
-
setRSocketServerCustomizers
public void setRSocketServerCustomizers(Collection<? extends RSocketServerCustomizer> rSocketServerCustomizers) SetRSocketServerCustomizer
s that should be called to configure theRSocketServer
while building the server. Calling this method will replace any existing customizers.- Parameters:
rSocketServerCustomizers
- customizers to apply before the server starts- Since:
- 2.2.7
-
addRSocketServerCustomizers
AddRSocketServerCustomizer
s that should be called to configure theRSocketServer
.- Parameters:
rSocketServerCustomizers
- customizers to apply before the server starts- Since:
- 2.2.7
-
setLifecycleTimeout
Set the maximum amount of time that should be waited when starting or stopping the server.- Parameters:
lifecycleTimeout
- the lifecycle timeout
-
create
Description copied from interface:RSocketServerFactory
Gets a new fully configured but pausedRSocketServer
instance. Clients should not be able to connect to the returned server untilRSocketServer.start()
is called (which happens when theApplicationContext
has been fully refreshed).- Specified by:
create
in interfaceRSocketServerFactory
- Parameters:
socketAcceptor
- the socket acceptor- Returns:
- a fully configured and started
RSocketServer
- See Also:
-