Author: buildbot
Date: Mon Jul 14 09:52:16 2014
New Revision: 916158
Log:
Staging update by buildbot for deltaspike
Modified:
websites/staging/deltaspike/trunk/content/ (props changed)
websites/staging/deltaspike/trunk/content/core.html
Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jul 14 09:52:16 2014
@@ -1 +1 @@
-1610368
+1610369
Modified: websites/staging/deltaspike/trunk/content/core.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/core.html (original)
+++ websites/staging/deltaspike/trunk/content/core.html Mon Jul 14 09:52:16 2014
@@ -121,20 +121,20 @@ Notice: Licensed to the Apache Softwa
</li>
<li><a href="#injecting-resources">Injecting Resources</a></li>
<li><a href="#exception-control">Exception Control</a><ul>
-<li><a href="#exception-handling-usage">Exception Handling - Usage</a><ul>
+<li><a href="#usage">Usage</a><ul>
<li><a href="#eventing-into-the-exception-handling-framework">Eventing into
the exception handling framework</a></li>
</ul>
</li>
<li><a href="#exception-handlers">Exception handlers</a><ul>
-<li><a href="#exception-handler-annotations">Exception handler
annotations</a><ul>
+<li><a href="#annotations">Annotations</a><ul>
<li><a href="#exceptionhandler">@ExceptionHandler</a></li>
<li><a href="#handles-and-beforehandles">@Handles and @BeforeHandles</a></li>
</ul>
</li>
+<li><a href="#ordinal">Ordinal</a></li>
</ul>
</li>
<li><a href="#exception-chain-processing">Exception Chain Processing</a></li>
-<li><a href="#handler-ordinal">Handler ordinal</a></li>
<li><a href="#apis-for-exception-information-and-flow-control">APIs for
exception information and flow control</a><ul>
<li><a href="#exceptionevent">ExceptionEvent</a></li>
</ul>
@@ -557,8 +557,7 @@ infrastructure.</p>
most cases, you register an exception handler simply by annotating a handler
method. Alternatively, you can handle an exception programmatically, just as
you would observe an event in CDI.</p>
-<h3 id="exception-handling-usage">Exception Handling - Usage</h3>
-<hr />
+<h3 id="usage">Usage</h3>
<h4 id="eventing-into-the-exception-handling-framework">Eventing into the
exception handling framework</h4>
<p>The entire exception handling process starts with an event. This helps keep
your application minimally coupled to DeltaSpike, but also allows for further
@@ -592,7 +591,6 @@ class for use later within a try/catch b
<p>The event is fired with a new instance of
<code>ExceptionToCatchEvent</code> constructed
with the exception to be handled.</p>
<h3 id="exception-handlers">Exception handlers</h3>
-<hr />
<p>As an application developer (i.e., an end user of DeltaSpike's exception
handling), you'll be focused on writing exception handlers. An exception
handler is a method on a CDI bean that is invoked to handle a specific type of
@@ -617,7 +615,7 @@ called.</p>
<p>Exception handlers are considered equal if they both handle the same
exception
class, have the same qualifiers, the same ordinal and the same value for
<code>isBeforeHandler()</code>.</p>
-<h4 id="exception-handler-annotations">Exception handler annotations</h4>
+<h4 id="annotations">Annotations</h4>
<p>Exception handlers are contained within exception handler beans, which are
CDI
beans annotated with <code>@ExceptionHandler</code>. Exception handlers are
methods
which have a parameter which is an instance of <code>ExceptionEvent<T
extends
@@ -723,8 +721,39 @@ muted), unless it re-enables itself by i
exceptions. Should a handler throw an unchecked exception it will propagate up
the stack and all handling done via DeltaSpike will cease. Any exception that
was being handled will be lost.</p>
+<h4 id="ordinal">Ordinal</h4>
+<p>When DeltaSpike finds more than one handler for the same exception type, it
+orders the handlers by ordinal. Handlers with higher ordinal are executed
+before handlers with a lower ordinal. If DeltaSpike detects two handlers for
+the same type with the same ordinal, the order is non-deterministic.</p>
+<p>Let's define two handlers with different ordinals:</p>
+<div class="codehilite"><pre><span class="kt">void</span> <span
class="nf">handleIOExceptionFirst</span><span class="o">(</span><span
class="nd">@Handles</span><span class="o">(</span><span
class="n">ordinal</span> <span class="o">=</span> <span
class="mi">100</span><span class="o">)</span> <span
class="n">ExceptionEvent</span><span class="o"><</span><span
class="n">IOException</span><span class="o">></span> <span
class="n">evt</span><span class="o">)</span>
+<span class="o">{</span>
+ <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span
class="na">println</span><span class="o">(</span><span class="s">"Invoked
first"</span><span class="o">);</span>
+<span class="o">}</span>
+
+<span class="kt">void</span> <span
class="nf">handleIOExceptionSecond</span><span class="o">(</span><span
class="nd">@Handles</span> <span class="n">ExceptionEvent</span><span
class="o"><</span><span class="n">IOException</span><span
class="o">></span> <span class="n">evt</span><span class="o">)</span>
+<span class="o">{</span>
+ <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span
class="na">println</span><span class="o">(</span><span
class="err">â</span><span class="n">Invoked</span> <span
class="n">second</span><span class="err">â</span><span class="o">);</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>The first method is invoked first since it has a higher ordinal (100) than
the
+second method, which has the default ordinal (0).</p>
+<p>To summarize, here's how DeltaSpike determines the order of handlers to
invoke
+(until a handler marks exception as handled):</p>
+<ol>
+<li>Unwrap exception stack</li>
+<li>Begin processing root cause</li>
+<li>Invoke any callback methods annotated with @BeforeHandles for the
+ closest type to the exception</li>
+<li>Find handler for the closest type to the exception</li>
+<li>If multiple handlers for same type, invoke handlers with higher
+ ordinal first</li>
+<li>Continue above steps for each exception in stack</li>
+</ol>
<h3 id="exception-chain-processing">Exception Chain Processing</h3>
-<hr />
<p>When an exception is thrown, chances are it's nested (wrapped) inside other
exceptions. (If you've ever examined a server log, you'll appreciate this
fact). The collection of exceptions in its entirety is termed an exception
@@ -764,41 +793,7 @@ order:</p>
<p>If there's a handler for <code>PersistenceException</code>, it will likely
prevent the
handlers for <code>EJBException</code> from being invoked, which is a good
thing since
what useful information can really be obtained from
<code>EJBException</code>?</p>
-<h3 id="handler-ordinal">Handler ordinal</h3>
-<hr />
-<p>When DeltaSpike finds more than one handler for the same exception type, it
-orders the handlers by ordinal. Handlers with higher ordinal are executed
-before handlers with a lower ordinal. If DeltaSpike detects two handlers for
-the same type with the same ordinal, the order is non-deterministic.</p>
-<p>Let's define two handlers with different ordinals:</p>
-<div class="codehilite"><pre><span class="kt">void</span> <span
class="nf">handleIOExceptionFirst</span><span class="o">(</span><span
class="nd">@Handles</span><span class="o">(</span><span
class="n">ordinal</span> <span class="o">=</span> <span
class="mi">100</span><span class="o">)</span> <span
class="n">ExceptionEvent</span><span class="o"><</span><span
class="n">IOException</span><span class="o">></span> <span
class="n">evt</span><span class="o">)</span>
-<span class="o">{</span>
- <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span
class="na">println</span><span class="o">(</span><span class="s">"Invoked
first"</span><span class="o">);</span>
-<span class="o">}</span>
-
-<span class="kt">void</span> <span
class="nf">handleIOExceptionSecond</span><span class="o">(</span><span
class="nd">@Handles</span> <span class="n">ExceptionEvent</span><span
class="o"><</span><span class="n">IOException</span><span
class="o">></span> <span class="n">evt</span><span class="o">)</span>
-<span class="o">{</span>
- <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span
class="na">println</span><span class="o">(</span><span
class="err">â</span><span class="n">Invoked</span> <span
class="n">second</span><span class="err">â</span><span class="o">);</span>
-<span class="o">}</span>
-</pre></div>
-
-
-<p>The first method is invoked first since it has a higher ordinal (100) than
the
-second method, which has the default ordinal (0).</p>
-<p>To summarize, here's how DeltaSpike determines the order of handlers to
invoke
-(until a handler marks exception as handled):</p>
-<ol>
-<li>Unwrap exception stack</li>
-<li>Begin processing root cause</li>
-<li>Invoke any callback methods annotated with @BeforeHandles for the
- closest type to the exception</li>
-<li>Find handler for the closest type to the exception</li>
-<li>If multiple handlers for same type, invoke handlers with higher
- ordinal first</li>
-<li>Continue above steps for each exception in stack</li>
-</ol>
<h3 id="apis-for-exception-information-and-flow-control">APIs for exception
information and flow control</h3>
-<hr />
<p>There are two APIs provided by DeltaSpike that should be familiar to
application developers:</p>
<ul>