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 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: