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 TypeMethodDescriptionvoidPerforms pre-publication checks (e.g. enforcing invariants).voidinit(WanReplicationConfig wanReplicationConfig, AbstractWanPublisherConfig publisherConfig) Initializes the publisher.voidpublishReplicationEvent(WanEvent<T> eventObject) Publish theeventObjectWAN replication event.voidpublishReplicationEventBackup(WanEvent<T> eventObject) Publish theeventObjectWAN replication event backup.default voidpublishRepublishedReplicationEvent(WanEvent<T> eventObject) Republishes theeventObjectWAN replication event.default voidpublishRepublishedReplicationEventBackup(WanEvent<T> eventObject) Republishes theeventObjectWAN replication backup event.default voidreset()Resets the publisher (e.g. before split-brain merge).voidshutdown()Closes the publisher and its internal connections and shuts down other internal states.
-
Method Details
-
init
Initializes the publisher.- Parameters:
wanReplicationConfig-WanReplicationConfiginstancepublisherConfig-AbstractWanPublisherConfiginstance
-
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 theeventObjectWAN replication event.- Parameters:
eventObject- the replication event
-
publishRepublishedReplicationEvent
Republishes theeventObjectWAN replication event. Only used for data structures which have republishing enabled.- Parameters:
eventObject- the replication event for republishing- Since:
- 5.4
-
publishReplicationEventBackup
Publish theeventObjectWAN replication event backup.- Parameters:
eventObject- the replication backup event
-
publishRepublishedReplicationEventBackup
Republishes theeventObjectWAN replication backup event. Only used for data structures which have republishing enabled.- Parameters:
eventObject- the replication backup event
-