BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.common
Interface RemoteTraceable


public interface RemoteTraceable

Throwables that implement this interface will be set with the stack trace before the Throwable is returned to the caller. This allows remote exceptions to communicate their stack trace to their callers.

WebLogic obtains the stacktrace from the callee by calling printStackTrace(PrintStream ps). To maintain remote-local transparency, write code that includes the check for null values of the internal field remoteStackTrace, as shown in this example:

public class MyException extends Exception, implements RemoteTraceable {
  private transient String remoteStackTrace;
 
  public void setStackTrace(String s) { remoteStackTrace = s;}

  // These printStackTrace methods are not part of the RemoteTraceable
  // interface. They are shown here as an example of how to 
  // maintain remote-local transparency.
  public void printStackTrace() {
     System.err.print(remoteStackTrace);
  }
 
  public void printStackTrace(PrintStream ps) {
     ps.print(remoteStackTrace);
  }

  public void printStackTrace(PrintWriter pw) {
    pw.print(remoteStackTrace);
  }
}

Author:
Copyright (c) 1998 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999 by BEA WebXpress. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.

Method Summary
 void setStackTrace(java.lang.String s)
          Sets a remote stack trace when the exception is instantiated, before it is returned to the caller.
 

Method Detail

setStackTrace

public void setStackTrace(java.lang.String s)
Sets a remote stack trace when the exception is instantiated, before it is returned to the caller.

Parameters:
s - A String that is a stack trace of a Throwable

Documentation is available at
http://www.weblogic.com/docs51