1. /*
  2. * @(#)file CommunicationException.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.19
  5. * @(#)lastedit 03/12/19
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp.daemon;
  12. // java import
  13. //
  14. import java.io.PrintStream;
  15. import java.io.PrintWriter;
  16. /**
  17. * Represents exceptions raised due to communications problems,
  18. * for example when a managed object server is out of reach.<p>
  19. *
  20. * <p><b>This API is a Sun Microsystems internal API and is subject
  21. * to change without notice.</b></p>
  22. * @version 1.19 12/19/03
  23. * @author Sun Microsystems, Inc
  24. */
  25. public class CommunicationException extends javax.management.JMRuntimeException {
  26. /* Serial version */
  27. private static final long serialVersionUID = -2499186113233316177L;
  28. /**
  29. * Constructs a CommunicationException with a target exception.
  30. */
  31. public CommunicationException(Throwable target) {
  32. super(target.getMessage());
  33. initCause(target);
  34. }
  35. /**
  36. * Constructs a CommunicationException with a target exception
  37. * and a detail message.
  38. */
  39. public CommunicationException(Throwable target, String msg) {
  40. super(msg);
  41. initCause(target);
  42. }
  43. /**
  44. * Constructs a CommunicationException with a detail message.
  45. */
  46. public CommunicationException(String msg) {
  47. super(msg);
  48. }
  49. /**
  50. * Get the thrown target exception.
  51. */
  52. public Throwable getTargetException() {
  53. return getCause();
  54. }
  55. }