com.sun.enterprise.admin.cli.remote
Class ExceptionAnalyzer

java.lang.Object
  extended by com.sun.enterprise.admin.cli.remote.ExceptionAnalyzer

final class ExceptionAnalyzer
extends Object

An immutable class to analyze the exception stack trace of a given instance of Exception. Can be extended to handle throwables, but it is not done in this version on purpose. Takes the snapshot of given exception at the time of instantiation.

Since:
GlassFish v3 Prelude
Author:
केदार (km@dev.java.net)

Field Summary
private  List<Throwable> chain
           
private  Exception exc
           
 
Constructor Summary
ExceptionAnalyzer(Exception e)
           
 
Method Summary
private  void build()
           
(package private)  Throwable getFirstInstanceOf(Class<? extends Exception> ac)
          Returns the first instance of the given Exception class in the chain of causes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exc

private final Exception exc

chain

private final List<Throwable> chain
Constructor Detail

ExceptionAnalyzer

ExceptionAnalyzer(Exception e)
Method Detail

build

private void build()

getFirstInstanceOf

Throwable getFirstInstanceOf(Class<? extends Exception> ac)
Returns the first instance of the given Exception class in the chain of causes. The counting starts from the instance of the Exception that created the ExceptionAnalyzer class itself.

Parameters:
ac - the unknown subclass of Exception that needs the chain to be examined for
Returns:
first instance of given Throwable (returned object will be an instance of the given class) or null if there is no such instance


Copyright © 2012 GlassFish Community. All Rights Reserved.