Package org.somda.sdc.dpws.udp
Interface UdpMessageQueueService
- All Superinterfaces:
com.google.common.util.concurrent.Service,UdpMessageReceiverCallback
- All Known Implementing Classes:
UdpMessageQueueServiceImpl
public interface UdpMessageQueueService
extends com.google.common.util.concurrent.Service, UdpMessageReceiverCallback
Holds two message queues to send and receive UDP messages.
The UdpMessageQueueService instance will use the UDP binding set via
setUdpBinding(UdpBindingService).
- Use
sendMessage(UdpMessage)to send a UDP message. - In order to receive messages, add observers to the UdpMessageQueueService by using
registerUdpMessageQueueObserver(UdpMessageQueueObserver).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters an observer to receive incoming UDP messages.booleansendMessage(UdpMessage message) Queues an outgoing UDP message.voidsetUdpBinding(UdpBindingService udpBinding) Injects the UDP binding service.voidUnregisters an observer to stop receiving incoming UDP messages.Methods inherited from interface com.google.common.util.concurrent.Service
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, failureCause, isRunning, startAsync, state, stopAsyncMethods inherited from interface org.somda.sdc.dpws.udp.UdpMessageReceiverCallback
receive
-
Method Details
-
setUdpBinding
Injects the UDP binding service.Without a UDP binding service the message queue cannot send and receive messages. Make sure the UDP binding is injected before the service is started.
- Parameters:
udpBinding- the UDP binding service to inject.
-
sendMessage
Queues an outgoing UDP message.- Parameters:
message- the message to be send.- Returns:
- true if the message could be queued, otherwise false (queue overflow).
-
registerUdpMessageQueueObserver
Registers an observer to receive incoming UDP messages.- Parameters:
observer- the observer to register.
-
unregisterUdpMessageQueueObserver
Unregisters an observer to stop receiving incoming UDP messages.- Parameters:
observer- the observer to unregister.
-