public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolReceivingChannelAdapter
lifecycleCondition, lifecycleLock
EXPRESSION_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(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 |
setLookupHost(boolean lookupHost) |
void |
setSocket(DatagramSocket socket) |
protected void |
setSocketAttributes(DatagramSocket socket)
Sets timeout and receive buffer size
|
void |
setSoSendBufferSize(int soSendBufferSize) |
checkTaskExecutor, doStart, getLocalAddress, getReceiveBufferSize, getSoReceiveBufferSize, getSoTimeout, getTaskExecutor, isActive, isListening, setListening, setLocalAddress, setPoolSize, setReceiveBufferSize, setSoReceiveBufferSize, setSoTimeout, setTaskExecutor
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack
doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public UnicastReceivingChannelAdapter(int port)
port
- The port.public UnicastReceivingChannelAdapter(int port, boolean lengthCheck)
port
- The port.lengthCheck
- If true, enables the lengthCheck Option.public boolean isLongLived()
public int getPort()
getPort
in class AbstractInternetProtocolReceivingChannelAdapter
protected void onInit()
IntegrationObjectSupport
onInit
in class MessageProducerSupport
public void run()
protected void sendAck(Message<byte[]> message)
protected boolean asyncSendMessage(DatagramPacket packet)
protected void doSend(DatagramPacket packet)
protected DatagramPacket receive() throws Exception
Exception
public void setSocket(DatagramSocket socket)
socket
- the socket to setprotected DatagramSocket getTheSocket()
public DatagramSocket getSocket()
protected void setSocketAttributes(DatagramSocket socket) throws SocketException
socket
- The socket.SocketException
- Any socket exception.protected void doStop()
MessageProducerSupport
doStop
in class AbstractInternetProtocolReceivingChannelAdapter
public void setSoSendBufferSize(int soSendBufferSize)
soSendBufferSize
- The send buffer size.Socket.setSendBufferSize(int)
,
DatagramSocket.setSendBufferSize(int)
public void setLookupHost(boolean lookupHost)
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport