Class Writer.Reentrant

  • Enclosing interface:
    Writer<L>

    public static final class Writer.Reentrant
    extends java.lang.Object
    Write reentrants counter
    • Constructor Summary

      Constructors 
      Constructor Description
      Reentrant()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean dec()
      Decrements the reentrants counter by one.
      int get()
      Returns the value of the reentrants counter for the current thread.
      static int getMaxReentrants()
      Returns the maximum number of write() method reentrants a thread is allowed to made.
      static Writer.Reentrant getWriteReentrant()
      Returns the current write reentrants counter.
      boolean inc()
      Increments the reentrants counter by one.
      boolean isMaxReentrantsReached()
      Returns true, if max number of write->completion-handler reentrants has been reached for the passed Writer.Reentrant object, and next write will happen in the separate thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Reentrant

        public Reentrant()
    • Method Detail

      • getMaxReentrants

        public static int getMaxReentrants()
        Returns the maximum number of write() method reentrants a thread is allowed to made. This is related to possible write()->onComplete()->write()->... chain, which may grow infinitely and cause StackOverflow. Using maxWriteReentrants value it's possible to limit such a chain.
        Returns:
        the maximum number of write() method reentrants a thread is allowed to make.
      • get

        public int get()
        Returns the value of the reentrants counter for the current thread.
      • inc

        public boolean inc()
        Increments the reentrants counter by one.
        Returns:
        true if the counter (after incrementing) didn't reach getMaxReentrants() limit, or false otherwise.
      • dec

        public boolean dec()
        Decrements the reentrants counter by one.
        Returns:
        true if the counter (after decrementing) didn't reach getMaxReentrants() limit, or false otherwise.
      • isMaxReentrantsReached

        public boolean isMaxReentrantsReached()
        Returns true, if max number of write->completion-handler reentrants has been reached for the passed Writer.Reentrant object, and next write will happen in the separate thread.
        Returns:
        true, if max number of write->completion-handler reentrants has been reached for the passed Writer.Reentrant object, and next write will happen in the separate thread.