Exception (Exception)

ARCHITECTURAL Role

This pattern is unrestricted; it is used within any architectural layer.

BEHAVIOR DEFINED

A PED Exception (Exception) supports multiple behaviors beyond those provided by the Java specification.

  • Guarantees self-logging once and only once (configurable)
  • Guarantees self-emailing once and only once (configurable)
  • May be extended (or used compositionally) for behaviors such as:
    • JAX-WS self-faulting
    • JAX-RS self-responding
    • Self-auditing etc.
Structural Characteristics

Characteristic

Recommended

Note

 Extend Base Class Y  
 No-arg Constructor N  
 CDI Scoping None  
 Instance State Optional  1.
 Static Public Methods (enum} N  
 Fluent Methods Optional  
 Delegate to Helper Y 2.
 Worker-thread Safe N  
  1. Stateful Exceptions can enable enhanced functionality.
  2. Value-add functions, like self-logging, may be handled in a Helper class.
Source Example