KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > exception > MortbayMultiExceptionHelper


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.exception;
5
6 import org.mortbay.util.MultiException;
7
8 public class MortbayMultiExceptionHelper implements ExceptionHelper {
9
10   public boolean accepts(Throwable JavaDoc t) {
11     return t instanceof MultiException;
12   }
13
14   public Throwable JavaDoc getProximateCause(Throwable JavaDoc t) {
15     if (t instanceof MultiException) {
16       MultiException m = (MultiException) t;
17       if (m.size() > 0) return m.getThrowable(0);
18     }
19     return t;
20   }
21
22   public Throwable JavaDoc getUltimateCause(Throwable JavaDoc t) {
23     throw new AssertionError JavaDoc();
24   }
25
26 }
27
Popular Tags