Java EE 5 SDK

com.sun.appserv.management.util.misc
Class ThrowableMapper

java.lang.Object
  extended by com.sun.appserv.management.util.misc.ThrowableMapper

public final class ThrowableMapper
extends Object

Maps a Throwable to another one in order to avoid the transfer of non-standard (proprietary) Exception types, which could result in ClassNotFoundException on remote clients.

Any Throwable which either is, or contains, a Throwable which is not in the allowed packages is converted.


Field Summary
protected static Set<String> OK_PACKAGES
          By default, any Throwable whose package does not start with one of these packages must be mapped to something standard.
 
Constructor Summary
ThrowableMapper(Throwable t)
           
 
Method Summary
 Throwable map()
          Map the original Throwable to one that is non-proprietary (standard).
static Throwable map(Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK_PACKAGES

protected static final Set<String> OK_PACKAGES
By default, any Throwable whose package does not start with one of these packages must be mapped to something standard.

Constructor Detail

ThrowableMapper

public ThrowableMapper(Throwable t)
Method Detail

map

public static Throwable map(Throwable t)

map

public Throwable map()
Map the original Throwable to one that is non-proprietary (standard). Possible results include java.lang.Exception, java.lang.RuntimeException, java.lang.Error. The original stack trace and exception chain is preserved, each element in that chain being mapped if necessary.

Returns:
a Throwable which uses only standard classes

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.