Top Description Fields Constructors Methods
net.sf.ehcache.hibernate.nonstop

public final Class HibernateNonstopCacheExceptionHandler

extends Object
Class Inheritance
Imports
net.sf.ehcache.constructs.nonstop.NonStopCacheException, org.slf4j.Logger, .LoggerFactory

Class that takes care of NonStopCacheException that happens in hibernate module
Author
Abhishek Sanoujam

Field Summary

Modifier and TypeField and Description
public static final String
HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTY

Property name for logging the stack trace of the nonstop cache exception too.

public static final String
HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTY

Property name which set as "true" will throw exceptions on timeout with hibernate

private static final HibernateNonstopCacheExceptionHandler
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HibernateNonstopCacheExceptionHandler

Returns:

the singleton instance
getInstance
()

Returns the singleton instance

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTYback to summary
public static final String HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTY

Property name for logging the stack trace of the nonstop cache exception too. False by default

HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTYback to summary
public static final String HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTY

Property name which set as "true" will throw exceptions on timeout with hibernate

INSTANCEback to summary
private static final HibernateNonstopCacheExceptionHandler INSTANCE
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

HibernateNonstopCacheExceptionHandlerback to summary
private HibernateNonstopCacheExceptionHandler()

private constructor

Method Detail

getInstanceback to summary
public static HibernateNonstopCacheExceptionHandler getInstance()

Returns the singleton instance

Returns:HibernateNonstopCacheExceptionHandler

the singleton instance

handleNonstopCacheExceptionback to summary
public void handleNonstopCacheException(NonStopCacheException nonStopCacheException)

Handle NonStopCacheException. If HibernateNonstopCacheExceptionHandler#HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTY system property is set to true, rethrows the NonStopCacheException, otherwise logs the exception. While logging, if HibernateNonstopCacheExceptionHandler#HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTY is set to true, logs the exception stack trace too, otherwise logs the exception message only