com.hazelcast.cache.impl
Class CacheEventSet

java.lang.Object
  extended by com.hazelcast.cache.impl.CacheEventSet
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class CacheEventSet
extends Object
implements IdentifiedDataSerializable

Internal Set wrapper of CacheEventData items used during publishing and dispatching events.

Multiple event objects is required via iterator to handle cache events by CacheEntryListener. This implementation serves that purpose as a CacheEventData set.

See Also:
AbstractCacheService.publishEvent(String, CacheEventSet, int), AbstractCacheService.dispatchEvent(Object, CacheEventListener)

Constructor Summary
CacheEventSet()
           
CacheEventSet(CacheEventType eventType, int completionId)
           
CacheEventSet(CacheEventType eventType, Set<CacheEventData> events)
           
 
Method Summary
 void addEventData(CacheEventData cacheEventData)
          Helper method for adding multiple CacheEventData into this Set
 int getCompletionId()
           
 Set<CacheEventData> getEvents()
           
 CacheEventType getEventType()
           
 int getFactoryId()
          Returns DataSerializableFactory factory id for this class.
 int getId()
          Returns type identifier for this class.
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheEventSet

public CacheEventSet()

CacheEventSet

public CacheEventSet(CacheEventType eventType,
                     Set<CacheEventData> events)

CacheEventSet

public CacheEventSet(CacheEventType eventType,
                     int completionId)
Method Detail

getEvents

public Set<CacheEventData> getEvents()
Returns:
Set of CacheEventData

getEventType

public CacheEventType getEventType()
Returns:
Event type

getCompletionId

public int getCompletionId()
Returns:
completion id for sync listeners

addEventData

public void addEventData(CacheEventData cacheEventData)
Helper method for adding multiple CacheEventData into this Set

Parameters:
cacheEventData - event data representing a single event's data.
See Also:
CacheEventData

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Specified by:
getId in interface IdentifiedDataSerializable
Returns:
type id

getFactoryId

public int getFactoryId()
Description copied from interface: IdentifiedDataSerializable
Returns DataSerializableFactory factory id for this class.

Specified by:
getFactoryId in interface IdentifiedDataSerializable
Returns:
factory id


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.