public class NetServerFactoryBean<IN,OUT,CONN extends reactor.io.net.ChannelStream<IN,OUT>>
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<reactor.io.net.ReactorPeer<IN,OUT,CONN>>, org.springframework.context.SmartLifecycle
FactoryBean for creating a ReactorPeer.| Constructor and Description |
|---|
NetServerFactoryBean(reactor.Environment env) |
| Modifier and Type | Method and Description |
|---|---|
reactor.io.net.ReactorPeer<IN,OUT,CONN> |
getObject() |
java.lang.Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
boolean |
isSingleton() |
NetServerFactoryBean |
setAutoStartup(boolean autoStartup)
Set whether to perform auto startup.
|
NetServerFactoryBean |
setCodec(java.lang.String codec)
Set the
Codec to use to managing encoding and decoding of the data. |
NetServerFactoryBean |
setDelimiter(java.lang.String delimiter)
Set the single-byte delimiter to use when framing is set to 'delimited'.
|
NetServerFactoryBean |
setDispatcher(java.lang.String dispatcher)
Set the name of the
Dispatcher to use, which will be pulled from the current Environment. |
NetServerFactoryBean |
setFraming(java.lang.String framing)
Set the type of framing to use.
|
NetServerFactoryBean |
setHost(java.lang.String host)
Set the host to which this server will bind.
|
NetServerFactoryBean |
setLengthFieldLength(int lengthFieldLength)
Set the length of the length field if using length-field framing.
|
NetServerFactoryBean |
setMessageHandler(org.springframework.messaging.MessageHandler messageHandler)
Set the
MessageHandler that will handle each incoming message. |
NetServerFactoryBean |
setPhase(int phase)
Set the phase in which this bean should start.
|
NetServerFactoryBean |
setPort(int port)
Set the port to which this server will bind.
|
NetServerFactoryBean |
setTransport(java.lang.String transport)
Set the transport to use for this NetServer.
|
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public NetServerFactoryBean setDispatcher(java.lang.String dispatcher)
Dispatcher to use, which will be pulled from the current Environment.dispatcher - dispatcher namepublic NetServerFactoryBean setPhase(int phase)
phase - the phasepublic NetServerFactoryBean setAutoStartup(boolean autoStartup)
autoStartup - true to enable auto startup, false otherwisepublic NetServerFactoryBean setHost(java.lang.String host)
host - the host to bind to (defaults to 0.0.0.0)public NetServerFactoryBean setPort(int port)
port - the port to bind to (defaults to 3000)public NetServerFactoryBean setCodec(java.lang.String codec)
Codec to use to managing encoding and decoding of the data.
The options for codecs currently are:
bytes - Use the standard byte array codec.string - Use the standard String codec.syslog - Use the standard Syslog codec.codec - the codecpublic NetServerFactoryBean setFraming(java.lang.String framing)
The options for framing are:
delimited - Means use a delimited line codec (defaults to LF).length - Means use a length-field based codec where the initial bytes of a message are the length of
the rest of the message.framing - type of framingpublic NetServerFactoryBean setDelimiter(java.lang.String delimiter)
LF - Means use a line feed \\n.CR - Means use a carriage return \\r.delimiter - the delimiter to usepublic NetServerFactoryBean setLengthFieldLength(int lengthFieldLength)
lengthFieldLength - 2 for a short, 4 for an int (the default), or 8
for a longpublic NetServerFactoryBean setTransport(java.lang.String transport)
Options for transport currently are:
tcp - Use the built-in Netty TCP support.udp - Use the built-in Netty UDP support.transport - the transport to usepublic NetServerFactoryBean setMessageHandler(org.springframework.messaging.MessageHandler messageHandler)
MessageHandler that will handle each incoming message.messageHandler - the MessageHandler to usepublic boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic java.lang.Class<?> getObjectType()