ehcache

net.sf.ehcache.distribution.jgroups
Class JGroupEventMessage

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

public class JGroupEventMessage
extends EventMessage

An EventMessage used for JGroups

Version:
$Id: JGroupEventMessage.java 704 2008-07-13 00:17:52Z gregluck $ EventMessage class for the JGroupsCacheReplicator.
Author:
Pierre Monestie (pmonestie[at]@gmail.com), Greg Luck
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.ehcache.distribution.EventMessage
PUT, REMOVE, REMOVE_ALL
 
Constructor Summary
JGroupEventMessage(int event, java.io.Serializable key, Element element, Ehcache cache, java.lang.String cacheName)
          An event message for the JGroupsCacheReplicator.
 
Method Summary
 Ehcache getCache()
           
 java.lang.String getCacheName()
          Returns the cache name
 
Methods inherited from class net.sf.ehcache.distribution.EventMessage
getElement, getEvent, getSerializableKey, isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGroupEventMessage

public JGroupEventMessage(int event,
                          java.io.Serializable key,
                          Element element,
                          Ehcache cache,
                          java.lang.String cacheName)
An event message for the JGroupsCacheReplicator. We keep as transient the origin cache and we serialize the cacheName. That way the JgroupManager will know from which cache the message came from

Parameters:
event - (PUT,REMOVE,REMOVE_ALL)
key - the serializable key of the cache element
element - The element itself. In case of a put.
cache - the Ehcache instance. This is a transient variable
cacheName - the name of the cache
Method Detail

getCache

public Ehcache getCache()
Returns:
the cache from which this event originated

getCacheName

public java.lang.String getCacheName()
Returns the cache name

Returns:
the cache name

ehcache