1. /*
  2. * @(#)IndirectionException.java 1.12 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. /*
  8. * Licensed Materials - Property of IBM
  9. * RMI-IIOP v1.0
  10. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  11. *
  12. * US Government Users Restricted Rights - Use, duplication or
  13. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  14. */
  15. package org.omg.CORBA.portable;
  16. import org.omg.CORBA.SystemException;
  17. /**
  18. * The Indirection exception is a Java specific system exception.
  19. * It is thrown when the ORB's input stream is called to demarshal
  20. * a value that is encoded as an indirection that is in the process
  21. * of being demarshaled. This can occur when the ORB input stream
  22. * calls the ValueHandler to demarshal an RMI value whose state
  23. * contains a recursive reference to itself. Because the top-level
  24. * ValueHandler.read_value() call has not yet returned a value,
  25. * the ORB input stream's indirection table does not contain an entry
  26. * for an object with the stream offset specified by the indirection
  27. * tag. The stream offset is returned in the exception's offset field.
  28. * @see org.omg.CORBA_2_3.portable.InputStream
  29. * @see org.omg.CORBA_2_3.portable.OuputStream
  30. */
  31. public class IndirectionException extends SystemException {
  32. /**
  33. * Points to the stream's offset.
  34. */
  35. public int offset;
  36. /**
  37. * Creates an IndirectionException with the right offset value.
  38. * The stream offset is returned in the exception's offset field.
  39. * This exception is constructed and thrown during reading
  40. * recursively defined values off of a stream.
  41. *
  42. * @param offset the stream offset where recursion is detected.
  43. */
  44. public IndirectionException(int offset){
  45. super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
  46. this.offset = offset;
  47. }
  48. }