Class CurrentThreadExecutorService

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

    @NotThreadSafe
    class CurrentThreadExecutorService
    extends java.util.concurrent.AbstractExecutorService

    An ExecutorService implementation that runs command in the current thread. Instance of this class is not thread safe, do not share it among multiple threads. SpotBugs uses this class to keep backward compatibility (SpotBugs 3.1 run analysis on the main/current thread).

    Since:
    4.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean isShutdown  
      private static org.slf4j.Logger LOG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean awaitTermination​(long timeout, java.util.concurrent.TimeUnit unit)  
      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

      • LOG

        private static final org.slf4j.Logger LOG
      • isShutdown

        private boolean isShutdown
    • Constructor Detail

      • CurrentThreadExecutorService

        CurrentThreadExecutorService()
    • Method Detail

      • shutdown

        public void shutdown()
      • shutdownNow

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

        public boolean isShutdown()
      • isTerminated

        public boolean isTerminated()
      • awaitTermination

        public boolean awaitTermination​(long timeout,
                                        java.util.concurrent.TimeUnit unit)
      • execute

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