Class BasicEvent

All Implemented Interfaces:
KeyValuePair<String,String>, Event, Persistent, Serializable, Cloneable

public class BasicEvent extends PersistentObject implements Event
Implementation of the Event class.
See Also:
  • Constructor Details

    • BasicEvent

      public BasicEvent()
    • BasicEvent

      public BasicEvent(String name, ActivityInstance raiser, Object context, int txType)
      Create an event.
      Parameters:
      name - the name of the event - must match the registration name
      raiser - the activity instance which raised the event, may be null
      context - context object: either a persistent or a string or null; if neither a String nor a Persistent is being used, a warning will be issued and the context stays empty
      txType - the transaction type, at the moment, @see EventManager#CURRENT_TX is the only supported value
  • Method Details

    • afterDispatch

      public void afterDispatch()
      Description copied from interface: Event
      callback method which will be called after the event has successfully been dispatched
      Specified by:
      afterDispatch in interface Event
    • forcedDispatch

      public boolean forcedDispatch()
      Returns:
      the forceDispatch
    • getContext

      public Object getContext()
      Description copied from interface: Event
      returns the context object
      Specified by:
      getContext in interface Event
    • getField

      public Object getField(String fname) throws NoSuchFieldException, IllegalAccessException
      Description copied from interface: Event
      This method return a field of the context object, useful if the context object is a form
      Specified by:
      getField in interface Event
      Throws:
      NoSuchFieldException
      IllegalAccessException
    • getName

      public String getName()
      Description copied from interface: Event
      returns the name of the event
      Specified by:
      getName in interface Event
    • getRaiseDate

      public Date getRaiseDate()
      Description copied from interface: Event
      The date and time when the event has been raised.
      Specified by:
      getRaiseDate in interface Event
    • getRaiser

      public ActivityInstance getRaiser()
      Description copied from interface: Event
      return the raiser of the event
      Specified by:
      getRaiser in interface Event
    • getTableName

      public String getTableName()
      Description copied from interface: Persistent
      This method must return the table name of the database table in which this persistent object is stored.
      Specified by:
      getTableName in interface Persistent
      Returns:
      The table name of the database table in which this persistent object is stored.
    • getTxType

      public int getTxType()
      Description copied from interface: Event
      get the transaction-type. At the moment, CURRENT_TX is the only supported type.
      Specified by:
      getTxType in interface Event
      Returns:
      the txType
      See Also:
    • onNotDispatched

      public void onNotDispatched()
      Description copied from interface: Event
      callback method which will be called if the event couldn't be dispatched
      Specified by:
      onNotDispatched in interface Event
    • setForceDispatch

      public void setForceDispatch(boolean forceDispatch)
      Parameters:
      forceDispatch - the forceDispatch to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setAbort

      public void setAbort(boolean abort)
    • isAbort

      public boolean isAbort()
      Description copied from interface: Event
      can be used to notify the event-handler of an illegal state
      Specified by:
      isAbort in interface Event