Class SameThreadExecutorService

  • All Implemented Interfaces:
    java.util.concurrent.Executor, java.util.concurrent.ExecutorService

    public final class SameThreadExecutorService
    extends java.util.concurrent.AbstractExecutorService
    An ExecutorService that executes tasks immediately in the calling thread during submit.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean shutdown  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean awaitTermination​(long timeout, java.util.concurrent.TimeUnit unit)  
      private void checkShutdown()  
      void execute​(java.lang.Runnable command)  
      boolean isShutdown()  
      boolean isTerminated()  
      void shutdown()  
      java.util.List<java.lang.Runnable> shutdownNow()  
      • Methods inherited from class java.util.concurrent.AbstractExecutorService

        invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
      • Methods inherited from class java.lang.Object

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

      • shutdown

        private volatile boolean shutdown
    • Constructor Detail

      • SameThreadExecutorService

        public SameThreadExecutorService()
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable command)
      • shutdownNow

        public java.util.List<java.lang.Runnable> shutdownNow()
      • shutdown

        public void shutdown()
      • isTerminated

        public boolean isTerminated()
      • isShutdown

        public boolean isShutdown()
      • awaitTermination

        public boolean awaitTermination​(long timeout,
                                        java.util.concurrent.TimeUnit unit)
                                 throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • checkShutdown

        private void checkShutdown()