- java.lang.Object
-
- com.ibm.jvm.trace.format.api.Message
-
public final class Message extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Message.Arg
class
Message.CharArg
class
Message.Double_Arg
class
Message.FixedStringArg
class
Message.Float_Arg
class
Message.I32_Arg
class
Message.I64_Arg
class
Message.PointerArg
class
Message.StringArg
class
Message.U32_Arg
class
Message.U64_Arg
class
Message.UTF8StringArg
-
Constructor Summary
Constructors Constructor Description Message(int type, String message, int id, int level, String component, String symbol, TraceContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStatistic(String key, long value)
static Message.Arg[]
getArgumentDetails(String template, int bytesPerPointer, StringBuffer templateErrors)
protected String
getComponent()
returns the component this message corresponds to, as determined by the message fileprotected String
getFormattingTemplate()
protected int
getLevel()
returns the level of the component so it's possible to distinguish between the default always on set and user enabled trace pointsString
getMessage(byte[] buffer, int offset, int end)
retrieve the text of the message, parsing any percent directives and replacing them with data from the bufferProperties
getStatistics()
protected int
getType()
returns the type of entry this message corresponds to, as determined by the message file and TraceRecordprotected static void
padBuffer(StringBuilder sb, int i, char c)
protected static void
padBuffer(StringBuilder sb, int i, char c, boolean leftJustified)
protected Object[]
parseMessage(byte[] buffer, int offset)
parse the raw message into an array of the appropriate wrapped types.protected StringBuilder
processPercents(String str, byte[] buffer, int offset)
process all the percent sign directives in a string, much like a call to printfprotected void
setPointerSize(int size)
protected StringBuilder
skipPercents(String str, byte[] buffer, int offset)
process all the percent sign directives in a string, making them "???"
-
-
-
Constructor Detail
-
Message
public Message(int type, String message, int id, int level, String component, String symbol, TraceContext context)
-
-
Method Detail
-
addStatistic
public void addStatistic(String key, long value)
-
getStatistics
public Properties getStatistics()
-
getArgumentDetails
public static Message.Arg[] getArgumentDetails(String template, int bytesPerPointer, StringBuffer templateErrors)
-
padBuffer
protected static final void padBuffer(StringBuilder sb, int i, char c)
-
padBuffer
protected static final void padBuffer(StringBuilder sb, int i, char c, boolean leftJustified)
-
processPercents
protected StringBuilder processPercents(String str, byte[] buffer, int offset)
process all the percent sign directives in a string, much like a call to printf- Parameters:
str
- a string- Returns:
- the string with percent directive replaces by their associated values
-
skipPercents
protected StringBuilder skipPercents(String str, byte[] buffer, int offset)
process all the percent sign directives in a string, making them "???"- Parameters:
str
- a string- Returns:
- the string with percent directives replaced by "???"
-
setPointerSize
protected void setPointerSize(int size)
-
getMessage
public String getMessage(byte[] buffer, int offset, int end)
retrieve the text of the message, parsing any percent directives and replacing them with data from the buffer- Parameters:
buffer
- an array of bytesoffset
- an int- Returns:
- a string that is the message from the file with any percent directives replaces by data from the buffer
-
getComponent
protected String getComponent()
returns the component this message corresponds to, as determined by the message file- Returns:
- an String that is component from which this message came from
-
getLevel
protected int getLevel()
returns the level of the component so it's possible to distinguish between the default always on set and user enabled trace points- Returns:
- the level of the trace point, -1 if not applicable
-
getType
protected int getType()
returns the type of entry this message corresponds to, as determined by the message file and TraceRecord- Returns:
- an int that is one of the types defined in TraceRecord
- See Also:
TraceRecord
-
getFormattingTemplate
protected String getFormattingTemplate()
-
parseMessage
protected Object[] parseMessage(byte[] buffer, int offset)
parse the raw message into an array of the appropriate wrapped types.- Parameters:
buffer
- an array of bytes that is the raw data to formatoffset
- an int representing the offset into buffer to start.- Returns:
- an array of wrapped types representing the parsed raw data.
-
-