1. /*
  2. * @(#)BufferManagerRead.java 1.15 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 com.sun.corba.se.impl.encoding;
  8. import java.nio.ByteBuffer;
  9. import com.sun.corba.se.impl.encoding.ByteBufferWithInfo;
  10. import com.sun.corba.se.impl.protocol.giopmsgheaders.FragmentMessage;
  11. import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
  12. public interface BufferManagerRead
  13. {
  14. /**
  15. * Case: Called from ReaderThread on complete message or fragments.
  16. * The given buf may be entire message or a fragment.
  17. *
  18. * The ReaderThread finds the ReadBufferManager instance either in
  19. * in a fragment map (when collecting - GIOP 1.2 phase 1) or
  20. * in an active server requests map (when streaming - GIOP 1.2 phase 2).
  21. *
  22. * As a model for implementation see IIOPInputStream's
  23. * constructor of the same name. There are going to be some variations.
  24. *
  25. */
  26. public void processFragment ( ByteBuffer byteBuffer,
  27. FragmentMessage header);
  28. /**
  29. * Case: called from CDRInputStream constructor before unmarshaling.
  30. *
  31. * Does:
  32. *
  33. * this.bufQ.get()
  34. *
  35. * If streaming then sync on bufQ and wait if empty.
  36. */
  37. /**
  38. * Case: called from CDRInputStream.grow.
  39. *
  40. * Does:
  41. *
  42. * this.bufQ.get()
  43. *
  44. * If streaming then sync on bufQ and wait if empty.
  45. */
  46. public ByteBufferWithInfo underflow (ByteBufferWithInfo bbwi);
  47. /**
  48. * Called once after creating this buffer manager and before
  49. * it begins processing.
  50. */
  51. public void init(Message header);
  52. /**
  53. * Returns the mark/reset handler for this stream.
  54. */
  55. public MarkAndResetHandler getMarkAndResetHandler();
  56. /*
  57. * Signals that the processing be cancelled.
  58. */
  59. public void cancelProcessing(int requestId);
  60. /*
  61. * Close BufferManagerRead and perform any oustanding cleanup.
  62. */
  63. public void close(ByteBufferWithInfo bbwi);
  64. }