org.jboss.cache.util
Class CachePrinter

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

public class CachePrinter
extends Object

Helper that prints the contents of a Cache to a string.

Since:
2.0.0
Author:
Manik Surtani

Constructor Summary
CachePrinter()
           
 
Method Summary
static String formatHtml(String s)
          Formats a given String for display as an HTML snippet.
static String prettyPrint(long millis)
          Prints a time for display
static String printCacheDetails(Cache c)
          Prints the contents of the cache (nodes + data) to a string
static String printCacheInterceptors(CacheSPI<?,?> cache)
           
static String printCacheLockingInfo(Cache c)
          Prints the status of locks in the cache (nodes + locks) to a string
static String printInterceptorChain(CommandInterceptor i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachePrinter

public CachePrinter()
Method Detail

printCacheDetails

public static String printCacheDetails(Cache c)
Prints the contents of the cache (nodes + data) to a string

Parameters:
c - cache to print
Returns:
a String representation of the cache

printCacheLockingInfo

public static String printCacheLockingInfo(Cache c)
Prints the status of locks in the cache (nodes + locks) to a string

Parameters:
c - cache to print
Returns:
a String representation of the cache

printCacheInterceptors

public static String printCacheInterceptors(CacheSPI<?,?> cache)

printInterceptorChain

public static String printInterceptorChain(CommandInterceptor i)

formatHtml

public static String formatHtml(String s)
Formats a given String for display as an HTML snippet.

Parameters:
s - string to format
Returns:
formatted string

prettyPrint

public static String prettyPrint(long millis)
Prints a time for display

Parameters:
millis - time in millis
Returns:
the time, represented as millis, seconds, minutes or hours as appropriate, with suffix


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.