Package com.pi4j.concurrent
Class DefaultExecutorServiceFactory
- java.lang.Object
-
- com.pi4j.concurrent.DefaultExecutorServiceFactory
-
- All Implemented Interfaces:
ExecutorServiceFactory
- Direct Known Subclasses:
SingleThreadGpioExecutorServiceFactory
public class DefaultExecutorServiceFactory extends Object implements ExecutorServiceFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultExecutorServiceFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServicegetEventExecutorService()ExecutorServicegetGpioEventExecutorService()ScheduledExecutorServicegetScheduledExecutorService()return an instance to the scheduled executor service (wrapper)protected static ThreadFactorygetThreadFactory(String nameFormat)return an instance to the thread factory used to create new executor servicesExecutorServicenewSingleThreadExecutorService()return a new instance of a single thread executor service This method is deprecated in favor of the getGpioEventExecutorService - which provides better guarantees around resource managementvoidshutdown()shutdown executor threadsprotected voidshutdownExecutor(ExecutorService executor)
-
-
-
Method Detail
-
getThreadFactory
protected static ThreadFactory getThreadFactory(String nameFormat)
return an instance to the thread factory used to create new executor services
-
getScheduledExecutorService
public ScheduledExecutorService getScheduledExecutorService()
return an instance to the scheduled executor service (wrapper)- Specified by:
getScheduledExecutorServicein interfaceExecutorServiceFactory
-
getGpioEventExecutorService
public ExecutorService getGpioEventExecutorService()
- Specified by:
getGpioEventExecutorServicein interfaceExecutorServiceFactory
-
getEventExecutorService
public ExecutorService getEventExecutorService()
- Specified by:
getEventExecutorServicein interfaceExecutorServiceFactory
-
newSingleThreadExecutorService
public ExecutorService newSingleThreadExecutorService()
return a new instance of a single thread executor service This method is deprecated in favor of the getGpioEventExecutorService - which provides better guarantees around resource management- Specified by:
newSingleThreadExecutorServicein interfaceExecutorServiceFactory
-
shutdown
public void shutdown()
shutdown executor threads- Specified by:
shutdownin interfaceExecutorServiceFactory
-
shutdownExecutor
protected void shutdownExecutor(ExecutorService executor)
-
-