public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolReceivingChannelAdapter
lifecycleCondition, lifecycleLockEXPRESSION_PARSER, loggerDEFAULT_PHASE| 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(DatagramPacket packet) |
protected void |
doSend(DatagramPacket packet) |
protected void |
doStop()
Takes no action by default.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
int |
getPort() |
DatagramSocket |
getSocket() |
protected DatagramSocket |
getTheSocket() |
boolean |
isLongLived() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected DatagramPacket |
receive() |
void |
run() |
protected void |
sendAck(Message<byte[]> message) |
void |
setLengthCheck(boolean lengthCheck) |
void |
setLookupHost(boolean lookupHost) |
void |
setSocket(DatagramSocket socket) |
protected void |
setSocketAttributes(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, start, stop, stopafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBeanName, getComponentNamepublic 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(Message<byte[]> message)
protected boolean asyncSendMessage(DatagramPacket packet)
protected void doSend(DatagramPacket packet)
protected DatagramPacket receive() throws IOException
IOExceptionpublic void setSocket(DatagramSocket socket)
socket - the socket to set@Nullable protected DatagramSocket getTheSocket()
public DatagramSocket getSocket()
protected void setSocketAttributes(DatagramSocket socket) throws SocketException
socket - The socket.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 String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupport