Package de.hybris.platform.cluster.udp
Class UDPBroadcastMethod
- java.lang.Object
-
- de.hybris.platform.cluster.AbstractBroadcastMethod
-
- de.hybris.platform.cluster.udp.UDPBroadcastMethod
-
- All Implemented Interfaces:
BroadcastMethod
public class UDPBroadcastMethod extends AbstractBroadcastMethod
The UDP based broadcasting method.
-
-
Constructor Summary
Constructors Constructor Description UDPBroadcastMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UDPBroadcastMethodConfiguration
getConfiguration()
java.net.InetAddress
getInterfaceAddress()
java.net.InetAddress
getMulticastAddress()
int
getMulticastPort()
java.net.NetworkInterface
getNetworkInterfaceName()
java.util.Map<java.lang.String,java.lang.String>
getSettings()
Provides generic access to method specific settingsvoid
init(BroadcastService service)
Called once when the messaging method has been registeredprotected void
processDatagramPacket(java.net.DatagramPacket packet)
protected void
readConfig()
void
send(RawMessage message)
Sends the givenRawMessage
.protected void
sendPacket(java.net.DatagramPacket packet)
void
setConfiguration(UDPBroadcastMethodConfiguration cfg)
void
shutdown()
Called before system shutdownprotected void
start()
protected void
startServer()
protected java.net.MulticastSocket
startSocket()
-
Methods inherited from class de.hybris.platform.cluster.AbstractBroadcastMethod
getListeners, notifyMessgageReceived, registerProcessor, unregisterProcessor
-
-
-
-
Method Detail
-
getConfiguration
public UDPBroadcastMethodConfiguration getConfiguration()
-
setConfiguration
public void setConfiguration(UDPBroadcastMethodConfiguration cfg)
-
getMulticastAddress
public java.net.InetAddress getMulticastAddress()
-
getMulticastPort
public int getMulticastPort()
-
getInterfaceAddress
public java.net.InetAddress getInterfaceAddress()
-
getNetworkInterfaceName
public java.net.NetworkInterface getNetworkInterfaceName()
-
getSettings
public java.util.Map<java.lang.String,java.lang.String> getSettings()
Description copied from interface:BroadcastMethod
Provides generic access to method specific settings- Specified by:
getSettings
in interfaceBroadcastMethod
- Overrides:
getSettings
in classAbstractBroadcastMethod
-
init
public void init(BroadcastService service)
Description copied from interface:BroadcastMethod
Called once when the messaging method has been registered- Specified by:
init
in interfaceBroadcastMethod
- Overrides:
init
in classAbstractBroadcastMethod
-
send
public void send(RawMessage message)
Sends the givenRawMessage
. If this message exceed theUDPBroadcastMethodConfiguration.getPacketSize()
the message will be splitted up.- Parameters:
message
- the message to be send
-
shutdown
public void shutdown()
Description copied from interface:BroadcastMethod
Called before system shutdown- Specified by:
shutdown
in interfaceBroadcastMethod
- Overrides:
shutdown
in classAbstractBroadcastMethod
-
readConfig
protected void readConfig()
-
start
protected void start()
-
startServer
protected void startServer()
-
startSocket
protected java.net.MulticastSocket startSocket()
-
sendPacket
protected void sendPacket(java.net.DatagramPacket packet)
-
processDatagramPacket
protected void processDatagramPacket(java.net.DatagramPacket packet)
-
-