FileDocCategorySizeDatePackage
StackTrace.javaAPI DocGlassfish v2 API3189Fri May 04 22:35:54 BST 2007com.sun.enterprise.tools.common.util.diagnostics

StackTrace

public class StackTrace extends Object
The class StackTrace is a simple class -- its toString() method generates a stack trace
author
Byron Nevins
see
com.sun.enterprise.tools.common.diagnostics.Reporter
since
iAB 6.0

Fields Summary
Throwable
throwable
This really should be private. Do not use this.
Constructors Summary
public StackTrace()
Creates a new StackTrace object, which is based at the execution location. This is useful for finding out who called a function.

		throwable = new Throwable();
	
public StackTrace(Throwable t)
create a stackTrace object for the given Throwable

param
t The Throwable that you are interested in.

		throwable = t;
	
Methods Summary
public java.lang.StringtoString()
Used by the Reporter class

return
The text of a stack trace.
see
Reporter

		ByteArrayOutputStream	baos	= new ByteArrayOutputStream();
		PrintWriter				pw		= new PrintWriter(baos);

		// create the stack trace
		throwable.printStackTrace(pw);
		pw.flush();
		return baos.toString();