[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Justification for
scott.stark@jboss.org
do-not-reply at jboss.com
Thu Jul 27 11:51:33 EDT 2006
Its tied to resource cleanup, be it a thread, socket, file descriptor, memory, ...:
| Resource r = null;
| try
| {
| r = ...;
| }
| catch(Throwable t)
| {
| if( r != null )
| r.close();
| }
|
A method that declares a Throwable is an indication of a potential resource leak, or state transition inconsistency. More generally the issue is not having a complete state machine model of the subsystem and not explicitly dealing with the subsystem state when an error occurs. In this model unchecked vs checked exceptions related to whether or not the current system state can safely ignore the exception and transition correctly to the next state. If it can the exception can be unchecked. If it cannot the exception is checked and needs to be caught.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961329#3961329
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961329
More information about the jboss-dev-forums
mailing list