GemFire 6.5

com.gemstone.gemfire.cache
Interface CacheEvent<K,V>

All Known Subinterfaces:
EntryEvent<K,V>, RegionEvent<K,V>, RoleEvent<K,V>

public interface CacheEvent<K,V>

A region- or entry-related event affecting the cache.

Prior to release 6.0 the NOT_AVAILABLE constant was used to indicate an object value was not available. However in 6.0 generic typing was added to Region and since this constant's type will not be an instance of the generic type V returning it would cause a ClassCastException. So in 6.0 and later null is now used in place of NOT_AVAILABLE.

Since:
2.0
See Also:
CacheListener

Method Summary
 Object getCallbackArgument()
          Returns the callbackArgument passed to the method that generated this event.
 DistributedMember getDistributedMember()
          Returns the DistributedMember that this event originated in.
 Operation getOperation()
          Return a description of the operation that triggered this event.
 Region<K,V> getRegion()
          Returns the region to which this cached object belongs or the region that raised this event for RegionEvents.
 boolean isCallbackArgumentAvailable()
          Returns true if the callback argument is "available".
 boolean isDistributed()
          Deprecated. as of GemFire 5.0, use Operation.isDistributed() instead.
 boolean isExpiration()
          Deprecated. as of GemFire 5.0, use Operation.isExpiration() instead.
 boolean isOriginRemote()
          Answer true if this event originated in a cache other than this one.
 

Method Detail

getRegion

Region<K,V> getRegion()
Returns the region to which this cached object belongs or the region that raised this event for RegionEvents.

Returns:
the region associated with this object or the region that raised this event.

getOperation

Operation getOperation()
Return a description of the operation that triggered this event.

Returns:
the operation that triggered this event.
Since:
5.0

getCallbackArgument

Object getCallbackArgument()
Returns the callbackArgument passed to the method that generated this event. Provided primarily in case this object or region has already been destroyed. See the Region interface methods that take a callbackArgument parameter.

Returns:
the callbackArgument associated with this event. null is returned if the callback argument is not propagated to the event. This happens for events given to TransactionListener and to CacheListener on the remote side of a transaction commit.

isCallbackArgumentAvailable

boolean isCallbackArgumentAvailable()
Returns true if the callback argument is "available". Not available means that the callback argument may have existed but it could not be obtained. Note that getCallbackArgument() will return null when this method returns false.

Since:
6.0

isOriginRemote

boolean isOriginRemote()
Answer true if this event originated in a cache other than this one. Answer false if this event originated in this cache.

Returns:
true if this event originated remotely

getDistributedMember

DistributedMember getDistributedMember()
Returns the DistributedMember that this event originated in.

Returns:
the member that performed the operation that originated this event.
Since:
5.0

isExpiration

@Deprecated
boolean isExpiration()
Deprecated. as of GemFire 5.0, use Operation.isExpiration() instead.

Answer true if this event resulted from expiration.

Returns:
true if this event resulted from expiration

isDistributed

@Deprecated
boolean isDistributed()
Deprecated. as of GemFire 5.0, use Operation.isDistributed() instead.

Answers true if this event resulted from a distributed operation; false if a local operation. This is useful to distinguish between invalidate and localInvalidate, and destroy and localDestroy.

Returns:
true if this event resulted from a distributed operation

GemFire 6.5

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.