org.modeshape.common.collection.ring

## Class GarbageCollectingConsumer

- java.lang.Object
- - org.modeshape.common.collection.ring.GarbageCollectingConsumer

- All Implemented Interfaces:
    AutoCloseable, Runnable, DependentOnPointers

      public class GarbageCollectingConsumer
      extends Object
      implements Runnable, AutoCloseable, DependentOnPointers

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `GarbageCollectingConsumer.Collectable`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TrailingPointer` | `trailingPointer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GarbageCollectingConsumer(Cursor cursor, Pointer cursorPointer, WaitStrategy waitStrategy, GarbageCollectingConsumer.Collectable collectable)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `boolean` | `ignore(Pointer pointer)` Ignore the specified pointer that cursor had previously `stayed behind`.
    `void` | `run()`
    `void` | `stayBehind(Pointer... pointers)` Ensure that this cursor always remains behind the specified pointer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### trailingPointer

          protected final TrailingPointer trailingPointer

  - ### Constructor Detail

    - #### GarbageCollectingConsumer

          public GarbageCollectingConsumer(Cursor cursor,
                                   Pointer cursorPointer,
                                   WaitStrategy waitStrategy,
                                   GarbageCollectingConsumer.Collectable collectable)

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`

    - #### ignore

          public boolean ignore(Pointer pointer)

      Description copied from interface: `DependentOnPointers`
      Ignore the specified pointer that cursor had previously `stayed behind`. This should be called when the supplied pointer is removed from the ring buffer.
      Specified by:
        `ignore` in interface `DependentOnPointers`
      Parameters:
        `pointer` - the pointer that this cursor may no longer depend upon
      Returns:
        true if this cursor did depend on the supplied pointer and now no longer does, or false if this cursor never dependent upon the supplied pointer

    - #### stayBehind

          public void stayBehind(Pointer... pointers)

      Description copied from interface: `DependentOnPointers`
      Ensure that this cursor always remains behind the specified pointer.
      Specified by:
        `stayBehind` in interface `DependentOnPointers`
      Parameters:
        `pointers` - the pointers that this cursor may not run past in the ring buffer

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.