public class DefaultBroadcastService extends java.lang.Object implements BroadcastService
| Modifier and Type | Class and Description |
|---|---|
protected class |
DefaultBroadcastService.MethodBroadcastListener
Inner class to connect this service to all broadcast methods.
|
protected static class |
DefaultBroadcastService.MethodWrapper |
| Modifier and Type | Field and Description |
|---|---|
static int |
CUR_VERSION
stores the current platform version encoded as integer currently: 4.1.1.0
|
| Constructor and Description |
|---|
DefaultBroadcastService(BroadcastServiceConfiguration cfg) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(RawMessage message)
Determines whether or not a specific message is being accepted.
|
void |
addTransportData(RawMessage message) |
protected java.util.concurrent.ExecutorService |
createMessageSendingExecutorService() |
protected DefaultBroadcastService.MethodWrapper |
createMethod(java.lang.String name,
java.lang.Class clazz) |
void |
destroy() |
BroadcastMethod |
getBroadcastMethod(java.lang.String name)
TODO apidoc
|
java.util.Set<java.lang.String> |
getBroadcastMethodNames()
TODO apidoc
|
long |
getClusterIslandPK() |
int |
getClusterNodeID() |
long |
getDynamicClusterNodeID()
TODO apidoc
|
static DefaultBroadcastService |
getInstance() |
protected java.util.concurrent.ExecutorService |
getMessageSendingExecutorService() |
protected java.util.List<DefaultBroadcastService.MethodWrapper> |
getMethods() |
protected java.lang.String |
getStartupInfo() |
void |
initMethods() |
boolean |
isClusteringEnabled() |
protected boolean |
isDuplicateMessage(RawMessage message) |
protected boolean |
isLocal(RawMessage message) |
protected java.util.List<DefaultBroadcastService.MethodWrapper> |
loadConfiguredMethods() |
protected java.util.List<DefaultBroadcastService.MethodWrapper> |
loadLoopbackMethods() |
protected java.util.List<DefaultBroadcastService.MethodWrapper> |
loadMethods() |
protected void |
processMessageFromMethod(RawMessage message,
java.lang.String methodName) |
void |
registerBroadcastListener(BroadcastMessageListener listener,
boolean remoteMessagesOnly)
TODO apidoc
|
void |
send(RawMessage message)
TODO apidoc
|
protected void |
sendAsnychronously(DefaultBroadcastService.MethodWrapper methodWrapper,
RawMessage message,
Tenant currentTenant,
java.util.concurrent.ExecutorService executorService)
Sends a message using a executor service.
|
protected void |
sendSynchronously(DefaultBroadcastService.MethodWrapper methodWrapper,
RawMessage message)
Sends a message synchronously.
|
protected void |
startPingHandler() |
void |
unregisterBroadcastListener(BroadcastMessageListener listener)
TODO apidoc
|
protected void |
updateNodeIDsFromDatabase()
Should be called after system initialization since node IDs may have changed!
|
public static final int CUR_VERSION
public DefaultBroadcastService(BroadcastServiceConfiguration cfg)
public static DefaultBroadcastService getInstance()
protected java.lang.String getStartupInfo()
protected void updateNodeIDsFromDatabase()
protected java.util.concurrent.ExecutorService createMessageSendingExecutorService()
protected java.util.concurrent.ExecutorService getMessageSendingExecutorService()
public long getDynamicClusterNodeID()
BroadcastServicegetDynamicClusterNodeID in interface BroadcastServicepublic java.util.Set<java.lang.String> getBroadcastMethodNames()
BroadcastServicegetBroadcastMethodNames in interface BroadcastServicepublic BroadcastMethod getBroadcastMethod(java.lang.String name)
BroadcastServicegetBroadcastMethod in interface BroadcastServiceprotected java.util.List<DefaultBroadcastService.MethodWrapper> getMethods()
public void initMethods()
protected void startPingHandler()
protected java.util.List<DefaultBroadcastService.MethodWrapper> loadMethods()
protected java.util.List<DefaultBroadcastService.MethodWrapper> loadLoopbackMethods()
protected java.util.List<DefaultBroadcastService.MethodWrapper> loadConfiguredMethods()
protected DefaultBroadcastService.MethodWrapper createMethod(java.lang.String name, java.lang.Class clazz)
public void registerBroadcastListener(BroadcastMessageListener listener, boolean remoteMessagesOnly)
BroadcastServiceregisterBroadcastListener in interface BroadcastServicepublic void unregisterBroadcastListener(BroadcastMessageListener listener)
BroadcastServiceunregisterBroadcastListener in interface BroadcastServicepublic long getClusterIslandPK()
public int getClusterNodeID()
public boolean isClusteringEnabled()
public void addTransportData(RawMessage message)
public void send(RawMessage message)
BroadcastServicesend in interface BroadcastServiceprotected void sendSynchronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message)
methodWrapper - the method wrappermessage - the message to sendprotected void sendAsnychronously(DefaultBroadcastService.MethodWrapper methodWrapper, RawMessage message, Tenant currentTenant, java.util.concurrent.ExecutorService executorService) throws java.util.concurrent.RejectedExecutionException
methodWrapper - the method wrappermessage - the messagecurrentTenant - the current tenant to be used when sendingexecutorService - the executor servicejava.util.concurrent.RejectedExecutionExceptionpublic boolean accept(RawMessage message)
Currently only message from other cluster nodes (determined by their dynamic node ID) and the same cluster island PK are accepted.
accept in interface BroadcastServicemessage - the message to checkprotected boolean isDuplicateMessage(RawMessage message)
protected boolean isLocal(RawMessage message)
protected void processMessageFromMethod(RawMessage message, java.lang.String methodName)
public void destroy()
Copyright © 2018 SAP SE. All Rights Reserved.