org.hopto.pentaj.jexin.stacktrace
Class StackTraceTemplate
java.lang.Object
org.hopto.pentaj.jexin.stacktrace.StackTraceTemplate
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<StackTraceTemplate>
public class StackTraceTemplate
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Comparable<StackTraceTemplate>
Used to inject errors during a running StackTrace
. The incoming StackFrame
s will be compared to the
StackFrameTemplate
s contained herein and as long as they match in sequence any injected exception definitions in the
corresponding StackFrameTemplate
will be injected into the running node at that point in the execution path.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StackTraceTemplate
public StackTraceTemplate(int id,
CompletedStackTrace completedTrace)
- Parameters:
id
- completedTrace
-
StackTraceTemplate
public StackTraceTemplate(int id,
java.lang.String name,
CompletedStackTrace completedTrace)
- Parameters:
id
- name
- completedTrace
-
getId
public int getId()
- Returns:
- the id used by the
StackTraceManager
getName
public java.lang.String getName()
- Returns:
- the name
getCreatedTime
public java.util.Date getCreatedTime()
- Returns:
- The date/time this template was created
getInjectableExceptions
public java.util.List<InjectableException> getInjectableExceptions()
- Returns:
- The exceptions that can be injected
setName
public void setName(java.lang.String name)
- Parameters:
name
- the name to set
getAddress
public NodeAddress getAddress()
- Returns:
- the address
isActive
public boolean isActive()
- Returns:
- True if this template is active, false if it isn't
setActive
public void setActive(boolean active)
- Parameters:
active
- True if this template is active, false if it isn't
getStackFrameTemplates
public java.util.List<StackFrameTemplate> getStackFrameTemplates()
- Returns:
- the stackFrameTemplates
getMatchingBeforeTemplate
public StackFrameTemplate getMatchingBeforeTemplate(StackFrame stackFrame)
- Parameters:
stackFrame
-
- Returns:
- The
StackFrameTemplate
that matches the stackFrame at its traceIndex before method call. Null if there is
no match.
getMatchingAfterTemplate
public StackFrameTemplate getMatchingAfterTemplate(StackFrame stackFrame)
- Parameters:
stackFrame
-
- Returns:
- The
StackFrameTemplate
that matches the stackFrame at its traceIndex after method call. Null if there is no
match. It is assumed that getMatchingBeforeTemplate was already successful for this same stackFrame.
isStackEndIndex
public boolean isStackEndIndex(int stackIndex)
- This is called for the open
StackTrace
when its pop method returns true to determine if this trace template ends
with the same frame as the open StackTrace
.
- Parameters:
stackIndex
-
- Returns:
- True if stackIndex is the index of the last frame in the stack list
compareTo
public int compareTo(StackTraceTemplate o)
- Specified by:
compareTo
in interface java.lang.Comparable<StackTraceTemplate>
- See Also:
Comparable.compareTo(java.lang.Object)