cacheRunner
Class LoggingCacheCallback

java.lang.Object
  extended by cacheRunner.LoggingCacheCallback
All Implemented Interfaces:
CacheCallback, Declarable
Direct Known Subclasses:
LoggingCacheListener, LoggingCacheLoader, LoggingCacheWriter, LoggingTransactionListener

public abstract class LoggingCacheCallback
extends Object
implements CacheCallback, Declarable

The abstract superclass of various GemFire CacheCallbacks that log information about the events that they receieve. Because this class implements the Declarable interface, it may be used in a cache.xml file.

Since:
4.0
Author:
GemStone Systems, Inc.

Constructor Summary
protected LoggingCacheCallback()
          Creates a new LoggingCacheCallback that logs to standard out.
 
Method Summary
 void close()
          No logging is performed when a callback is closed
protected  String format(EntryEvent event)
          Formats an EntryEvent into a string
protected  String format(Object obj)
          Formats an arbitrary object into a string
 void init(Properties props)
          Initializes this cache callback using data configured in a cache.xml file.
protected  void log(String message, Cache cache)
          Logs a message to either standard out or to the GemFire logger obtained from the given Cache.
protected  void log(String kind, EntryEvent event)
          Logs information about an EntryEvent
protected  void log(String kind, RegionEvent event)
          Logs information about a RegionEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingCacheCallback

protected LoggingCacheCallback()
Creates a new LoggingCacheCallback that logs to standard out.

Method Detail

init

public void init(Properties props)
Initializes this cache callback using data configured in a cache.xml file. This callback recognizes the useGemFireLogger property.

Specified by:
init in interface Declarable

close

public void close()
No logging is performed when a callback is closed

Specified by:
close in interface CacheCallback

log

protected void log(String message,
                   Cache cache)
Logs a message to either standard out or to the GemFire logger obtained from the given Cache.

See Also:
Cache.getLogger()

format

protected String format(Object obj)
Formats an arbitrary object into a string


format

protected String format(EntryEvent event)
Formats an EntryEvent into a string


log

protected void log(String kind,
                   EntryEvent event)
Logs information about an EntryEvent

Parameters:
kind - The kind (update, destroy, etc.) of event to be logged

log

protected void log(String kind,
                   RegionEvent event)
Logs information about a RegionEvent

Parameters:
kind - The kind (destroy, etc.) of event to be logged


Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.