Class CombinedContext

All Implemented Interfaces:
IContext, IDTFJContext, PluginLoader, ICombinedContext

public class CombinedContext extends DTFJContext implements ICombinedContext
Wrapper class that takes an existing DTFJ context and augments it with a DDR interactive context if one exists.
  • Constructor Details

  • Method Details

    • getID

      public int getID()
      Description copied from interface: ICombinedContext
      Contexts have a unique positive numeric identifier within a session. This number always increases if new contexts are created via the open command rather than attempting to re-use any already used IDs.
      Specified by:
      getID in interface ICombinedContext
      Returns:
      the ID for this context
    • setID

      public void setID(int id)
      Description copied from interface: ICombinedContext
      Sets the numeric ID for this context. This setter is provided so as to allow context creation before assigning the ID. However once set it should not be changed. Later implementations may enforce this.
      Specified by:
      setID in interface ICombinedContext
      Parameters:
      id - the context ID
    • execute

      public void execute(String cmdline, String[] arguments, PrintStream out)
      Description copied from interface: IContext
      Execute the entered command line with the output sent to the supplied print stream.
      Specified by:
      execute in interface IContext
      Parameters:
      cmdline - line to execute
      out - where to write the output to
    • execute

      public void execute(String cmdline, PrintStream out)
      Description copied from interface: IContext
      Execute the entered command line with the output sent to the supplied print stream.
      Specified by:
      execute in interface IContext
      Parameters:
      cmdline - line to execute
      out - where to write the output to
    • execute

      public void execute(CommandParser command, PrintStream out)
      Description copied from interface: IContext
      Execute the entered command line with the output sent to the supplied print stream.
      Specified by:
      execute in interface IContext
      Parameters:
      command -
      out -
    • startDDRInteractiveSession

      public void startDDRInteractiveSession(Image image, PrintStream out)
      Starts a DDR interactive session using the loaded image. If the core file is not DDR enabled this is recorded and future pling commands will not be available. In order to get access to the DDR classes it uses the Image classloader which, if the core file is DDR enabled, can see the required classes.
      Parameters:
      image - Image created from the core file
    • getDDRIObject

      public Object getDDRIObject()
      Description copied from interface: ICombinedContext
      A handle to the underlying DDR interactive session
      Specified by:
      getDDRIObject in interface ICombinedContext
      Returns:
      a valid session or null if the core file is not DDR enabled
    • getDDRStartupException

      public Throwable getDDRStartupException()
      Description copied from interface: ICombinedContext
      Get the exception which was thrown when trying to start a DDR interactive session.
      Specified by:
      getDDRStartupException in interface ICombinedContext
      Returns:
      the exception or null if the session started without error.
    • displayContext

      public void displayContext(IOutputManager out, boolean shortFormat)
      Description copied from interface: ICombinedContext
      Display the contexts which are present in the core file currently being analysed.
      Specified by:
      displayContext in interface ICombinedContext
      Parameters:
      shortFormat - true for short format which just displays the first line of the java -version string
    • setAsCurrent

      public void setAsCurrent()
      Description copied from interface: ICombinedContext
      Called when this context becomes the current context to allow any initialisation to take place.
      Specified by:
      setAsCurrent in interface ICombinedContext
    • isDDRAvailable

      public boolean isDDRAvailable()
      Description copied from interface: ICombinedContext
      Flag to indicate if an associated DDR context is available as well as the DTFJ one.
      Specified by:
      isDDRAvailable in interface ICombinedContext
      Returns:
      true if DDR is available