Package io.jmix.core.cluster
Class ClusterApplicationEventPublisher
java.lang.Object
io.jmix.core.cluster.ClusterApplicationEventPublisher
@Component("core_ClusterApplicationEventPublisher")
public class ClusterApplicationEventPublisher
extends Object
A component that allows to publish application events to application instances of a cluster
-
Field Summary
Modifier and TypeFieldDescriptionprotected ClusterApplicationEventChannelSupplier
protected org.springframework.context.ApplicationEventPublisher
-
Constructor Summary
ConstructorDescriptionClusterApplicationEventPublisher
(org.springframework.context.ApplicationEventPublisher applicationEventPublisher, ClusterApplicationEventChannelSupplier appEventChannelSupplier) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onAppEventMessage
(org.springframework.messaging.Message<?> message) void
onApplicationStarted
(org.springframework.boot.context.event.ApplicationStartedEvent event) void
publish
(ClusterApplicationEvent event) Publishes an event cluster-wide.
-
Field Details
-
applicationEventPublisher
protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher -
appEventChannelSupplier
-
-
Constructor Details
-
ClusterApplicationEventPublisher
public ClusterApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher, ClusterApplicationEventChannelSupplier appEventChannelSupplier)
-
-
Method Details
-
onApplicationStarted
@EventListener public void onApplicationStarted(org.springframework.boot.context.event.ApplicationStartedEvent event) -
onAppEventMessage
protected void onAppEventMessage(org.springframework.messaging.Message<?> message) -
publish
Publishes an event cluster-wide. Note that, in general case, publishing will be asynchronous. Also keep in mind the event will be published also in publishing app instance itself.- Parameters:
event
- an event to publish
-