Class AbstractRunnable

    • Method Summary

      Modifier and Type Method Description
      protected abstract void doRun()
      This method has the same semantics as Runnable.run()
      boolean isForceExecution()
      Should the runnable force its execution in case it gets rejected?
      void onAfter()
      This method is called in a finally block after successful execution or on a rejection.
      abstract void onFailure​(java.lang.Exception e)
      This method is invoked for all exception thrown by doRun()
      void onRejection​(java.lang.Exception e)
      This should be executed if the thread-pool executing this action rejected the execution.
      void run()  
      • Methods inherited from class java.lang.Object

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

      • AbstractRunnable

        public AbstractRunnable()
    • Method Detail

      • isForceExecution

        public boolean isForceExecution()
        Should the runnable force its execution in case it gets rejected?
      • run

        public final void run()
        Specified by:
        run in interface java.lang.Runnable
      • onAfter

        public void onAfter()
        This method is called in a finally block after successful execution or on a rejection.
      • onFailure

        public abstract void onFailure​(java.lang.Exception e)
        This method is invoked for all exception thrown by doRun()
      • onRejection

        public void onRejection​(java.lang.Exception e)
        This should be executed if the thread-pool executing this action rejected the execution. The default implementation forwards to onFailure(Exception)
      • doRun

        protected abstract void doRun()
                               throws java.lang.Exception
        This method has the same semantics as Runnable.run()
        Throws:
        java.lang.InterruptedException - if the run method throws an InterruptedException
        java.lang.Exception