freemarker.template
Class CacheEvent

java.lang.Object
  extended by java.util.EventObject
      extended by freemarker.template.CacheEvent
All Implemented Interfaces:
java.io.Serializable

public final class CacheEvent
extends java.util.EventObject

An event fired by self-updating caches.

Version:
$Id: CacheEvent.java 1101 2013-04-01 04:17:32Z run2000 $
See Also:
CacheListener, FileTemplateCache, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CacheEvent(java.lang.Object source)
          Constructor that takes the object where the event originated.
CacheEvent(java.lang.Object source, java.lang.String elementName, java.lang.Exception exception)
          Constructor that takes an element name, and the exception that caused the event.
CacheEvent(java.lang.Object source, java.lang.String elementName, long lastModified)
          Constructor that takes an element name, and the exception that caused the event.
 
Method Summary
 java.lang.String getElementName()
          Retrieves the name of the element that caused the event.
 java.lang.Exception getException()
          Retrieves the exception that caused the event.
 long getLastModified()
          Retrieves the last modification date of the named element.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheEvent

public CacheEvent(java.lang.Object source)
Constructor that takes the object where the event originated.

Parameters:
source - the source of this event

CacheEvent

public CacheEvent(java.lang.Object source,
                  java.lang.String elementName,
                  long lastModified)
Constructor that takes an element name, and the exception that caused the event.

Parameters:
source - the source of this event
elementName - the name of the cache element
lastModified - the time that the element was last modified

CacheEvent

public CacheEvent(java.lang.Object source,
                  java.lang.String elementName,
                  java.lang.Exception exception)
Constructor that takes an element name, and the exception that caused the event.

Parameters:
source - the source of this event
elementName - the name of the cache element
exception - the exception that caused the event
Method Detail

getException

public java.lang.Exception getException()
Retrieves the exception that caused the event.

Returns:
the Exception, if any, associated with this event.

getElementName

public java.lang.String getElementName()
Retrieves the name of the element that caused the event.

Returns:
the name of the cache element, if any, associated with this event.

getLastModified

public long getLastModified()
Retrieves the last modification date of the named element. Applicable only for elementUpdated events.

Returns:
a long representing the time in milliseconds that the element was last modified, or 0 if no time is specified