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 UDPBroadcastMethodConfigurationgetConfiguration()java.net.InetAddressgetInterfaceAddress()java.net.InetAddressgetMulticastAddress()intgetMulticastPort()java.net.NetworkInterfacegetNetworkInterfaceName()java.util.Map<java.lang.String,java.lang.String>getSettings()Provides generic access to method specific settingsvoidinit(BroadcastService service)Called once when the messaging method has been registeredprotected voidprocessDatagramPacket(java.net.DatagramPacket packet)protected voidreadConfig()voidsend(RawMessage message)Sends the givenRawMessage.protected voidsendPacket(java.net.DatagramPacket packet)voidsetConfiguration(UDPBroadcastMethodConfiguration cfg)voidshutdown()Called before system shutdownprotected voidstart()protected voidstartServer()protected java.net.MulticastSocketstartSocket()-
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:BroadcastMethodProvides generic access to method specific settings- Specified by:
getSettingsin interfaceBroadcastMethod- Overrides:
getSettingsin classAbstractBroadcastMethod
-
init
public void init(BroadcastService service)
Description copied from interface:BroadcastMethodCalled once when the messaging method has been registered- Specified by:
initin interfaceBroadcastMethod- Overrides:
initin 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:BroadcastMethodCalled before system shutdown- Specified by:
shutdownin interfaceBroadcastMethod- Overrides:
shutdownin 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)
-
-