Class OutputEvent

  • All Implemented Interfaces:
    Contextual

    public class OutputEvent
    extends SciJavaEvent
    An event indicating output occurred on stdout or stderr.

    NB: This event is published on the calling thread by ConsoleService.notifyListeners(OutputEvent), not on a dedicated event dispatch thread by the EventService. This is done to avoid the overhead of the event service's synchronized pub/sub implementation, as well as to avoid potential infinite output loops caused by debugging output surrounding event publication.

    Author:
    Curtis Rueden
    • Constructor Detail

      • OutputEvent

        public OutputEvent​(Context context,
                           OutputEvent.Source source,
                           String output,
                           boolean contextual)
        Creates a new output event.
        Parameters:
        source - The source of the output.
        output - The output string.
        contextual - Whether the output was produced within this specific SciJava Context.
    • Method Detail

      • getOutput

        public String getOutput()
        Gets the output string.
      • isContextual

        public boolean isContextual()
        Returns true if the output was produced outside of a specific SciJava Context.
      • isStdout

        public boolean isStdout()
        Returns true of the source of the output is stdout.
      • isStderr

        public boolean isStderr()
        Returns true of the source of the output is stderr.