Class SynchronousTransfer<C,​S,​E extends java.lang.Exception>

  • All Implemented Interfaces:
    ThrowingFunction<C,​S,​E>, java.lang.Runnable, java.util.function.Function<C,​S>

    public class SynchronousTransfer<C,​S,​E extends java.lang.Exception>
    extends Transfer<C,​S,​E>
    implements java.lang.Runnable
    • Method Summary

      Modifier and Type Method Description
      S applyChecked​(C object)
      Sends a resource into the synchronous transfer.
      S get​(C object, int timeoutMillis)  
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • SynchronousTransfer

        public SynchronousTransfer​(java.lang.Class<E> exceptionClass,
                                   ThrowingFunction<C,​S,​E> function)
    • Method Detail

      • applyChecked

        public S applyChecked​(C object)
                       throws E extends java.lang.Exception
        Sends a resource into the synchronous transfer.
        Specified by:
        applyChecked in interface ThrowingFunction<C,​S,​E extends java.lang.Exception>
        Overrides:
        applyChecked in class Transfer<C,​S,​E extends java.lang.Exception>
        Parameters:
        object - resource to place into the queue.
        Returns:
        response object.
        Throws:
        java.lang.RuntimeException - if execution fails.
        E extends java.lang.Exception
      • get

        public S get​(C object,
                     int timeoutMillis)
              throws java.util.concurrent.ExecutionException,
                     java.util.concurrent.TimeoutException
        Throws:
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • run

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