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 RSocketServers backed
by Netty.- Since:
- 2.2.0
- Author:
- Brian Clozel, Chris Bono, Scott Frederick
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRSocketServerCustomizers(RSocketServerCustomizer... rSocketServerCustomizers) AddRSocketServerCustomizers that should be called to configure theRSocketServer.create(io.rsocket.SocketAcceptor socketAcceptor) Gets a new fully configured but pausedRSocketServerinstance.voidsetAddress(InetAddress address) Set the specific network address that the server should bind to.voidsetFragmentSize(DataSize fragmentSize) Specify the maximum transmission unit.voidsetLifecycleTimeout(Duration lifecycleTimeout) Set the maximum amount of time that should be waited when starting or stopping the server.voidsetPort(int port) Set the port that the server should listen on.voidsetResourceFactory(ReactorResourceFactory resourceFactory) Set theReactorResourceFactoryto get the shared resources from.voidsetRSocketServerCustomizers(Collection<? extends RSocketServerCustomizer> rSocketServerCustomizers) SetRSocketServerCustomizers that should be called to configure theRSocketServerwhile building the server.voidSets the SSL configuration that will be applied to the server's default connector.voidsetSslBundles(SslBundles sslBundles) Sets an SSL bundle that can be used to get SSL configuration.voidsetTransport(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:ConfigurableRSocketServerFactorySet the port that the server should listen on. If not specified port '9898' will be used.- Specified by:
setPortin interfaceConfigurableRSocketServerFactory- Parameters:
port- the port to set
-
setFragmentSize
Description copied from interface:ConfigurableRSocketServerFactorySpecify the maximum transmission unit. Frames larger than the specifiedfragmentSizeare fragmented.- Specified by:
setFragmentSizein interfaceConfigurableRSocketServerFactory- Parameters:
fragmentSize- the fragment size
-
setAddress
Description copied from interface:ConfigurableRSocketServerFactorySet the specific network address that the server should bind to.- Specified by:
setAddressin interfaceConfigurableRSocketServerFactory- Parameters:
address- the address to set (defaults tonull)
-
setTransport
Description copied from interface:ConfigurableRSocketServerFactorySet the transport that the RSocket server should use.- Specified by:
setTransportin interfaceConfigurableRSocketServerFactory- Parameters:
transport- the transport protocol to use
-
setSsl
Description copied from interface:ConfigurableRSocketServerFactorySets the SSL configuration that will be applied to the server's default connector.- Specified by:
setSslin interfaceConfigurableRSocketServerFactory- Parameters:
ssl- the SSL configuration
-
setSslBundles
Description copied from interface:ConfigurableRSocketServerFactorySets an SSL bundle that can be used to get SSL configuration.- Specified by:
setSslBundlesin interfaceConfigurableRSocketServerFactory- Parameters:
sslBundles- the SSL bundles
-
setResourceFactory
Set theReactorResourceFactoryto get the shared resources from.- Parameters:
resourceFactory- the server resources
-
setRSocketServerCustomizers
public void setRSocketServerCustomizers(Collection<? extends RSocketServerCustomizer> rSocketServerCustomizers) SetRSocketServerCustomizers that should be called to configure theRSocketServerwhile 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
AddRSocketServerCustomizers 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:RSocketServerFactoryGets a new fully configured but pausedRSocketServerinstance. Clients should not be able to connect to the returned server untilRSocketServer.start()is called (which happens when theApplicationContexthas been fully refreshed).- Specified by:
createin interfaceRSocketServerFactory- Parameters:
socketAcceptor- the socket acceptor- Returns:
- a fully configured and started
RSocketServer - See Also:
-