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 ExecutorService
getEventExecutorService()
ExecutorService
getGpioEventExecutorService()
ScheduledExecutorService
getScheduledExecutorService()
return an instance to the scheduled executor service (wrapper)protected static ThreadFactory
getThreadFactory(String nameFormat)
return an instance to the thread factory used to create new executor servicesExecutorService
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 managementvoid
shutdown()
shutdown executor threadsprotected void
shutdownExecutor(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:
getScheduledExecutorService
in interfaceExecutorServiceFactory
-
getGpioEventExecutorService
public ExecutorService getGpioEventExecutorService()
- Specified by:
getGpioEventExecutorService
in interfaceExecutorServiceFactory
-
getEventExecutorService
public ExecutorService getEventExecutorService()
- Specified by:
getEventExecutorService
in 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:
newSingleThreadExecutorService
in interfaceExecutorServiceFactory
-
shutdown
public void shutdown()
shutdown executor threads- Specified by:
shutdown
in interfaceExecutorServiceFactory
-
shutdownExecutor
protected void shutdownExecutor(ExecutorService executor)
-
-