1. /*
  2. * @(#)RuntimeErrorException.java 4.19 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.management;
  8. /**
  9. * When a <CODE>java.lang.Error</CODE> occurs in the agent it should be caught and
  10. * re-thrown as a <CODE>RuntimeErrorException</CODE>.
  11. *
  12. * @since 1.5
  13. */
  14. public class RuntimeErrorException extends JMRuntimeException {
  15. /* Serial version */
  16. private static final long serialVersionUID = 704338937753949796L;
  17. /**
  18. * @serial The encapsulated {@link Error}
  19. */
  20. private java.lang.Error error ;
  21. /**
  22. * Default constructor.
  23. *
  24. * @param e the wrapped error.
  25. */
  26. public RuntimeErrorException(java.lang.Error e) {
  27. super();
  28. error = e ;
  29. }
  30. /**
  31. * Constructor that allows a specific error message to be specified.
  32. *
  33. * @param e the wrapped error.
  34. * @param message the detail message.
  35. */
  36. public RuntimeErrorException(java.lang.Error e, String message) {
  37. super(message);
  38. error = e ;
  39. }
  40. /**
  41. * Returns the actual {@link Error} thrown.
  42. *
  43. * @return the wrapped {@link Error}.
  44. */
  45. public java.lang.Error getTargetError() {
  46. return error ;
  47. }
  48. /**
  49. * Returns the actual {@link Error} thrown.
  50. *
  51. * @return the wrapped {@link Error}.
  52. */
  53. public Throwable getCause() {
  54. return error;
  55. }
  56. }