Java Doc for UniversalRuntimeException.java in  » Web-Framework » RSF » uk » org » ponder » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » RSF » uk.org.ponder.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Throwable
      java.lang.Exception
         java.lang.RuntimeException
            uk.org.ponder.util.UniversalRuntimeException

UniversalRuntimeException
public class UniversalRuntimeException extends RuntimeException implements WrappingException(Code)
The root of unchecked runtime exceptions thrown by the libraries. There is a general movement to make most exceptions runtime exceptions, since exception specifications often add verbosity without facility.

Checked exceptions are most appropriate for signalling problems between libraries with a wide degree of separation. Within a single body of code, unchecked exceptions should be used to propagate error conditions to the next boundary. Does Java need Checked Exceptions?

This class has a useful (and growing) body of schemes for absorbing the target exceptions from other types of wrapping exceptions and rewrapping them.

What we wish to preserve is a) the ultimate stack trace from the cause of the problem and b) a set of increasingly detailed messages that can be accreted onto the exception as it winds up the stack.

The typical usage in client code looks as follows:

try { .... block generated checked or unchecked exceptions } catch (Exception e) { throw UniversalRuntimeException.accumulate(e, "What I learned in this catch block" ); } A UniversalRuntimeException also contains a Class representing its "category", a point in the inheritance hierarchy that may be used to classify the nature of exceptions, as being distinct from the wrapped target exception intended to record its cause. An object of the category need not ever be created, the inheritance hierachy may be queried via Class.isAssignableFrom().

The exception category defaults to the concrete class of the exception being wrapped.
author:
   Bosmon




Constructor Summary
public  UniversalRuntimeException(String s)
    
public  UniversalRuntimeException(Throwable t)
    

Method Summary
public static  UniversalRuntimeExceptionaccumulate(Throwable t, String extradetail)
     Accumulates the message supplied message onto the beginning of any existing exception message, and wraps supplied exception as the target exception of the returned UniversalRuntimeException.
public static  UniversalRuntimeExceptionaccumulate(Throwable t)
    
public static  UniversalRuntimeExceptionaccumulate(Throwable t, Class category, String extradetail)
    
public static  UniversalRuntimeExceptionaccumulateMsg(Throwable t, Class category, String fullmsg)
    
public static synchronized  voidaddUnwrapper(ExceptionUnwrapper muncher)
    
public  ClassgetCategory()
    
public  StringgetMessage()
    
public  StringgetStackHead()
    
public  StackTraceElement[]getStackTrace()
    
public  ThrowablegetTargetException()
    
public  voidprintStackTrace()
    
public  voidprintStackTrace(PrintWriter pw)
    
public  voidprintStackTrace(PrintStream ps)
    
public  voidsetCategory(Class category)
    
public static  ThrowableunwrapException(Throwable tounwrap)
    


Constructor Detail
UniversalRuntimeException
public UniversalRuntimeException(String s)(Code)



UniversalRuntimeException
public UniversalRuntimeException(Throwable t)(Code)




Method Detail
accumulate
public static UniversalRuntimeException accumulate(Throwable t, String extradetail)(Code)
Accumulates the message supplied message onto the beginning of any existing exception message, and wraps supplied exception as the target exception of the returned UniversalRuntimeException.

If the supplied exception is already a UniversalRuntimeException, the same object is returned.

If the supplied exception is a wrapping exception of one of the recognised kinds (InvocationTargetException, or if registered, ServletException &c), it is unwrapped and its target exception becomes the wrapped exception.
Parameters:
  t - An encountered exception, to be wrapped.
Parameters:
  fullmsg - The message to be added to the exceptions information.




accumulate
public static UniversalRuntimeException accumulate(Throwable t)(Code)
Used to "pass-through" an exception leaving its message unchanged



accumulate
public static UniversalRuntimeException accumulate(Throwable t, Class category, String extradetail)(Code)



accumulateMsg
public static UniversalRuntimeException accumulateMsg(Throwable t, Class category, String fullmsg)(Code)



addUnwrapper
public static synchronized void addUnwrapper(ExceptionUnwrapper muncher)(Code)



getCategory
public Class getCategory()(Code)



getMessage
public String getMessage()(Code)



getStackHead
public String getStackHead()(Code)



getStackTrace
public StackTraceElement[] getStackTrace()(Code)



getTargetException
public Throwable getTargetException()(Code)



printStackTrace
public void printStackTrace()(Code)



printStackTrace
public void printStackTrace(PrintWriter pw)(Code)



printStackTrace
public void printStackTrace(PrintStream ps)(Code)



setCategory
public void setCategory(Class category)(Code)



unwrapException
public static Throwable unwrapException(Throwable tounwrap)(Code)





Methods inherited from java.lang.Throwable
native public synchronized Throwable fillInStackTrace()(Code)(Java Doc)
public Throwable getCause()(Code)(Java Doc)
public String getLocalizedMessage()(Code)(Java Doc)
public String getMessage()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public synchronized Throwable initCause(Throwable cause)(Code)(Java Doc)
public void printStackTrace()(Code)(Java Doc)
public void printStackTrace(PrintStream s)(Code)(Java Doc)
public void printStackTrace(PrintWriter s)(Code)(Java Doc)
public void setStackTrace(StackTraceElement[] stackTrace)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.