config.
@@ -72,24 +70,28 @@ public interface Context extends Describable, * @return a {@link com.pi4j.context.ContextConfig} object. */ ContextConfig config(); + /** *properties.
* * @return a {@link com.pi4j.context.ContextProperties} object. */ ContextProperties properties(); + /** *providers.
* * @return a {@link com.pi4j.provider.Providers} object. */ Providers providers(); + /** *registry.
* * @return a {@link com.pi4j.registry.Registry} object. */ Registry registry(); + /** *platforms.
* @@ -97,13 +99,22 @@ public interface Context extends Describable, */ Platforms platforms(); + /** + * Submits the given task for async execution + * + * @param task the task to execute asynchronously + * + * @return the task to cancel later + */ + Future> submitTask(Runnable task); + /** *shutdown.
* * @return a {@link com.pi4j.context.Context} object. * @throws com.pi4j.exception.ShutdownException if an error occurs during shutdown. */ - Context shutdown() throws ShutdownException; + Context shutdown() throws ShutdownException; /** * @@ -127,7 +138,7 @@ public interface Context extends Describable, * @parama P object. * @return a P object. */ - default
P platform(){ + default
P platform() { return platforms().getDefault(); } @@ -137,7 +148,7 @@ default
P platform(){ * @param
a P object. * @return a P object. */ - default
P getPlatform(){ + default
P getPlatform() { return this.platform(); } @@ -147,7 +158,7 @@ default
P getPlatform(){ * @param
a P object. * @return a P object. */ - default
P getDefaultPlatform(){ + default
P getDefaultPlatform() { return this.platform(); } @@ -157,26 +168,26 @@ default
P getDefaultPlatform(){ * @param
a P object. * @return a P object. */ - default
P defaultPlatform(){ + default
P defaultPlatform() { return this.platform(); } /** *
platform.
* - * @param id Id of the platform. + * @param id Id of the platform. * @paramthe platform type * @return a P object. * @throws PlatformNotFoundException if platform specified by {@code id} is not found. */ default
P platform(String id) throws PlatformNotFoundException { - return (P)this.platforms().get(id); + return (P) this.platforms().get(id); } /** *
platform.
* - * @param id Id of the platform. + * @param id Id of the platform. * @param the platform type
* @return a P object.
* @throws PlatformNotFoundException if platform specified by {@code id} is not found.
@@ -237,20 +248,20 @@ default boolean hasPlatform(Class extends Platform> platformClass) throws Plat
/** {@inheritDoc} */
default DefaultContext class.
- * Pls. see the {@link #blink(int, int, java.util.concurrent.TimeUnit, com.pi4j.io.gpio.digital.DigitalState, java.util.concurrent.Callable) blink()}
+ * See the {@link #blink(int, int, java.util.concurrent.TimeUnit, com.pi4j.io.gpio.digital.DigitalState, java.util.concurrent.Callable) blink()}
* method for a more detailed explanation on how the method works.
*
* @param delay The toggle time.
@@ -253,41 +219,8 @@ public DigitalOutput blink(int delay, int duration, TimeUnit unit, DigitalState
*/
@Override
public Future> blinkAsync(int delay, int duration, TimeUnit unit, DigitalState state, Callable providers. platforms. properties. context. shutdown. initialize. newInstance. PiGpioDigitalOutput class. Constructor for GpioDDigitalInput. PiGpioDigitalOutput class. LinuxFsDigitalInput class. Constructor for LinuxFsDigitalInput.