Package com.pi4j.io.gpio
Class GpioFactory
- java.lang.Object
-
- com.pi4j.io.gpio.GpioFactory
-
public class GpioFactory extends Object
This factory class provides a static method to create new 'GpioController' instances.
Before using the Pi4J library, you need to ensure that the Java VM in configured with access to the following system libraries:
- pi4j
- wiringPi
This library depends on the wiringPi native system library. (developed by Gordon Henderson @ http://wiringpi.com/)
- Author:
- Robert Savage (http://www.savagehomeautomation.com)
- See Also:
GpioController,GpioProvider, https://pi4j.com/
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GpioProvidergetDefaultProvider()Return default instance ofGpioProvider.static ExecutorServiceFactorygetExecutorServiceFactory()Return instance ofExecutorServiceFactory.static GpioControllergetInstance()Return default instance ofGpioController.static voidsetDefaultProvider(GpioProvider provider)Sets defaultGpioProvider.static voidsetExecutorServiceFactory(ExecutorServiceFactory executorServiceFactory)Sets defaultExecutorServiceFactory.
-
-
-
Method Detail
-
getInstance
public static GpioController getInstance()
Return default instance of
GpioController.Note: this is not thread safe singleton pattern implementation. Implementation does not provide any synchronization or mechanisms to prevent instantiation of two instances.
- Returns:
- Return a new GpioController impl instance.
-
getDefaultProvider
public static GpioProvider getDefaultProvider()
Return default instance of
GpioProvider.Note: this is not thread safe singleton pattern implementation. Implementation does not provide any synchronization or mechanisms to prevent instantiation of two instances.
- Returns:
- Return a new GpioController impl instance.
-
setDefaultProvider
public static void setDefaultProvider(GpioProvider provider)
Sets defaultGpioProvider.- Parameters:
provider- default gpio provider
-
getExecutorServiceFactory
public static ExecutorServiceFactory getExecutorServiceFactory()
Return instance of
ExecutorServiceFactory.Note: .
- Returns:
- Return a new GpioController impl instance.
-
setExecutorServiceFactory
public static void setExecutorServiceFactory(ExecutorServiceFactory executorServiceFactory)
Sets defaultExecutorServiceFactory.- Parameters:
executorServiceFactory- service factory instance
-
-