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 5192 2012-01-18 17:39:08Z cdennis $
Author:
Greg Luck
See Also:
Serialized Form

Nested Class Summary
static class EventMessage.EventType
          Enumeration of event types.
 
Constructor Summary
EventMessage(Ehcache cache, EventMessage.EventType type, Serializable key, Element element)
          Full constructor.
 
Method Summary
 Ehcache getEhcache()
          Gets the associated Ehcache.
 Element getElement()
           
 Serializable getSerializableKey()
           
 EventMessage.EventType getType()
          Gets the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventMessage

public EventMessage(Ehcache cache,
                    EventMessage.EventType type,
                    Serializable key,
                    Element element)
Full constructor.

Parameters:
cache -
type -
key -
element -
Method Detail

getEhcache

public final Ehcache getEhcache()
Gets the associated Ehcache.

Returns:
the associated cache

getType

public final EventMessage.EventType getType()
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

ehcache

Copyright © 2003-2012 Terracotta, Inc.. All Rights Reserved.