Class JVMEventDispatcher

    • Constructor Detail

      • JVMEventDispatcher

        public JVMEventDispatcher()
    • Method Detail

      • register

        public <R extends JVMEvent> void register​(Class<R> eventClass,
                                                  Consumer<? super R> process)
        Type Parameters:
        R - A type of JVMEvent
        Parameters:
        eventClass - A JVMEvent class that the Aggregator captures
        process - A method to call back when an event of type eventClass is captured.
      • dispatch

        public <R extends JVMEvent> void dispatch​(R event)
        todo: fix comment for the link below. Called from Aggregator.receive(JVMEvent), this invokes the process method that was registered.
        Type Parameters:
        R - the type of JVMEvent.
        Parameters:
        event - An event from the parser.