Title: Anirban%20De
1Exception Mechanisms
- Anirban De
- Jeffrey Harry
- Yves Lepouchard
- Peixin Li
- Pinchao Lu
2Why we should care about exceptions
- Ariane 5 Maiden Flight
- Computer automation is everywhere
- in your daily life
- in critical systems
- Exception handling
- Our project deals with
- Java
- THE HOT programming language
HOT
3Java Exception Handling
- Exceptions are objects
- Multilevel Model
- Termination Model
STOP!
Server
END
Try Workers Finally Cleaners Catch
Handlers
Check
Receive
4Exception Handling Enhancements
RESCUE-RETRY CONSTRUCT
/ Attempt to transmit a message 100 times and
set tx_successful / Public void
transmit_message(String message) if
(tx_failures lt 100) attempt_transmission(messag
e) tx_successful true else tx_successful
false / rescue tx_failures
tx_failures 1 retry /
5Exception Handling Enhancements
- Rescue-Retry added using JJTree and JavaCC
- JJTree is a bottom-up Parse Tree Builder
- JavaCC uses the output of JJTree to generate the
Lexer/Parser - Generates a top-down, recursive descent parser
- Partial EBNF Notation for Rescue-Retry
- void MethodBodyBlock( )
- RequireClause( ) ( BlockStatement( ) )
EnsureClause( ) RescueClause( ) - void RescueClause( )
- ltRESCUEgt (RescueCatch( ) )
ltASSRN_ENDgt - void RescueCatch( )
- ( "catch" "(" FormalParameter() ")" )? "" (
BlockStatement() RetryStatement() )
6Evaluation
- Things we sort of already knew...
- Java is slow, more Java is slower.
- Given a Java program, adding more Java is going
to make it larger.
We didnt know how much slower/larger...
7Evaluation
How much slower is Jass?
How much larger?
8Conclusion
Its a hog, its slow, its big...
Value inside (Safe, reusable error-free code.)
BUT...
9Java Exception Handling