org.teleal.cling.transport.impl
Class MulticastReceiverImpl
java.lang.Object
org.teleal.cling.transport.impl.MulticastReceiverImpl
- All Implemented Interfaces:
- Runnable, MulticastReceiver<MulticastReceiverConfigurationImpl>
public class MulticastReceiverImpl
- extends Object
- implements MulticastReceiver<MulticastReceiverConfigurationImpl>
Default implementation based on a UDP MulticastSocket
.
Thread-safety is guaranteed through synchronization of methods of this service and
by the thread-safe underlying socket.
- Author:
- Christian Bauer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
configuration
protected final MulticastReceiverConfigurationImpl configuration
router
protected Router router
datagramProcessor
protected DatagramProcessor datagramProcessor
multicastInterface
protected NetworkInterface multicastInterface
multicastAddress
protected InetSocketAddress multicastAddress
MulticastReceiverImpl
public MulticastReceiverImpl(MulticastReceiverConfigurationImpl configuration)
getConfiguration
public MulticastReceiverConfigurationImpl getConfiguration()
- Specified by:
getConfiguration
in interface MulticastReceiver<MulticastReceiverConfigurationImpl>
- Returns:
- This service's configuration.
init
public void init(NetworkInterface networkInterface,
Router router,
DatagramProcessor datagramProcessor)
throws InitializationException
- Description copied from interface:
MulticastReceiver
- Configures the service and starts any listening sockets.
- Specified by:
init
in interface MulticastReceiver<MulticastReceiverConfigurationImpl>
- Parameters:
networkInterface
- The network interface on which to join the multicast group on.router
- The router which handles received IncomingDatagramMessage
s.datagramProcessor
- Reads and writes datagrams.
- Throws:
InitializationException
- If the service could not be initialized or started.
stop
public void stop()
- Description copied from interface:
MulticastReceiver
- Stops the service, closes any listening sockets.
- Specified by:
stop
in interface MulticastReceiver<MulticastReceiverConfigurationImpl>
run
public void run()
- Specified by:
run
in interface Runnable
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.