- java.lang.Object
- 
- com.ibm.java.diagnostics.utils.commands.BaseCommand
- 
- com.ibm.jvm.dtfjview.commands.BaseJdmpviewCommand
 
 
- 
- All Implemented Interfaces:
- ICommand
 - Direct Known Subclasses:
- CdCommand,- CloseCommand,- DeadlockCommand,- FindCommand,- FindNextCommand,- FindPtrCommand,- HeapdumpCommand,- HelpCommand,- HexdumpCommand,- InfoClassCommand,- InfoHeapCommand,- InfoJitmCommand,- InfoLockCommand,- InfoMemoryCommand,- InfoMmapCommand,- InfoProcCommand,- InfoSymCommand,- InfoSystemCommand,- InfoThreadCommand,- LogCommand,- OpenCommand,- PwdCommand,- ScrollCommand,- SetHeapdumpCommand,- SetLoggingCommand,- ShowHeapdumpCommand,- ShowLoggingCommand,- SimpleRedirectorCommand,- WhatisCommand,- XCommand
 
 public abstract class BaseJdmpviewCommand extends BaseCommand This the base command for all jdmpview commands. It ensures consistent behaviour with the legacy commands without breaking the generic command encapsulation. There are a number of methods which allow DTFJ objects to be consistently displayed across different plugins e.g. getClassInfo(). Where the method name starts with getXYZ the output will be returned for further processing, however where the method starts with writeXYZ then the output is written immediately to the command's print stream.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classBaseJdmpviewCommand.ArtifactTypeEnum for identifying the type of artifact that is currently being analyzed.
 - 
Field SummaryFields Modifier and Type Field Description protected IDTFJContextctxprotected Stringhexfmtprotected Loggerloggerprotected PrintStreamout- 
Fields declared in class com.ibm.java.diagnostics.utils.commands.BaseCommandCOMMAND_FORMAT, config, nl, SUBCOMMAND_FORMAT
 
- 
 - 
Constructor SummaryConstructors Constructor Description BaseJdmpviewCommand()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringdecodeThreadState(int state)Textual description of a thread state.protected BaseJdmpviewCommand.ArtifactTypegetArtifactType()Determine the type of artifact currently being operated on.StringhandleException(Throwable cause)Lots of DTFJ methods will throw a standard set of exceptions such as corrupt data or data unavailable.booleaninitCommand(String command, String[] args, IContext context, PrintStream out)Common processing to initialize the command and make the porting of existing jdmpview commands easier.abstract voidprintDetailedHelp(PrintStream out)Print detailed help for a given commandStringtoHexString(byte num)Format a number with the correct number of zeros as padding according to the data type passed in.StringtoHexString(int num)Format a number with the correct number of zeros as padding according to the data type passed in.StringtoHexString(long num)Format a number with the correct number of zeros as padding according to the data type passed in.StringtoHexString(short num)Format a number with the correct number of zeros as padding according to the data type passed in.StringtoHexStringAddr(long num)Format an address as hex padded with zeros according to the size of the process.longtoLong(String number)Typically used when an extension takes a numeric argument, and wants to accept a variety of formats.StringtoString(double num)Convenience method to convert a number into a String to display.StringtoString(float num)Convenience method to convert a number into a String to display.- 
Methods declared in class com.ibm.java.diagnostics.utils.commands.BaseCommandaddCommand, addSubCommand, setConfig
 - 
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods declared in interface com.ibm.java.diagnostics.utils.commands.ICommandgetCommandDescriptions, getCommandNames, getConfig, recognises, run
 
- 
 
- 
- 
- 
Field Detail- 
outprotected PrintStream out 
 - 
ctxprotected IDTFJContext ctx 
 - 
loggerprotected Logger logger 
 - 
hexfmtprotected String hexfmt 
 
- 
 - 
Method Detail- 
printDetailedHelppublic abstract void printDetailedHelp(PrintStream out) Print detailed help for a given command- Parameters:
- out- stream to write the output to
 
 - 
initCommandpublic final boolean initCommand(String command, String[] args, IContext context, PrintStream out) throws CommandException Common processing to initialize the command and make the porting of existing jdmpview commands easier.- Parameters:
- command- the command being executed
- args- the supplied arguments
- context- the context within which it is operating
- out- where to write the output
- Returns:
- returns true if this method has handled the output and the subclass should exit
- Throws:
- CommandException
 
 - 
toLongpublic long toLong(String number) Typically used when an extension takes a numeric argument, and wants to accept a variety of formats. Currently it will support decimal or hexadecimal formats.- Parameters:
- number- String representation of the number to parse
- Returns:
- the numeric value
 
 - 
getArtifactTypeprotected BaseJdmpviewCommand.ArtifactType getArtifactType() Determine the type of artifact currently being operated on.- Returns:
- artifact type
 
 - 
toHexStringAddrpublic String toHexStringAddr(long num) Format an address as hex padded with zeros according to the size of the process. e.g. 17 would be formatted as 0x00000011 for 32 bit and 0x0000000000000011 for 64 bit- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
handleExceptionpublic String handleException(Throwable cause) Lots of DTFJ methods will throw a standard set of exceptions such as corrupt data or data unavailable. This method provides a central point for handling these exceptions and attempts to provide more context as to whether or not this is an expected occurrence for the artifact type under analysis.- Parameters:
- cause- the exception returned from a call to the DTFJ API
- Returns:
- formatted string for displaying to the user
 
 - 
decodeThreadStatepublic String decodeThreadState(int state) Textual description of a thread state.- Parameters:
- state- state to convert
- Returns:
- cumulative description of the states
 
 - 
toHexStringpublic String toHexString(long num) Format a number with the correct number of zeros as padding according to the data type passed in.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
toHexStringpublic String toHexString(short num) Format a number with the correct number of zeros as padding according to the data type passed in.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
toHexStringpublic String toHexString(int num) Format a number with the correct number of zeros as padding according to the data type passed in.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
toHexStringpublic String toHexString(byte num) Format a number with the correct number of zeros as padding according to the data type passed in.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
toStringpublic String toString(float num) Convenience method to convert a number into a String to display.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 - 
toStringpublic String toString(double num) Convenience method to convert a number into a String to display.- Parameters:
- num- the number to format
- Returns:
- formatted number
 
 
- 
 
-