GigaSpaces XAP 9.7.2 API

org.openspaces.events
Interface EventExceptionHandler<T>

All Known Implementing Classes:
DefaultArchivePollingContainerExceptionHandler

public interface EventExceptionHandler<T>

An exception handler to handle exception when invoking event listeners. The exception can be propagated or handled internally.

If the event container is transactional, then propagating the exception will cause the transaction to rollback, which handling it will cause the transaction to commit.

Author:
kimchy (shay.banon)

Method Summary
 void onException(ListenerExecutionFailedException exception, T data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          A callback to handle exception in an event container.
 void onSuccess(T data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          A callback when a successful execution of a listener.
 

Method Detail

onSuccess

void onSuccess(T data,
               GigaSpace gigaSpace,
               TransactionStatus txStatus,
               Object source)
               throws RuntimeException
A callback when a successful execution of a listener.

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

void onException(ListenerExecutionFailedException exception,
                 T data,
                 GigaSpace gigaSpace,
                 TransactionStatus txStatus,
                 Object source)
                 throws RuntimeException
A callback to handle exception in an event container. The handler can either handle the exception or propagate it.

If the event container is transactional, then propagating the exception will cause the transaction to rollback, while handling it will cause the transaction to commit.

The TransactionStatus can also be used to control if the transaction should be rolled back without throwing an exception.

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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.