Top Description Fields Constructors Methods
net.sf.ehcache.distribution

public Class LegacyEventMessage

extends EventMessage
Class Inheritance
Imports
java.io.IOException, .Serializable, java.lang.ref.SoftReference, net.sf.ehcache.Element

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.

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

Field Summary

Modifier and TypeField and Description
private transient SoftReference<T>
elementSoftReference

The element component.

private final int
event

The event component.

public static final int
PUT

A put or update event.

public static final int
REMOVE

A remove or invalidate event.

public static final int
REMOVE_ALL

A removeAll, which removes all elements from a cache

private static final long
private final boolean
wasElementNotNull

Used to check if the value has been GCed

Constructor Summary

AccessConstructor and Description
public
LegacyEventMessage(int event, Serializable key, Element element)

Full constructor.

Method Summary

Modifier and TypeMethod and Description
public final Element

Returns:

the element component of the message. null if a REMOVE event
getElement
()

public final int

Returns:

either PUT or REMOVE
getEvent
()

Gets the event.

public boolean

Returns:

true if because of SoftReference GC this LegacyEventMessage is no longer valid
isValid
()

private void
private void
Inherited from net.sf.ehcache.distribution.EventMessage:
getEhcachegetSerializableKey

Field Detail

elementSoftReferenceback to summary
private transient SoftReference<T> elementSoftReference

The element component. This is held by a SoftReference, so as to prevent out of memory errors.

eventback to summary
private final int event

The event component.

PUTback to summary
public static final int PUT

A put or update event.

REMOVEback to summary
public static final int REMOVE

A remove or invalidate event.

REMOVE_ALLback to summary
public static final int REMOVE_ALL

A removeAll, which removes all elements from a cache

serialVersionUIDback to summary
private static final long serialVersionUID

Hides net.sf.ehcache.distribution.EventMessage.serialVersionUID.

wasElementNotNullback to summary
private final boolean wasElementNotNull

Used to check if the value has been GCed

Constructor Detail

LegacyEventMessageback to summary
public LegacyEventMessage(int event, Serializable key, Element element)

Full constructor.

Method Detail

getElementback to summary
public final Element getElement()
Returns:Element

the element component of the message. null if a REMOVE event

getEventback to summary
public final int getEvent()

Gets the event.

Returns:int

either PUT or REMOVE

isValidback to summary
public boolean isValid()
Returns:boolean

true if because of SoftReference GC this LegacyEventMessage is no longer valid

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException