Interface IReadAccess.Priority<State>

  • Enclosing interface:
    IReadAccess<State>

    public static interface IReadAccess.Priority<State>
    Since:
    2.7
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <Result> Result priorityReadOnly​(IUnitOfWork<Result,​State> work)
      Gets a read-only copy of the State and executes work on it.
      default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work)
      Tries to get a read-only copy of the State and execute work on it.
      default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work, java.util.function.Supplier<? extends Result> defaultResult)
      Tries to get a read-only copy of the State and execute work on it.
      default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work, java.util.function.Supplier<? extends Result> defaultResult, java.util.function.Function<? super java.lang.Exception,​? extends Result> exceptionHandler)
      Tries to get a read-only copy of the State and execute work on it.
    • Method Detail

      • priorityReadOnly

        <Result> Result priorityReadOnly​(IUnitOfWork<Result,​State> work)
        Gets a read-only copy of the State and executes work on it. Cancels all cancelable readers before executing the IUnitOfWork. For interactive jobs that need fastest possible execution. WARNING: the State passed to work can be null.
        Since:
        2.7
        See Also:
        CancelableUnitOfWork
      • tryPriorityReadOnly

        default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work,
                                                    java.util.function.Supplier<? extends Result> defaultResult)
        Tries to get a read-only copy of the State and execute work on it. Cancels all cancelable readers before executing the IUnitOfWork. For interactive jobs that need fastest possible execution.
        Parameters:
        work - Work to execute on the State
        defaultResult - Supplies a result in case the State is null
        Returns:
        The result of executing work, or the result of querying defaultResult if the State is null
        Since:
        2.14
        See Also:
        CancelableUnitOfWork
      • tryPriorityReadOnly

        default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work)
        Tries to get a read-only copy of the State and execute work on it. Cancels all cancelable readers before executing the IUnitOfWork. For interactive jobs that need fastest possible execution.
        Parameters:
        work - Work to execute on the State
        Returns:
        The result of executing work, or null if the State is null
        Since:
        2.15
        See Also:
        CancelableUnitOfWork
      • tryPriorityReadOnly

        default <Result> Result tryPriorityReadOnly​(IUnitOfWork<Result,​State> work,
                                                    java.util.function.Supplier<? extends Result> defaultResult,
                                                    java.util.function.Function<? super java.lang.Exception,​? extends Result> exceptionHandler)
        Tries to get a read-only copy of the State and execute work on it. Cancels all cancelable readers before executing the IUnitOfWork. For interactive jobs that need fastest possible execution.
        Parameters:
        work - Work to execute on the State
        defaultResult - Supplies a result in case the State is null
        exceptionHandler - Supplies a result in case an exception is raised during execution
        Returns:
        The result of executing work, the result of querying defaultResult if the State is null, or the result of executing exceptionHandler in case an exception is raised
        Since:
        2.14
        See Also:
        CancelableUnitOfWork