Package org.apache.juneau.rest.stats
Class ThrownStore
java.lang.Object
org.apache.juneau.rest.stats.ThrownStore
An in-memory cache of thrown exceptions.
 
Used for preventing duplication of stack traces in log files and replacing them with small hashes.
See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ThrownStoreIdentifies a single global store for the entire JVM.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds the specified thrown exception to this database.static ThrownStore.Buildercreate()Static creator.static ThrownStore.BuilderStatic creator.Converts the stack trace for the specified throwable into a simple list of strings.getStats()Returns the list of all stack traces in this database.getStats(long hash) Retrieves the stack trace information for the exception with the specified hash as calculated byhash(Throwable).Retrieves the stats for the specified thrown exception.protected longCalculates a 32-bit hash for the specified throwable based on the stack trace generated bycreateStackTrace(Throwable).protected booleanReturnstrue if the specified stack trace element should be included increateStackTrace(Throwable).protected StringConverts the specified stack trace element into a normalized string.voidreset()Clears out the stack trace cache.
- 
Field Details- 
GLOBALIdentifies a single global store for the entire JVM.
 
- 
- 
Constructor Details- 
ThrownStorepublic ThrownStore()Constructor.
- 
ThrownStoreConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createStatic creator.- Parameters:
- beanStore- The bean store to use for creating beans.
- Returns:
- A new builder for this object.
 
- 
createStatic creator.- Returns:
- A new builder for this object.
 
- 
addAdds the specified thrown exception to this database.- Parameters:
- e- The exception to add.
- Returns:
- This object.
 
- 
getStatsRetrieves the stats for the specified thrown exception.- Parameters:
- e- The exception.
- Returns:
- A clone of the stats, never null .
 
- 
getStatsRetrieves the stack trace information for the exception with the specified hash as calculated byhash(Throwable).- Parameters:
- hash- The hash of the exception.
- Returns:
- A clone of the stack trace info, never null .
 
- 
getStatsReturns the list of all stack traces in this database.- Returns:
- The list of all stack traces in this database, cloned and sorted by count descending.
 
- 
resetClears out the stack trace cache.
- 
hashCalculates a 32-bit hash for the specified throwable based on the stack trace generated bycreateStackTrace(Throwable).Subclasses can override this method to provide their own implementation. - Parameters:
- t- The throwable to calculate the stack trace on.
- Returns:
- A calculated hash.
 
- 
createStackTraceConverts the stack trace for the specified throwable into a simple list of strings.The stack trace elements for the throwable are sent through normalize(StackTraceElement)to convert them to simple strings.- Parameters:
- t- The throwable to create the stack trace for.
- Returns:
- A modifiable list of strings.
 
- 
includeReturnstrue if the specified stack trace element should be included increateStackTrace(Throwable).- Parameters:
- e- The stack trace element.
- Returns:
- true if the specified stack trace element should be included in- createStackTrace(Throwable).
 
- 
normalizeConverts the specified stack trace element into a normalized string.The default implementation simply replaces "\\$.*" with"..." which should take care of stuff like stack trace elements of lambda expressions.- Parameters:
- e- The stack trace element to convert.
- Returns:
- The converted stack trace element.
 
 
-