Class EventSource<Event>

    • Method Detail

      • addHandler

        public boolean addHandler​(EventHandler<Event> handler)
                           throws SuspendExecution,
                                  java.lang.InterruptedException
        Adds an EventHandler that will be notified of every event sent to this actor.
        Parameters:
        handler - the handler
        Returns:
        true if the handler has been successfully added to the actor, or false if the handler was already registered.
        Throws:
        SuspendExecution
        java.lang.InterruptedException
      • removeHandler

        public boolean removeHandler​(EventHandler<Event> handler)
                              throws SuspendExecution,
                                     java.lang.InterruptedException
        Removes an EventHandler from the actor
        Parameters:
        handler -
        Returns:
        true if the handler was registered and successfully removed, or false if the handler was not registered.
        Throws:
        SuspendExecution
        java.lang.InterruptedException
      • notify

        public void notify​(Event event)
                    throws SuspendExecution
        Sends an event to the actor, which will be delivered to all registered event handlers.
        Parameters:
        event - the event
        Throws:
        SuspendExecution
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class ActorRef<java.lang.Object>