Expresso 5-5-0

com.jcorporate.expresso.core.misc
Class CacheEvent

java.lang.Object
  extended bycom.jcorporate.expresso.core.misc.CacheEvent

public class CacheEvent
extends Object

CacheEvent represents an event that indicates that some cached information might have to be updated. Objects that implement caches that depend on persistant data should implement CacheEventListener, and register themselves with the appropriate objects that store the data they cache - they will then be notified via a cacheEvent(CacheEvent) call when changes to the data occurr, so they can take the appropriate action to ensure their caches are not 'stale'.

Version:
$Revision: 1.6 $ $Date: 2003/06/03 06:12:15 $
Author:
Michael Nash

Constructor Summary
CacheEvent()
           
CacheEvent(String newEventOriginator, String newEventCode)
          Convenience constructor to create a CacheEvent with the originator and event code immediately specified
CacheEvent(String newEventOriginator, String newEventCode, Cacheable newEventObject)
          Convenience constructor to create a CacheEvent with the originator, event code and originating object immediately specified
 
Method Summary
 String getCode()
          Get the "event code" passed to this event - the exact meaning of the code is dependant on the object generating the event.
 String getConfigKey()
          Get the config key passed to this event, or return "default" if none specified
 Cacheable getObject()
          Get the object reference to the object that generated the event
 String getOriginator()
          Return the name of the class originating this event
 void setCode(String newEventCode)
          Set the event code for this event - meaning depends on the originating object
 void setConfigKey(String newConfigKey)
           
 void setObject(Cacheable newObject)
          Set the originating object reference for this event
 void setOriginator(String newEventOriginator)
          Set the class name of the event originator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheEvent

public CacheEvent()

CacheEvent

public CacheEvent(String newEventOriginator,
                  String newEventCode)
Convenience constructor to create a CacheEvent with the originator and event code immediately specified

Parameters:
newEventOriginator -
newEventCode -

CacheEvent

public CacheEvent(String newEventOriginator,
                  String newEventCode,
                  Cacheable newEventObject)
Convenience constructor to create a CacheEvent with the originator, event code and originating object immediately specified

Parameters:
newEventOriginator -
newEventCode -
newEventObject -
Method Detail

getCode

public String getCode()
Get the "event code" passed to this event - the exact meaning of the code is dependant on the object generating the event.

Returns:
The event code specifying what kind of event has occurred. The exact meaning depends on the originating object.

getConfigKey

public String getConfigKey()
Get the config key passed to this event, or return "default" if none specified

Returns:

getObject

public Cacheable getObject()
Get the object reference to the object that generated the event

Returns:
The object reference to the Object that triggered the event

getOriginator

public String getOriginator()
Return the name of the class originating this event

Returns:
The class name of the object that originated this event

setCode

public void setCode(String newEventCode)
Set the event code for this event - meaning depends on the originating object

Parameters:
newEventCode - A string representing what type of event has occurred (e.g. an update, delete, etc). Exact meaning is determined by the originating object

setConfigKey

public void setConfigKey(String newConfigKey)
Parameters:
newConfigKey -

setObject

public void setObject(Cacheable newObject)
Set the originating object reference for this event

Parameters:
newObject - A reference to the object that generated this event

setOriginator

public void setOriginator(String newEventOriginator)
Set the class name of the event originator

Parameters:
newEventOriginator - The class name of the object that has triggered this event

Expresso 5-5-0

Please see www.jcorporate.com for information about new Expresso releases.