Class EventDispatcher


  • public class EventDispatcher
    extends java.lang.Object
    The event dispatcher notifies listeners when specific events occur within the database, related to command execution and row processing operations. It is used, for example, to implement index updates and other such tasks.
    • Field Detail

      • logger

        private static org.apache.logging.log4j.Logger logger
        A logging object for reporting anything interesting that happens.
      • commandEventListeners

        private java.util.ArrayList<CommandEventListener> commandEventListeners
        A list of listeners that are registered to receive command event notifications.
      • rowEventListeners

        private java.util.ArrayList<RowEventListener> rowEventListeners
        A list of listeners that are registered to receive row event notifications.
    • Constructor Detail

      • EventDispatcher

        public EventDispatcher()
    • Method Detail

      • addCommandEventListener

        public void addCommandEventListener​(CommandEventListener listener)
        Add another command-event listener to the event dispatcher. Note that if the same component is added twice, it will receive two notifications for each event.
        Parameters:
        listener - the command-event listener
      • addRowEventListener

        public void addRowEventListener​(RowEventListener listener)
        Add another row-event listener to the event dispatcher. Note that if the same component is added twice, it will receive two notifications for each event.
        Parameters:
        listener - the row-event listener
      • fireBeforeCommandExecuted

        public void fireBeforeCommandExecuted​(Command cmd)
        Parameters:
        cmd - the command that is about to be executed
      • fireAfterCommandExecuted

        public void fireAfterCommandExecuted​(Command cmd)
        Parameters:
        cmd - the command that was just executed
      • fireBeforeRowInserted

        public void fireBeforeRowInserted​(TableInfo tblFileInfo,
                                          Tuple newValues)
      • fireAfterRowInserted

        public void fireAfterRowInserted​(TableInfo tblFileInfo,
                                         Tuple newTuple)
      • fireBeforeRowUpdated

        public void fireBeforeRowUpdated​(TableInfo tblFileInfo,
                                         Tuple oldTuple,
                                         Tuple newValues)
      • fireAfterRowUpdated

        public void fireAfterRowUpdated​(TableInfo tblFileInfo,
                                        Tuple oldValues,
                                        Tuple newTuple)
      • fireBeforeRowDeleted

        public void fireBeforeRowDeleted​(TableInfo tblFileInfo,
                                         Tuple oldTuple)
      • fireAfterRowDeleted

        public void fireAfterRowDeleted​(TableInfo tblFileInfo,
                                        Tuple oldValues)