ehcache

net.sf.ehcache.distribution
Class LegacyEventMessage

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

public class LegacyEventMessage
extends EventMessage

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
LegacyEventMessage(int event, Serializable key, Element element)
          Full constructor.
 
Method Summary
 Element getElement()
           
 int getEvent()
          Gets the event.
 boolean isValid()
           
 
Methods inherited from class net.sf.ehcache.distribution.EventMessage
getEhcache, getSerializableKey
 
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

LegacyEventMessage

public LegacyEventMessage(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

isValid

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

ehcache

Copyright 2001-2014, Terracotta, Inc.