1. /*
  2. * @(#)RuntimeOperationsException.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. * Represents runtime exceptions thrown in the agent when performing operations on MBeans.
  10. * It wraps the actual <CODE>java.lang.RuntimeException</CODE> thrown.
  11. *
  12. * @since 1.5
  13. */
  14. public class RuntimeOperationsException extends JMRuntimeException {
  15. /* Serial version */
  16. private static final long serialVersionUID = -8408923047489133588L;
  17. /**
  18. * @serial The encapsulated {@link RuntimeException}
  19. */
  20. private java.lang.RuntimeException runtimeException ;
  21. /**
  22. * Creates a <CODE>RuntimeOperationsException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE>.
  23. *
  24. * @param e the wrapped exception.
  25. */
  26. public RuntimeOperationsException(java.lang.RuntimeException e) {
  27. super() ;
  28. runtimeException = e ;
  29. }
  30. /**
  31. * Creates a <CODE>RuntimeOperationsException</CODE> that wraps the actual <CODE>java.lang.RuntimeException</CODE>
  32. * with a detailed message.
  33. *
  34. * @param e the wrapped exception.
  35. * @param message the detail message.
  36. */
  37. public RuntimeOperationsException(java.lang.RuntimeException e, String message) {
  38. super(message);
  39. runtimeException = e ;
  40. }
  41. /**
  42. * Returns the actual {@link RuntimeException} thrown.
  43. *
  44. * @return the wrapped {@link RuntimeException}.
  45. */
  46. public java.lang.RuntimeException getTargetException() {
  47. return runtimeException ;
  48. }
  49. /**
  50. * Returns the actual {@link RuntimeException} thrown.
  51. *
  52. * @return the wrapped {@link RuntimeException}.
  53. */
  54. public Throwable getCause() {
  55. return runtimeException;
  56. }
  57. }