ehcache

net.sf.ehcache.distribution
Class EventMessage

java.lang.Object
  extended by net.sf.ehcache.distribution.EventMessage
All Implemented Interfaces:
Serializable

public class EventMessage
extends Object
implements Serializable

An Event Message, in respect of a particular cache.

The message is Serializable, so that it can be sent across the network.

The value of an Element is referenced with a SoftReference, so that a value will fail to be delivered in preference to an OutOfMemory error.

Version:
$Id: EventMessage.java 2154 2010-04-06 02:45:52Z cdennis $
Author:
Greg Luck
See Also:
Serialized Form

Field Summary
static int PUT
          A put or update event.
static int REMOVE
          A remove or invalidate event.
static int REMOVE_ALL
          A removeAll, which removes all elements from a cache
 
Constructor Summary
EventMessage(int event, Serializable key, Element element)
          Full constructor.
 
Method Summary
 Element getElement()
           
 int getEvent()
          Gets the event.
 Serializable getSerializableKey()
           
 boolean isValid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUT

public static final int PUT
A put or update event.

See Also:
Constant Field Values

REMOVE

public static final int REMOVE
A remove or invalidate event.

See Also:
Constant Field Values

REMOVE_ALL

public static final int REMOVE_ALL
A removeAll, which removes all elements from a cache

See Also:
Constant Field Values
Constructor Detail

EventMessage

public EventMessage(int event,
                    Serializable key,
                    Element element)
Full constructor.

Parameters:
event -
key -
element -
Method Detail

getEvent

public final int getEvent()
Gets the event.

Returns:
either PUT or REMOVE

getElement

public final Element getElement()
Returns:
the element component of the message. null if a REMOVE event

getSerializableKey

public final Serializable getSerializableKey()
Returns:
the key component of the message. null if a PUT event

isValid

public boolean isValid()
Returns:
true if because of SoftReference GC this EventMessage is no longer valid

ehcache

true