MessageHandler that handles user registry broadcasts from other
application servers and periodically broadcasts the content of the local
user registry.
The aggregated information is maintained in a MultiServerUserRegistry.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final SimpMessagingTemplate | |
| private long | |
| private volatile ScheduledFuture | |
| private final TaskScheduler | |
| private final UserRegistryMessageHandler. | |
| private final MultiServerUserRegistry |
| Access | Constructor and Description |
|---|---|
| public | UserRegistryMessageHandler(MultiServerUserRegistry
the registry with local and remote user registry information userRegistry, SimpMessagingTemplate template for broadcasting local registry information brokerTemplate, String the destination to broadcast to broadcastDestination, TaskScheduler the task scheduler to use scheduler)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public String | getBroadcastDestination()
Return the configured destination for broadcasting UserRegistry information. |
| public long | |
| public void | handleMessage(Message<?>
the message to be handled message)Implements org. |
| public void | onApplicationEvent(BrokerAvailabilityEvent
the event to respond to event)Implements org. |
| public void | setRegistryExpirationPeriod(long
the expiration period in milliseconds milliseconds)Configure the amount of time (in milliseconds) before a remote user registry snapshot is considered expired. |
| broadcastDestination | back to summary |
|---|---|
| private final String broadcastDestination | |
| brokerTemplate | back to summary |
|---|---|
| private final SimpMessagingTemplate brokerTemplate | |
| registryExpirationPeriod | back to summary |
|---|---|
| private long registryExpirationPeriod | |
| scheduledFuture | back to summary |
|---|---|
| private volatile ScheduledFuture<?> scheduledFuture
| |
| scheduler | back to summary |
|---|---|
| private final TaskScheduler scheduler | |
| schedulerTask | back to summary |
|---|---|
| private final UserRegistryMessageHandler. | |
| userRegistry | back to summary |
|---|---|
| private final MultiServerUserRegistry userRegistry | |
| UserRegistryMessageHandler | back to summary |
|---|---|
| public UserRegistryMessageHandler(MultiServerUserRegistry userRegistry, SimpMessagingTemplate brokerTemplate, String broadcastDestination, TaskScheduler scheduler) Constructor.
| |
| getBroadcastDestination | back to summary |
|---|---|
| public String getBroadcastDestination() Return the configured destination for broadcasting UserRegistry information. | |
| getRegistryExpirationPeriod | back to summary |
|---|---|
| public long getRegistryExpirationPeriod() Return the configured registry expiration period. | |
| handleMessage | back to summary |
|---|---|
| public void handleMessage(Message<?> message) throws MessagingException Implements org. Doc from org. Handle the given message.
| |
| onApplicationEvent | back to summary |
|---|---|
| public void onApplicationEvent(BrokerAvailabilityEvent event) Implements org. Doc from org. Handle an application event.
| |
| setRegistryExpirationPeriod | back to summary |
|---|---|
| public void setRegistryExpirationPeriod(long milliseconds) Configure the amount of time (in milliseconds) before a remote user registry snapshot is considered expired. By default this is set to 20 seconds (value of 20000).
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| UserRegistryTask | back to summary |
|---|---|
| private UserRegistryTask() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |