org.jboss.cache.util
Class Util

java.lang.Object
  extended by org.jboss.cache.util.Util

public final class Util
extends java.lang.Object

General utility methods used throughout the JBC code base.

Version:
$Revision: 1.4 $
Author:
Brian Stansberry

Nested Class Summary
static class Util.MapModifications
          Static inner class that holds 3 maps - for data added, removed and modified.
 
Method Summary
static Util.MapModifications diffNodeData(java.util.Map<java.lang.Object,java.lang.Object> pre, java.util.Map<java.lang.Object,java.lang.Object> post)
          Calculates the diffs between data maps passed in to org.jboss.cache.CacheListener#nodeModified(org.jboss.cache.Fqn,boolean,boolean,org.jboss.cache.CacheListener.ModificationType,java.util.Map) before and after modification.
static java.lang.Class loadClass(java.lang.String classname)
          Loads the specified class using this class's classloader, or, if it is null (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadClass

public static java.lang.Class loadClass(java.lang.String classname)
                                 throws java.lang.ClassNotFoundException
Loads the specified class using this class's classloader, or, if it is null (i.e. this class was loaded by the bootstrap classloader), the system classloader.

If loadtime instrumentation via GenerateInstrumentedClassLoader is used, this class may be loaded by the bootstrap classloader.

Parameters:
classname - name of the class to load
Returns:
the class
Throws:
java.lang.ClassNotFoundException

diffNodeData

public static Util.MapModifications diffNodeData(java.util.Map<java.lang.Object,java.lang.Object> pre,
                                                 java.util.Map<java.lang.Object,java.lang.Object> post)
Calculates the diffs between data maps passed in to org.jboss.cache.CacheListener#nodeModified(org.jboss.cache.Fqn,boolean,boolean,org.jboss.cache.CacheListener.ModificationType,java.util.Map) before and after modification. This only makes sense if the modification type is org.jboss.cache.CacheListener.ModificationType#PUT_MAP. Refer to org.jboss.cache.CacheListener#nodeModified(org.jboss.cache.Fqn,boolean,boolean,org.jboss.cache.CacheListener.ModificationType,Map).

Parameters:
pre - map of data before the node was modified
post - Map of data after the node was modified
Returns:
MapModifications containing the differences.