[
https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugi...
]
Jason Porter edited comment on SEAMCATCH-4 at 2/19/11 2:25 PM:
---------------------------------------------------------------
I played around with some ideas and we may even be able to use this for the exception
mapping as well. Here are some prototype APIs.
{code:java}
/**
* A filter for processing the stack frames of a single exception (type parameter allows
us to focus on a specific exception type)
*/
public interface ExceptionStackFrameFilter<T extends Throwable>
{
public StackFrameFilterResult process(StackFrame frame);
}
public interface StackFrame
{
StackElement getStackElement();
StackTraceElement getStackTraceElement();
void mark(String tag);
StackFrame getMarkedFrame(String tag);
boolean isMarkSet(String tag);
void clearMark(String tag);
void setStackTraceElement(StackTraceElement element);
IterationStatus getIterationStatus();
}
public enum StackFrameFilterResult
{
/**
* Include this frame
*/
INCLUDE,
/**
* Drop this frame
*/
DROP,
/**
* Include this frame, but skip any remaining frames in this cause
*/
DROP_REMAINING,
/**
* Drop this frame and any remaining frames in this cause
*/
BREAK,
/**
* Stops processing any remaining frames or causes
*/
TERMINATE,
/**
* Include this frame, then stop processing any remaining frames or causes
*/
TERMINATE_AFTER
}
/**
* A filter for processing the chained exceptions (i.e., the causes)
*/
public interface ExceptionStackFilter
{
public StackFilterResult process(StackElement element);
}
public interface StackElement
{
Throwable getThrowable();
void setThrowable(Throwable throwable);
IterationStatus getIterationStatus();
}
public enum StackFilterResult
{
/**
* Include this throwable
*/
INCLUDE,
/**
* Drop this throwable, go to next in chain (if any)
*/
DROP,
/**
* Drop any remaining throwables in the chain
*/
DROP_REMAINING,
/**
* Drop throwable and any remaining in the chain
*/
TERMINATE
}
{code}
was (Author: dan.j.allen):
I played around with some ideas and we may even be able to use this for the exception
mapping as well. Here are some prototype APIs.
/**
* A filter for processing the stack frames of a single exception (type parameter allows
us to focus on a specific exception type)
*/
public interface ExceptionStackFrameFilter<T extends Throwable>
{
public StackFrameFilterResult process(StackFrame frame);
}
public interface StackFrame
{
StackElement getStackElement();
StackTraceElement getStackTraceElement();
void mark(String tag);
StackFrame getMarkedFrame(String tag);
boolean isMarkSet(String tag);
void clearMark(String tag);
void setStackTraceElement(StackTraceElement element);
IterationStatus getIterationStatus();
}
public enum StackFrameFilterResult
{
/**
* Include this frame
*/
INCLUDE,
/**
* Drop this frame
*/
DROP,
/**
* Include this frame, but skip any remaining frames in this cause
*/
DROP_REMAINING,
/**
* Drop this frame and any remaining frames in this cause
*/
BREAK,
/**
* Stops processing any remaining frames or causes
*/
TERMINATE,
/**
* Include this frame, then stop processing any remaining frames or causes
*/
TERMINATE_AFTER
}
/**
* A filter for processing the chained exceptions (i.e., the causes)
*/
public interface ExceptionStackFilter
{
public StackFilterResult process(StackElement element);
}
public interface StackElement
{
Throwable getThrowable();
void setThrowable(Throwable throwable);
IterationStatus getIterationStatus();
}
public enum StackFilterResult
{
/**
* Include this throwable
*/
INCLUDE,
/**
* Drop this throwable, go to next in chain (if any)
*/
DROP,
/**
* Drop any remaining throwables in the chain
*/
DROP_REMAINING,
/**
* Drop throwable and any remaining in the chain
*/
TERMINATE
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira