org.infinispan.notifications.cachelistener.event
Class EventImpl

java.lang.Object
  extended by org.infinispan.notifications.cachelistener.event.EventImpl
All Implemented Interfaces:
CacheEntryActivatedEvent, CacheEntryCreatedEvent, CacheEntryEvent, CacheEntryEvictedEvent, CacheEntryInvalidatedEvent, CacheEntryLoadedEvent, CacheEntryModifiedEvent, CacheEntryPassivatedEvent, CacheEntryRemovedEvent, CacheEntryVisitedEvent, Event, TransactionalEvent, TransactionCompletedEvent, TransactionRegisteredEvent

public class EventImpl
extends Object
implements CacheEntryActivatedEvent, CacheEntryCreatedEvent, CacheEntryEvictedEvent, CacheEntryLoadedEvent, CacheEntryModifiedEvent, CacheEntryPassivatedEvent, CacheEntryRemovedEvent, CacheEntryVisitedEvent, TransactionCompletedEvent, TransactionRegisteredEvent, CacheEntryInvalidatedEvent

Basic implementation of an event that covers all event types.

Since:
4.0
Author:
Manik Surtani

Constructor Summary
EventImpl()
           
 
Method Summary
 boolean equals(Object o)
           
 Cache getCache()
           
 GlobalTransaction getGlobalTransaction()
           
 Object getKey()
           
 Event.Type getType()
           
 Object getValue()
           
 int hashCode()
           
 boolean isOriginLocal()
           
 boolean isPre()
           
 boolean isTransactionSuccessful()
           
 void setCache(Cache cache)
           
 void setKey(Object key)
           
 void setOriginLocal(boolean originLocal)
           
 void setPre(boolean pre)
           
 void setTransactionId(GlobalTransaction transaction)
           
 void setTransactionSuccessful(boolean transactionSuccessful)
           
 void setType(Event.Type type)
           
 void setValue(Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventImpl

public EventImpl()
Method Detail

getType

public Event.Type getType()
Specified by:
getType in interface Event
Returns:
the type of event represented by this instance.

isPre

public boolean isPre()
Specified by:
isPre in interface Event
Returns:
true if the notification is before the event has occured, false if after the event has occured.

getCache

public Cache getCache()
Specified by:
getCache in interface Event
Returns:
a handle to the cache instance that generated this notification.

getKey

public Object getKey()
Specified by:
getKey in interface CacheEntryEvent
Returns:
the key to the affected cache entry.

getGlobalTransaction

public GlobalTransaction getGlobalTransaction()
Specified by:
getGlobalTransaction in interface TransactionalEvent
Returns:
the Transaction associated with the current call. May be null if the current call is outside the scope of a transaction.

isOriginLocal

public boolean isOriginLocal()
Specified by:
isOriginLocal in interface TransactionalEvent
Returns:
true if the call originated on the local cache instance; false if originated from a remote one.

isTransactionSuccessful

public boolean isTransactionSuccessful()
Specified by:
isTransactionSuccessful in interface TransactionCompletedEvent
Returns:
if true, the transaction completed by committing successfully. If false, the transaction completed with a rollback.

setPre

public void setPre(boolean pre)

setCache

public void setCache(Cache cache)

setKey

public void setKey(Object key)

setTransactionId

public void setTransactionId(GlobalTransaction transaction)

setOriginLocal

public void setOriginLocal(boolean originLocal)

setTransactionSuccessful

public void setTransactionSuccessful(boolean transactionSuccessful)

setType

public void setType(Event.Type type)

getValue

public Object getValue()
Specified by:
getValue in interface CacheEntryModifiedEvent
Specified by:
getValue in interface CacheEntryRemovedEvent

setValue

public void setValue(Object value)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Google Analytics

Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.