1. /*
  2. * @(#)ApplicationException.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA.portable;
  8. /**
  9. This class is used for reporting application level exceptions between ORBs and stubs.
  10. */
  11. public class ApplicationException extends Exception {
  12. /**
  13. * Constructs an ApplicationException from the CORBA repository ID of the exception
  14. * and an input stream from which the exception data can be read as its parameters.
  15. * @param id the repository id of the user exception
  16. * @param ins the stream which contains the user exception data
  17. */
  18. public ApplicationException(String id,
  19. InputStream ins) {
  20. this.id = id;
  21. this.ins = ins;
  22. }
  23. /**
  24. * Returns the CORBA repository ID of the exception
  25. * without removing it from the exceptions input stream.
  26. * @return The CORBA repository ID of this exception
  27. */
  28. public String getId() {
  29. return id;
  30. }
  31. /**
  32. * Returns the input stream from which the exception data can be read as its parameters.
  33. * @return The stream which contains the user exception data
  34. */
  35. public InputStream getInputStream() {
  36. return ins;
  37. }
  38. private String id;
  39. private InputStream ins;
  40. }