GigaSpaces XAP 9.7.2 API

org.openspaces.archive
Class DefaultArchivePollingContainerExceptionHandler

java.lang.Object
  extended by org.openspaces.archive.DefaultArchivePollingContainerExceptionHandler
All Implemented Interfaces:
EventExceptionHandler<Object>

public class DefaultArchivePollingContainerExceptionHandler
extends Object
implements EventExceptionHandler<Object>

Author:
Itai Frenkel Logs exceptions from the ArchivePollingContainer Filters last exception so it won't be repeatedly logged more than once per minute.

Constructor Summary
DefaultArchivePollingContainerExceptionHandler()
           
DefaultArchivePollingContainerExceptionHandler(long timeWindowsMillis)
           
 
Method Summary
 long getTimeWindowMillis()
           
 void onException(ListenerExecutionFailedException exception, Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          This is the default handler if #setExceptionHandler(EventExceptionHandler) was not called.
 void onSuccess(Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          This is the default handler if #setExceptionHandler(EventExceptionHandler) was not called.
 boolean shouldLog(ListenerExecutionFailedException exception, long now)
           
 void storeLastException(ListenerExecutionFailedException exception, long now)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultArchivePollingContainerExceptionHandler

public DefaultArchivePollingContainerExceptionHandler()

DefaultArchivePollingContainerExceptionHandler

public DefaultArchivePollingContainerExceptionHandler(long timeWindowsMillis)
Method Detail

onSuccess

public void onSuccess(Object data,
                      GigaSpace gigaSpace,
                      TransactionStatus txStatus,
                      Object source)
               throws RuntimeException
This is the default handler if #setExceptionHandler(EventExceptionHandler) was not called. Does nothing in case of a successful archive operation

Specified by:
onSuccess in interface EventExceptionHandler<Object>
Parameters:
data - The actual data object of the event
gigaSpace - A GigaSpace instance that can be used to perform additional operations against the space
txStatus - An optional transaction status allowing to rollback a transaction programmatically
source - Optional additional data or the actual source event data object (where relevant)
Throws:
RuntimeException

onException

public void onException(ListenerExecutionFailedException exception,
                        Object data,
                        GigaSpace gigaSpace,
                        TransactionStatus txStatus,
                        Object source)
                 throws RuntimeException
This is the default handler if #setExceptionHandler(EventExceptionHandler) was not called. Logs the exception if it has not occured in the last minute.

Specified by:
onException in interface EventExceptionHandler<Object>
Parameters:
exception - The listener thrown exception
data - The actual data object of the event
gigaSpace - A GigaSpace instance that can be used to perform additional operations against the space
txStatus - An optional transaction status allowing to rollback a transaction programmatically
source - Optional additional data or the actual source event data object (where relevant)
Throws:
RuntimeException

storeLastException

public void storeLastException(ListenerExecutionFailedException exception,
                               long now)

shouldLog

public boolean shouldLog(ListenerExecutionFailedException exception,
                         long now)

getTimeWindowMillis

public long getTimeWindowMillis()

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.