[seam-issues] [JBoss JIRA] Issue Comment Edited: (SEAMCATCH-4) Include the ability to filter stack traces

Jason Porter (JIRA) jira-events at lists.jboss.org
Sat Feb 19 14:27:13 EST 2011


    [ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569366#comment-12569366 ] 

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
}
  
> Include the ability to filter stack traces
> ------------------------------------------
>
>                 Key: SEAMCATCH-4
>                 URL: https://issues.jboss.org/browse/SEAMCATCH-4
>             Project: Seam Catch
>          Issue Type: Feature Request
>            Reporter: Jason Porter
>            Assignee: Jason Porter
>             Fix For: 3.0.0.CR1
>
>
> Catch should draw from ideas such as:
> - http://www.docjar.org/html/api/org/apache/commons/lang/exception/NestableDelegate.java.html
> - http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-exception-info
> - http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html
> - http://pastebin.com/p8aCSeuu

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list