Class ExecutionService.RunnableAdapter<T>

  • All Implemented Interfaces:
    java.util.concurrent.Callable<T>, Streamable
    Enclosing class:
    ExecutionService

    protected static final class ExecutionService.RunnableAdapter<T>
    extends java.lang.Object
    implements java.util.concurrent.Callable<T>, Streamable
    This is copied from Executors class which contains RunnableAdapter. However that adapter isn't serializable, and is final and package level so we can' reference.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected T result  
      protected java.lang.Runnable task  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        RunnableAdapter()  
      protected RunnableAdapter​(java.lang.Runnable task, T result)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T call()  
      void readFrom​(java.io.DataInput in)
      Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
      void writeTo​(java.io.DataOutput out)
      Write the entire state of the current object (including superclasses) to outstream.
      • Methods inherited from class java.lang.Object

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

      • task

        protected java.lang.Runnable task
      • result

        protected T result
    • Constructor Detail

      • RunnableAdapter

        public RunnableAdapter()
      • RunnableAdapter

        protected RunnableAdapter​(java.lang.Runnable task,
                                  T result)
    • Method Detail

      • call

        public T call()
        Specified by:
        call in interface java.util.concurrent.Callable<T>
      • writeTo

        public void writeTo​(java.io.DataOutput out)
                     throws java.io.IOException
        Description copied from interface: Streamable
        Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed
        Specified by:
        writeTo in interface Streamable
        Throws:
        java.io.IOException
      • readFrom

        public void readFrom​(java.io.DataInput in)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
        Description copied from interface: Streamable
        Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed
        Specified by:
        readFrom in interface Streamable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException