Package com.hazelcast.wan
Interface WanPublisher<T>
- Type Parameters:
T
- type of event data that the publisher will publish
public interface WanPublisher<T>
This interface offers the implementation of different kinds of replication
techniques like TCP, UDP or maybe even an JMS based service.
Implementations of this interface represent a replication target,
normally another Hazelcast cluster only reachable over a Wide Area
Network (WAN).
The publisher may implement
HazelcastInstanceAware
if it needs a reference to the instance on which it is being run.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs pre-publication checks (e.g. enforcing invariants).void
init
(WanReplicationConfig wanReplicationConfig, AbstractWanPublisherConfig publisherConfig) Initializes the publisher.void
publishReplicationEvent
(WanEvent<T> eventObject) Publish theeventObject
WAN replication event.void
publishReplicationEventBackup
(WanEvent<T> eventObject) Publish theeventObject
WAN replication event backup.default void
publishRepublishedReplicationEvent
(WanEvent<T> eventObject) Republishes theeventObject
WAN replication event.default void
publishRepublishedReplicationEventBackup
(WanEvent<T> eventObject) Republishes theeventObject
WAN replication backup event.default void
reset()
Resets the publisher (e.g. before split-brain merge).void
shutdown()
Closes the publisher and its internal connections and shuts down other internal states.
-
Method Details
-
init
Initializes the publisher.- Parameters:
wanReplicationConfig
-WanReplicationConfig
instancepublisherConfig
-AbstractWanPublisherConfig
instance
-
shutdown
void shutdown()Closes the publisher and its internal connections and shuts down other internal states. Signals the publisher to shut down and clean up its resources. The method does not necessarily block until the publisher has shut down. -
reset
default void reset()Resets the publisher (e.g. before split-brain merge). -
doPrepublicationChecks
void doPrepublicationChecks()Performs pre-publication checks (e.g. enforcing invariants). Invoked beforepublishReplicationEvent(WanEvent)
andpublishReplicationEventBackup(WanEvent)
. -
publishReplicationEvent
Publish theeventObject
WAN replication event.- Parameters:
eventObject
- the replication event
-
publishRepublishedReplicationEvent
Republishes theeventObject
WAN replication event. Only used for data structures which have republishing enabled.- Parameters:
eventObject
- the replication event for republishing- Since:
- 5.4
-
publishReplicationEventBackup
Publish theeventObject
WAN replication event backup.- Parameters:
eventObject
- the replication backup event
-
publishRepublishedReplicationEventBackup
Republishes theeventObject
WAN replication backup event. Only used for data structures which have republishing enabled.- Parameters:
eventObject
- the replication backup event
-