net.sf.ehcache.distribution.jgroups
Class JGroupEventMessage

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

public class JGroupEventMessage
extends net.sf.ehcache.distribution.LegacyEventMessage

An EventMessage used for JGroups

Version:
$Id$ EventMessage class for the JGroupsCacheReplicator.
Author:
Pierre Monestie (pmonestie[at]@gmail.com), Greg Luck
See Also:
Serialized Form

Field Summary
static int BOOTSTRAP_COMPLETE
          Bootstrap complete
static int BOOTSTRAP_INCOMPLETE
          Bootstrap could not be completed for some reason
static int BOOTSTRAP_REQUEST
          Request for bootstrap
static int BOOTSTRAP_RESPONSE
          Reply to bootstrap
 
Fields inherited from class net.sf.ehcache.distribution.LegacyEventMessage
PUT, REMOVE, REMOVE_ALL
 
Constructor Summary
JGroupEventMessage(int event, Serializable key, net.sf.ehcache.Element element, String cacheName)
           
JGroupEventMessage(int event, Serializable key, net.sf.ehcache.Element element, String cacheName, long asyncTime)
          An event message for the JGroupsCacheReplicator.
 
Method Summary
 long getAsyncTime()
           
 String getCacheName()
          Returns the cache name
static String getEventName(int event)
          Convert a numeric event ID to a String name.
 boolean isAsync()
           
 String toString()
          
 
Methods inherited from class net.sf.ehcache.distribution.LegacyEventMessage
getElement, getEvent, 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, wait, wait, wait
 

Field Detail

BOOTSTRAP_REQUEST

public static final int BOOTSTRAP_REQUEST
Request for bootstrap

See Also:
Constant Field Values

BOOTSTRAP_RESPONSE

public static final int BOOTSTRAP_RESPONSE
Reply to bootstrap

See Also:
Constant Field Values

BOOTSTRAP_COMPLETE

public static final int BOOTSTRAP_COMPLETE
Bootstrap complete

See Also:
Constant Field Values

BOOTSTRAP_INCOMPLETE

public static final int BOOTSTRAP_INCOMPLETE
Bootstrap could not be completed for some reason

See Also:
Constant Field Values
Constructor Detail

JGroupEventMessage

public JGroupEventMessage(int event,
                          Serializable key,
                          net.sf.ehcache.Element element,
                          String cacheName)
See Also:
JGroupEventMessage(int, Serializable, Element, String, long)

JGroupEventMessage

public JGroupEventMessage(int event,
                          Serializable key,
                          net.sf.ehcache.Element element,
                          String cacheName,
                          long asyncTime)
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.
cacheName - the name of the cache
asyncTime - the asynchronous replication period for this message, -1 results in synchronous replication
Method Detail

isAsync

public boolean isAsync()
Returns:
If asynchronous

getAsyncTime

public long getAsyncTime()
Returns:
The asynchronous replication delay, if less than 0 no synchronous replication is used.

getCacheName

public String getCacheName()
Returns the cache name

Returns:
the cache name

toString

public String toString()

Overrides:
toString in class Object

getEventName

public static String getEventName(int event)
Convert a numeric event ID to a String name.



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