Interface IContext

All Known Subinterfaces:
ICombinedContext, IDTFJContext
All Known Implementing Classes:
CombinedContext, Context, DTFJContext, EmptyDTFJContext

public interface IContext
A context is the process and address space within which a plugin is operating. There are no guarantees made as to the presence of a JVM.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Execute the entered command line with the output sent to the supplied print stream.
    void
    execute(String cmdline, PrintStream out)
    Execute the entered command line with the output sent to the supplied print stream.
    void
    execute(String cmdline, String[] arguments, PrintStream out)
    Execute the entered command line with the output sent to the supplied print stream.
    Returns a list of commands which are available for this context
    Provides access to any uncaught exceptions thrown when the last command was executed.
    The last command which was successfully executed by the context.
    Gets the classloader which has been used to add plugins.
    A set of defined properties.
    boolean
    Allows to check if the given command will be executed (i.e. if there is a command that will accept the string) without actually executing it, avoiding error messages etc.
    void
    Refreshes the context, this will perform actions such as rescanning the plugin path or other initialization tasks.
  • Method Details

    • getProperties

      Properties getProperties()
      A set of defined properties. This typically includes information not on the DTFJ API, but may be useful for plugin processing e.g. a logging level. Tools such as jdmpview which provide not only the execution harness but some in-built commands use properties to pass information to commands.
      Returns:
      properties that have currently been set
    • isCommandRecognised

      boolean isCommandRecognised(String command)
      Allows to check if the given command will be executed (i.e. if there is a command that will accept the string) without actually executing it, avoiding error messages etc.
      Parameters:
      command - - just the actual command WITHOUT ARGUMENTS
      Returns:
    • execute

      void execute(String cmdline, String[] arguments, PrintStream out)
      Execute the entered command line with the output sent to the supplied print stream.
      Parameters:
      cmdline - line to execute
      out - where to write the output to
    • execute

      void execute(String cmdline, PrintStream out)
      Execute the entered command line with the output sent to the supplied print stream.
      Parameters:
      cmdline - line to execute
      out - where to write the output to
    • execute

      void execute(CommandParser command, PrintStream out)
      Execute the entered command line with the output sent to the supplied print stream.
      Parameters:
      command -
      out -
    • getPluginClassloader

      PluginLoader getPluginClassloader()
      Gets the classloader which has been used to add plugins. This is typically done to add new plugins at runtime or refresh the existing list.
      Returns:
      the classloader
    • refresh

      void refresh()
      Refreshes the context, this will perform actions such as rescanning the plugin path or other initialization tasks.
    • getCommands

      List<ICommand> getCommands()
      Returns a list of commands which are available for this context
      Returns:
    • getLastExecutedCommand

      ICommand getLastExecutedCommand()
      The last command which was successfully executed by the context.
      Returns:
      the command or null if none have been executed or the command threw an exception
    • getLastCommandException

      Exception getLastCommandException()
      Provides access to any uncaught exceptions thrown when the last command was executed.
      Returns:
      the exception or null of no uncaught exceptions were thrown