psdi.app.eventresponse

Class RespondingEventListener

  • java.lang.Object
    • psdi.app.eventresponse.RespondingEventListener
  • All Implemented Interfaces:
    EventListener


    public class RespondingEventListener
    extends java.lang.Object
    implements EventListener
    This object is created to respond to all events and redirect those to the members of the ER set that match the source and event name. It also supports matching immediate changes, before ER Mbos are saved to the database.
    • Method Detail

      • getListener

        public static RespondingEventListener getListener()
                                                   throws java.rmi.RemoteException,
                                                          MXException
        Returns the listener object. Creates one if not in existance yet.
        Returns:
        the listener
        Throws:
        java.rmi.RemoteException
        MXException
      • getLogger

        public static MXLogger getLogger()
        Returns the logger object. Creates one if not in existence yet.
        Returns:
        the MXLogger
      • eventValidate

        public boolean eventValidate(EventMessage em)
                              throws MXException
        Method to respond to the eventValidate action.
        Specified by:
        eventValidate in interface EventListener
        Returns:
        If no ERs match the source & event name, false is returned and the MXServer won't inform the listener of preSave, event, and postCommit actions. If there are ERs, even if they don't have actions for eventValidate, then true is returned.
        Throws:
        MXException - The first EventResponse, whose validate action throws an exception, halts the validation process and that exception is passed up to the source. This will prevent the event from continuing. In this way ER's can be used to prevent status changes or such.
      • preSaveEventAction

        public void preSaveEventAction(EventMessage em)
                                throws MXException
        Searches for responders to the PreSave part of the event. Exceptions thrown are written to the error log, but do not prevent all responders from getting a chance at the event.
        Specified by:
        preSaveEventAction in interface EventListener
        Parameters:
        em - The event to respond to.
        Throws:
        MXException
      • eventAction

        public void eventAction(EventMessage em)
                         throws MXException
        Searches for responders to the EventAction of the event. Exceptions thrown are written to the error log, but do not prevent all responders from getting a chance at the event.
        Specified by:
        eventAction in interface EventListener
        Parameters:
        em - The event to respond to.
        Throws:
        MXException
      • postCommitEventAction

        public void postCommitEventAction(EventMessage em)
                                   throws MXException
        Searches for responders to the post-commit of the event. Exceptions thrown are written to the error log, but do not prevent all responders from getting a chance at the event.
        Specified by:
        postCommitEventAction in interface EventListener
        Parameters:
        em - The event to respond to.
        Throws:
        MXException