public abstract class AbstractMessageRouter extends Object implements MessageRouter, MulticastReceiverRegistrar, ShutdownListener
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractMessageRouter.ProxyInformation |
| Modifier and Type | Field and Description |
|---|---|
protected MulticastReceiverRegistry |
multicastReceiverRegistry |
protected RoutingTable |
routingTable |
SCHEDULEDTHREADPOOL| Constructor and Description |
|---|
AbstractMessageRouter(RoutingTable routingTable,
ScheduledExecutorService scheduler,
long sendMsgRetryIntervalMs,
int maxParallelSends,
long routingTableCleanupIntervalMs,
MessagingStubFactory messagingStubFactory,
MessagingSkeletonFactory messagingSkeletonFactory,
AddressManager addressManager,
MulticastReceiverRegistry multicastReceiverRegistry,
MessageQueue messageQueue,
ShutdownNotifier shutdownNotifier) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMulticastReceiver(String multicastId,
String subscriberParticipantId,
String providerParticipantId) |
void |
addNextHop(String participantId,
Address address,
boolean isGloballyVisible) |
void |
addToRoutingTable(String participantId,
Address address,
boolean isGloballyVisible,
long expiryDateMs) |
protected ImmutableMessage |
createReplyMessageWithError(ImmutableMessage requestMessage,
JoynrRuntimeException error) |
protected void |
finalizeMessageProcessing(ImmutableMessage message,
boolean isMessageRoutingsuccessful) |
protected Set<String> |
getRecipients(ImmutableMessage message) |
void |
prepareForShutdown()
This method is called just before the system shuts down in order to give components a chance to finish
essential operations before the actual
ShutdownListener.shutdown() is performed. |
void |
registerMessageProcessedListener(MessageProcessedListener messageProcessedListener) |
void |
registerProxy(Object proxy,
String proxyParticipantId,
ShutdownListener shutdownListener) |
void |
registerProxyProviderParticipantIds(String proxyParticipantId,
Set<String> providerParticipantIds) |
void |
removeMulticastReceiver(String multicastId,
String subscriberParticipantId,
String providerParticipantId) |
void |
removeNextHop(String participantId) |
boolean |
resolveNextHop(String participantId) |
void |
route(ImmutableMessage message) |
void |
shutdown() |
void |
unregisterMessageProcessedListener(MessageProcessedListener messageProcessedListener) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetToKnownprotected final RoutingTable routingTable
protected final MulticastReceiverRegistry multicastReceiverRegistry
@Inject @Singleton public AbstractMessageRouter(RoutingTable routingTable, ScheduledExecutorService scheduler, long sendMsgRetryIntervalMs, int maxParallelSends, long routingTableCleanupIntervalMs, MessagingStubFactory messagingStubFactory, MessagingSkeletonFactory messagingSkeletonFactory, AddressManager addressManager, MulticastReceiverRegistry multicastReceiverRegistry, MessageQueue messageQueue, ShutdownNotifier shutdownNotifier)
public void registerMessageProcessedListener(MessageProcessedListener messageProcessedListener)
registerMessageProcessedListener in interface MessageRouterpublic void unregisterMessageProcessedListener(MessageProcessedListener messageProcessedListener)
unregisterMessageProcessedListener in interface MessageRouterpublic void removeNextHop(String participantId)
removeNextHop in interface MessageRouterpublic boolean resolveNextHop(String participantId)
resolveNextHop in interface MessageRouterpublic void addMulticastReceiver(String multicastId, String subscriberParticipantId, String providerParticipantId)
addMulticastReceiver in interface MulticastReceiverRegistrarpublic void removeMulticastReceiver(String multicastId, String subscriberParticipantId, String providerParticipantId)
removeMulticastReceiver in interface MulticastReceiverRegistrarpublic void addNextHop(String participantId, Address address, boolean isGloballyVisible)
addNextHop in interface MessageRouterpublic void addToRoutingTable(String participantId, Address address, boolean isGloballyVisible, long expiryDateMs)
addToRoutingTable in interface MessageRouterpublic void route(ImmutableMessage message)
route in interface MessageRouterprotected Set<String> getRecipients(ImmutableMessage message)
protected ImmutableMessage createReplyMessageWithError(ImmutableMessage requestMessage, JoynrRuntimeException error)
protected void finalizeMessageProcessing(ImmutableMessage message, boolean isMessageRoutingsuccessful)
public void prepareForShutdown()
ShutdownListenerShutdownListener.shutdown() is performed. Implementations should block until
they're finished, but should also make sure to timeout after a few seconds if they can't finish quickly.prepareForShutdown in interface ShutdownListenerpublic void shutdown()
shutdown in interface MessageRoutershutdown in interface ShutdownListenerpublic void registerProxy(Object proxy, String proxyParticipantId, ShutdownListener shutdownListener)
registerProxy in interface MessageRouterpublic void registerProxyProviderParticipantIds(String proxyParticipantId, Set<String> providerParticipantIds)
registerProxyProviderParticipantIds in interface MessageRouterCopyright © 2021. All rights reserved.