Class TransactionEvent

java.lang.Object
com.aquima.interactions.profile.events.TransactionEvent
All Implemented Interfaces:
IEvent, ITransactionEvent

public final class TransactionEvent extends Object implements ITransactionEvent
Event class which holds the information about a transaction related event.
Since:
5.0
Author:
O. Kerpershoek
  • Method Summary

    Modifier and Type
    Method
    Description
    static IEvent
    commit(String transactionName, int transactionLevel)
    Constructs a commit transaction event for the specified name and level.
    int
    The level inside the transaction.
    A created transaction has a name, to enforce nested transactions to return to the desired level on a commit or rollback.
    int
    This method will return the type of the event.
    void
    The invoke event hook method will be triggered for every listener that is registered to receive events.
    static IEvent
    rollback(String transactionName, int transactionLevel)
    Constructs a roll-back transaction event for the specified name and level.
    static IEvent
    start(String transactionName, int transactionLevel)
    Constructs a start transaction event for the specified name and level.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • start

      public static IEvent start(String transactionName, int transactionLevel)
      Constructs a start transaction event for the specified name and level.
      Parameters:
      transactionName - The name of the transaction.
      transactionLevel - The level of the transaction.
      Returns:
      The transaction event for the specified parameters.
    • commit

      public static IEvent commit(String transactionName, int transactionLevel)
      Constructs a commit transaction event for the specified name and level.
      Parameters:
      transactionName - The name of the transaction.
      transactionLevel - The level of the transaction.
      Returns:
      The transaction event for the specified parameters.
    • rollback

      public static IEvent rollback(String transactionName, int transactionLevel)
      Constructs a roll-back transaction event for the specified name and level.
      Parameters:
      transactionName - The name of the transaction.
      transactionLevel - The level of the transaction.
      Returns:
      The transaction event for the specified parameters.
    • getType

      public int getType()
      Description copied from interface: IEvent
      This method will return the type of the event. The type of the event is used to determine which event listeners should be invoked.
      Specified by:
      getType in interface IEvent
      Returns:
      The type of the event.
    • getTransactionName

      public String getTransactionName()
      Description copied from interface: ITransactionEvent
      A created transaction has a name, to enforce nested transactions to return to the desired level on a commit or rollback.
      Specified by:
      getTransactionName in interface ITransactionEvent
      Returns:
      The name of the transaction.
    • getTransactionLevel

      public int getTransactionLevel()
      Description copied from interface: ITransactionEvent
      The level inside the transaction. Just before the action is executed. At the first startTransaction this level will be 0, at the last commit action before all actions are committed the level will be 1.
      Specified by:
      getTransactionLevel in interface ITransactionEvent
      Returns:
      Integer with the level of the transaction.
    • invokeEventHook

      public void invokeEventHook(IEventListener listener)
      Description copied from interface: IEvent
      The invoke event hook method will be triggered for every listener that is registered to receive events. The event class that implements this interface should check if the listener that is passed as argument supports this event, and invoke the correct method of the listener to notify the listener.
      For example: A context switch event can check if the listener contains a method 'onContextSwitch' and invoke that method when found.
      Specified by:
      invokeEventHook in interface IEvent
      Parameters:
      listener - IEventListener that should be notified of the event.