Package com.hazelcast.wan
Interface WanConsumer
public interface WanConsumer
Interface to be implemented by custom WAN event consumers. Wan replication
consumers are typically used in conjunction with a custom
WanPublisher
. The publisher will then publish events
in a custom fashion which the consumer expects and processes accordingly.
This way, you can provide custom publication and consumption mechanisms
and protocols for WAN replication. The default implementation of the WAN
publisher ignores any configured custom consumers and the WAN events will
be processed as if there was no custom consumer implementation.
Can be registered by programmatically or by XML using WanConsumerConfig
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
init
(String wanReplicationName, WanConsumerConfig config) Initialize the WAN consumer.void
shutdown()
Callback method to shutdown the WAN replication consumer.
-
Method Details
-
init
Initialize the WAN consumer. The method is invoked once the node has started. The WAN consumer is responsible for registering itself for WAN event consumption. Typically this means that you would either use theExecutionService
to schedule the consumer to run periodically or continually by having an implementation which uses blocking or spinning locks to check for new events. The implementation is free however to choose another approach.- Parameters:
wanReplicationName
- the name of theWanReplicationConfig
config
- the WAN consumer config
-
shutdown
void shutdown()Callback method to shutdown the WAN replication consumer. This is called on node shutdown.
-