public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolReceivingChannelAdapter
lifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| Constructor and Description |
|---|
UnicastReceivingChannelAdapter(int port)
Constructs a UnicastReceivingChannelAdapter that listens on the specified port.
|
UnicastReceivingChannelAdapter(int port,
boolean lengthCheck)
Constructs a UnicastReceivingChannelAdapter that listens for packets on
the specified port.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
asyncSendMessage(java.net.DatagramPacket packet) |
protected void |
doSend(java.net.DatagramPacket packet) |
protected void |
doStop()
Takes no action by default.
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
int |
getPort() |
java.net.DatagramSocket |
getSocket() |
protected java.net.DatagramSocket |
getTheSocket() |
boolean |
isLongLived() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected java.net.DatagramPacket |
receive() |
void |
run() |
protected void |
sendAck(org.springframework.messaging.Message<byte[]> message) |
void |
setLengthCheck(boolean lengthCheck) |
void |
setLookupHost(boolean lookupHost) |
void |
setSocket(java.net.DatagramSocket socket) |
protected void |
setSocketAttributes(java.net.DatagramSocket socket)
Sets timeout and receive buffer size
|
void |
setSoSendBufferSize(int soSendBufferSize) |
checkTaskExecutor, doStart, getApplicationEventPublisher, getLocalAddress, getReceiveBufferSize, getSoReceiveBufferSize, getSoTimeout, getTaskExecutor, isActive, isListening, setApplicationEventPublisher, setListening, setLocalAddress, setPoolSize, setReceiveBufferSize, setSoReceiveBufferSize, setSoTimeout, setTaskExecutorafterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic UnicastReceivingChannelAdapter(int port)
port - The port.public UnicastReceivingChannelAdapter(int port,
boolean lengthCheck)
port - The port.lengthCheck - If true, enables the lengthCheck Option.public void setLengthCheck(boolean lengthCheck)
lengthCheck - if true, the incoming packet is expected to have a four
byte binary length header.public boolean isLongLived()
public int getPort()
getPort in class AbstractInternetProtocolReceivingChannelAdapterprotected void onInit()
IntegrationObjectSupportonInit in class MessageProducerSupportpublic void run()
protected void sendAck(org.springframework.messaging.Message<byte[]> message)
protected boolean asyncSendMessage(java.net.DatagramPacket packet)
protected void doSend(java.net.DatagramPacket packet)
protected java.net.DatagramPacket receive()
throws java.lang.Exception
java.lang.Exceptionpublic void setSocket(java.net.DatagramSocket socket)
socket - the socket to setprotected java.net.DatagramSocket getTheSocket()
public java.net.DatagramSocket getSocket()
protected void setSocketAttributes(java.net.DatagramSocket socket)
throws java.net.SocketException
socket - The socket.java.net.SocketException - Any socket exception.protected void doStop()
MessageProducerSupportdoStop in class AbstractInternetProtocolReceivingChannelAdapterpublic void setSoSendBufferSize(int soSendBufferSize)
soSendBufferSize - The send buffer size.Socket.setSendBufferSize(int),
DatagramSocket.setSendBufferSize(int)public void setLookupHost(boolean lookupHost)
public java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupport