Package de.hybris.platform.cluster
Class DefaultBroadcastService
java.lang.Object
de.hybris.platform.cluster.DefaultBroadcastService
- All Implemented Interfaces:
BroadcastService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classInner class to connect this service to all broadcast methods.protected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstores the current platform version encoded as integer currently: 4.1.1.0 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(RawMessage message) Determines whether or not a specific message is being accepted.voidaddTransportData(RawMessage message) protected ExecutorServiceprotected DefaultBroadcastService.MethodWrappercreateMethod(String name, Class clazz) voiddestroy()getBroadcastMethod(String name) TODO apidocTODO apidoclongintlongTODO apidocstatic DefaultBroadcastServiceprotected ExecutorServiceprotected List<DefaultBroadcastService.MethodWrapper>protected Stringvoidbooleanprotected booleanisDuplicateMessage(RawMessage message) protected booleanisLocal(RawMessage message) protected List<DefaultBroadcastService.MethodWrapper>protected List<DefaultBroadcastService.MethodWrapper>protected List<DefaultBroadcastService.MethodWrapper>protected voidprocessMessageFromMethod(RawMessage message, String methodName) voidregisterBroadcastListener(BroadcastMessageListener listener, boolean remoteMessagesOnly) TODO apidocvoidsend(RawMessage message) TODO apidocprotected voidsendAsnychronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message, Tenant currentTenant, ExecutorService executorService) Sends a message using a executor service.protected voidsendSynchronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message) Sends a message synchronously.protected voidvoidTODO apidocprotected voidShould be called after system initialization since node IDs may have changed!
-
Field Details
-
CUR_VERSION
public static final int CUR_VERSIONstores the current platform version encoded as integer currently: 4.1.1.0- See Also:
-
-
Constructor Details
-
DefaultBroadcastService
-
-
Method Details
-
getInstance
-
getStartupInfo
-
updateNodeIDsFromDatabase
protected void updateNodeIDsFromDatabase()Should be called after system initialization since node IDs may have changed! -
createMessageSendingExecutorService
-
getMessageSendingExecutorService
-
getDynamicClusterNodeID
public long getDynamicClusterNodeID()Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
getDynamicClusterNodeIDin interfaceBroadcastService- Returns:
- the dynamic cluster node id
-
getBroadcastMethodNames
Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
getBroadcastMethodNamesin interfaceBroadcastService- Returns:
- Set
-
getBroadcastMethod
Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
getBroadcastMethodin interfaceBroadcastService- Returns:
- BroadcastMethod
-
getMethods
-
initMethods
public void initMethods() -
startPingHandler
protected void startPingHandler() -
loadMethods
-
loadLoopbackMethods
-
loadConfiguredMethods
-
createMethod
-
registerBroadcastListener
public void registerBroadcastListener(BroadcastMessageListener listener, boolean remoteMessagesOnly) Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
registerBroadcastListenerin interfaceBroadcastService
-
unregisterBroadcastListener
Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
unregisterBroadcastListenerin interfaceBroadcastService
-
getClusterIslandPK
public long getClusterIslandPK() -
getClusterNodeID
public int getClusterNodeID() -
isClusteringEnabled
public boolean isClusteringEnabled() -
addTransportData
-
send
Description copied from interface:BroadcastServiceTODO apidoc- Specified by:
sendin interfaceBroadcastService
-
sendSynchronously
protected void sendSynchronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message) Sends a message synchronously.- Parameters:
methodWrapper- the method wrappermessage- the message to send
-
sendAsnychronously
protected void sendAsnychronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message, Tenant currentTenant, ExecutorService executorService) throws RejectedExecutionException Sends a message using a executor service. In case the service is rejecting the message this method blocks and tries to send the message again until the configured wait timeout has been reached.- Parameters:
methodWrapper- the method wrappermessage- the messagecurrentTenant- the current tenant to be used when sendingexecutorService- the executor service- Throws:
RejectedExecutionException
-
accept
Determines whether or not a specific message is being accepted.Currently only message from other cluster nodes (determined by their dynamic node ID) and the same cluster island PK are accepted.
- Specified by:
acceptin interfaceBroadcastService- Parameters:
message- the message to check- Returns:
- true if the message is being accepted
-
isDuplicateMessage
-
isLocal
-
processMessageFromMethod
-
destroy
public void destroy()
-