Book Image

Getting Started with Hazelcast, Second Edition

By : Matthew Johns
Book Image

Getting Started with Hazelcast, Second Edition

By: Matthew Johns

Overview of this book

Table of Contents (19 chapters)
Getting Started with Hazelcast Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Listening to the goings-on


One great feature of Hazelcast is its ability to notify us of the goings-on of our persisted data and the cluster as a whole, allowing us to register an interest in events. The listener concept is borrowed from Java. So, you should feel pretty familiar with it. To provide this, there are a number of listener interfaces that we can implement to receive, process, and handle different types of events—one of which we previously encountered. The following are the listener interfaces:

  • Collection listeners:

    • EntryListener is used for map-based (IMap and MultiMap) events

    • ItemListener is used for flat collection-based (IList, ISet, and IQueue) events

    • MessageListener is used to receive topic events, but as we've seen before, it is used as a part of the standard operation of topics

    • QuorumListener is used for quorum state change events

  • Cluster listeners:

    • DistributedObjectListener is used for the collection, creation, and destruction of events

    • MembershipListener is used for cluster...