home *** CD-ROM | disk | FTP | other *** search
- package javax.management;
-
- import java.io.PrintStream;
- import java.io.PrintWriter;
-
- public class RuntimeOperationsException extends JMRuntimeException {
- private static final long serialVersionUID = -8408923047489133588L;
- private RuntimeException runtimeException;
-
- public RuntimeOperationsException() {
- }
-
- public RuntimeOperationsException(String message) {
- super(message);
- }
-
- public RuntimeOperationsException(RuntimeException x) {
- this.runtimeException = x;
- }
-
- public RuntimeOperationsException(RuntimeException x, String message) {
- super(message);
- this.runtimeException = x;
- }
-
- public RuntimeException getTargetException() {
- return this.runtimeException;
- }
-
- public String getMessage() {
- String msg = "";
- String m1 = super.getMessage();
- if (m1 != null) {
- msg = msg + m1;
- }
-
- if (this.runtimeException != null) {
- String m2 = this.runtimeException.toString();
- if (m2 != null) {
- msg = msg + "nested exception is " + m2;
- }
- }
-
- return msg;
- }
-
- public void printStackTrace() {
- if (this.runtimeException == null) {
- super.printStackTrace();
- } else {
- synchronized(System.err) {
- System.err.println(this);
- this.runtimeException.printStackTrace();
- }
- }
-
- }
-
- public void printStackTrace(PrintStream s) {
- if (this.runtimeException == null) {
- super.printStackTrace(s);
- } else {
- synchronized(s) {
- s.println(this);
- this.runtimeException.printStackTrace(s);
- }
- }
-
- }
-
- public void printStackTrace(PrintWriter w) {
- if (this.runtimeException == null) {
- super.printStackTrace(w);
- } else {
- synchronized(w) {
- w.println(this);
- this.runtimeException.printStackTrace(w);
- }
- }
-
- }
- }
-