Interface IOutputManager

All Superinterfaces:
IOutputChannel
All Known Implementing Classes:
Output

public interface IOutputManager extends IOutputChannel
The output manager is responsible for managing a collection of registered output channels. It provides methods to register and remove channels as well as control buffering. When text is written to the manager then it is sent to all registered output channels. This interface is an extension of IOutputChannel so as to enforce consistency between the declarations for printing text to an output channel. The manager is in effect acting as a single proxy channel for all of it's individually registered channels.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a channel to the list of registered channels.
    void
    Clears the current buffer contents.
    Gets the current buffer contents.
    Creates a print stream for this output object
    void
    Remove all registered channels
    void
    Removes a specific channel for a particular type.
    void
    Removes all registered channels for a particular type.
    void
    setBuffering(boolean enabled)
    Enabling buffering will cause the output from commands to be written to an internal buffer rather than immediately to the underlying output channels.

    Methods declared in interface IOutputChannel

    close, flush, print, println, printPrompt
    Modifier and Type
    Method
    Description
    void
    Instructs this channel to close and free any resources.
    void
    Causes the channel to flush any buffered text.
    void
    print(String outputString)
    Sends text to channel
    void
    println(String outputString)
    Sends text to the channel with an appended \n
    void
    Sets the prompt which should be displayed when an interactive session is running.
  • Method Details

    • setBuffering

      void setBuffering(boolean enabled)
      Enabling buffering will cause the output from commands to be written to an internal buffer rather than immediately to the underlying output channels. This is typically used by clients to inspect or intercept the results from a command before carrying out further processing. By default buffering is not enabled.
      Parameters:
      enabled - true turns on buffering
    • clearBuffer

      void clearBuffer()
      Clears the current buffer contents.
    • getBuffer

      String getBuffer()
      Gets the current buffer contents.
      Returns:
      buffer contents
    • addChannel

      void addChannel(IOutputChannel channel)
      Adds a channel to the list of registered channels.
      Parameters:
      channel - channel to add.
    • removeChannel

      void removeChannel(Class<?> type)
      Removes all registered channels for a particular type.
      Parameters:
      type -
    • removeChannel

      void removeChannel(IOutputChannel channel)
      Removes a specific channel for a particular type. For this to be successful the underlying implementation must override hashcode and equals.
      Parameters:
      type -
    • removeAllChannels

      void removeAllChannels()
      Remove all registered channels
    • getPrintStream

      PrintStream getPrintStream()
      Creates a print stream for this output object
      Returns: