Package de.hybris.platform.cluster.udp
Class UnicastBroadcastMethod
- java.lang.Object
-
- de.hybris.platform.cluster.AbstractBroadcastMethod
-
- de.hybris.platform.cluster.udp.UnicastBroadcastMethod
-
- All Implemented Interfaces:
BroadcastMethod
public class UnicastBroadcastMethod extends AbstractBroadcastMethod
The Unicast UDP based broadcasting method.
-
-
Field Summary
Fields Modifier and Type Field Description static intKIND_NODES
-
Constructor Summary
Constructors Constructor Description UnicastBroadcastMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(RawMessage msg)java.util.Collection<java.net.InetSocketAddress>getClusterNodes()protected ConfigIntfgetConfig()UnicastBroadcastMethodConfigurationgetConfiguration()java.net.InetSocketAddressgetServerAddress()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 booleanisOwnAddress(java.net.InetSocketAddress nodeAddress)booleanisSyncNodesEnabled()protected voidnotifyMessgageReceived(RawMessage message)protected voidprocessDatagramPacket(java.net.DatagramPacket packet)protected voidreadConfig()protected voidregisterConfigChangeListener()protected voidremoveConfigChangeListener()protected java.net.InetSocketAddressresolveAddress(java.net.InetSocketAddress unresolvedAddress)protected java.util.Set<java.net.InetSocketAddress>resolveAddresses(java.util.Collection<java.net.InetSocketAddress> unresolvedAddresses)voidsend(RawMessage message)Sends the givenRawMessage.protected voidsendPacket(java.net.DatagramPacket packet)voidsetConfiguration(UnicastBroadcastMethodConfiguration cfg)voidshutdown()Called before system shutdownprotected voidstart()protected voidstartServer()protected java.net.DatagramSocketstartSocket()-
Methods inherited from class de.hybris.platform.cluster.AbstractBroadcastMethod
getListeners, registerProcessor, unregisterProcessor
-
-
-
-
Field Detail
-
KIND_NODES
public static final int KIND_NODES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfiguration
public UnicastBroadcastMethodConfiguration getConfiguration()
-
setConfiguration
public void setConfiguration(UnicastBroadcastMethodConfiguration cfg)
-
getServerAddress
public java.net.InetSocketAddress getServerAddress()
-
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
-
getConfig
protected ConfigIntf getConfig()
-
registerConfigChangeListener
protected void registerConfigChangeListener()
-
removeConfigChangeListener
protected void removeConfigChangeListener()
-
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
-
isSyncNodesEnabled
public boolean isSyncNodesEnabled()
-
getClusterNodes
public java.util.Collection<java.net.InetSocketAddress> getClusterNodes()
-
isOwnAddress
protected boolean isOwnAddress(java.net.InetSocketAddress nodeAddress)
-
shutdown
public void shutdown()
Description copied from interface:BroadcastMethodCalled before system shutdown- Specified by:
shutdownin interfaceBroadcastMethod- Overrides:
shutdownin classAbstractBroadcastMethod
-
readConfig
protected void readConfig()
-
resolveAddresses
protected java.util.Set<java.net.InetSocketAddress> resolveAddresses(java.util.Collection<java.net.InetSocketAddress> unresolvedAddresses)
-
resolveAddress
protected java.net.InetSocketAddress resolveAddress(java.net.InetSocketAddress unresolvedAddress)
-
start
protected void start()
-
startServer
protected void startServer()
-
startSocket
protected java.net.DatagramSocket startSocket()
-
sendPacket
protected void sendPacket(java.net.DatagramPacket packet)
-
notifyMessgageReceived
protected void notifyMessgageReceived(RawMessage message)
- Overrides:
notifyMessgageReceivedin classAbstractBroadcastMethod
-
accept
protected boolean accept(RawMessage msg)
-
processDatagramPacket
protected void processDatagramPacket(java.net.DatagramPacket packet)
-
-