Class FutureFunctionality

  • Direct Known Subclasses:
    ComponentFutureFunctionality

    public class FutureFunctionality
    extends java.lang.Object
    Default future functionality.
    • Field Detail

      • DROP_INTERMEDIATE_RESULT

        public static final java.lang.String DROP_INTERMEDIATE_RESULT
        Marker for an intermediate result to be dropped.
        See Also:
        Constant Field Values
      • logger

        protected java.util.logging.Logger logger
        The logger used for notification failure warnings (if any).
      • loggerfetcher

        protected IResultCommand<java.util.logging.Logger,​java.lang.Void> loggerfetcher
      • undone

        protected boolean undone
    • Constructor Detail

      • FutureFunctionality

        public FutureFunctionality​(java.util.logging.Logger logger)
      • FutureFunctionality

        public FutureFunctionality​(IResultCommand<java.util.logging.Logger,​java.lang.Void> loggerfetcher)
    • Method Detail

      • getLogger

        protected java.util.logging.Logger getLogger()
        Get the logger.
      • logException

        protected void logException​(java.lang.Exception e,
                                    java.lang.Exception userex,
                                    boolean terminable,
                                    boolean undone,
                                    boolean async)
        Log an exception.
      • scheduleForward

        public <T> void scheduleForward​(ICommand<T> code,
                                        T arg)
        Schedule forward in result direction, i.e. from callee to caller, e.g. update timer to avoid timeouts.
      • scheduleBackward

        public void scheduleBackward​(ICommand<java.lang.Void> code)
        Schedule backward in result direction, i.e. from caller to callee, e.g. future termination.
      • isUndone

        public boolean isUndone​(boolean undone)
        Optionally alter the undone flag.
      • handleResult

        public java.lang.Object handleResult​(java.lang.Object result)
                                      throws java.lang.Exception
        Optionally alter a result.
        Throws:
        java.lang.Exception
      • handleIntermediateResult

        public java.lang.Object handleIntermediateResult​(java.lang.Object result)
                                                  throws java.lang.Exception
        Optionally alter a result.
        Throws:
        java.lang.Exception
      • handleAfterIntermediateResult

        public void handleAfterIntermediateResult​(java.lang.Object result)
                                           throws java.lang.Exception
        Perform code after an intermediate result has been added.
        Throws:
        java.lang.Exception
      • handleFinished

        public void handleFinished​(java.util.Collection<java.lang.Object> results)
                            throws java.lang.Exception
        Optionally alter finished behavior.
        Throws:
        java.lang.Exception
      • handleException

        public void handleException​(java.lang.Exception exception)
        Optionally augment exception behavior.
      • handleTerminated

        public void handleTerminated​(java.lang.Exception reason)
        Optionally augment termination behavior.
      • handleBackwardCommand

        public void handleBackwardCommand​(java.lang.Object info)
        Optionally augment backward command behavior.
      • handlePull

        public void handlePull()
        Optionally augment pull behavior.
      • connectDelegationFuture

        public static void connectDelegationFuture​(Future target,
                                                   IFuture source)
        Connect a delegation future with the source. Add delegation listener on the source (+ termination handling).