Class AbstractResultListener

  • Direct Known Subclasses:
    WALFlushListener, WALRecoverListener

    public abstract class AbstractResultListener
    extends java.lang.Object
    This abstract class aims to listen to the result of some operation.
    • Field Detail

      • wait

        protected final boolean wait
        true means waiting until getting the result
      • cause

        protected volatile java.lang.Exception cause
    • Constructor Detail

      • AbstractResultListener

        public AbstractResultListener​(boolean wait)
    • Method Detail

      • succeed

        public AbstractResultListener succeed()
        Set status to success and notify all threads waiting for the result.
      • fail

        public AbstractResultListener fail​(java.lang.Exception e)
        Set status to failure and notify all threads waiting for the result.
      • waitForResult

        public AbstractResultListener.Status waitForResult()
        Wait until getting the result.
        Notice: wait only when wait status is ture.
      • getCause

        public java.lang.Exception getCause()
        Get the cause exception to failure.