com.sentilla.system
Class Drivers

java.lang.Object
  extended by com.sentilla.system.Drivers

public class Drivers
extends Object

Provides a registry of all valid drivers for the current platform. On initialization, a platform registers all the drivers it provides. User applications may also register their own driver implementations.

See Also:
Driver, DriverAdapter

Field Summary
protected static Driver m_driver_head
          The head of the driver queue.
 
Constructor Summary
Drivers()
           
 
Method Summary
static void addDriver(Driver new_driver)
          Add a driver to the list of registered drivers.
static
<D extends Driver>
D
getDriver(String name, Class<D> driverClass)
          Get a driver by name and type.
static Driver getFirstDriver()
          Get the first driver in the set of registered drivers.
static void removeDriver(Driver driver)
          Remove a driver to the list of registered drivers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_driver_head

protected static Driver m_driver_head
The head of the driver queue.

Constructor Detail

Drivers

public Drivers()
Method Detail

getDriver

public static <D extends Driver> D getDriver(String name,
                                             Class<D> driverClass)
Get a driver by name and type.

Type Parameters:
D - The type of the driver
Parameters:
name - The name that represents the driver
driverClass - A class representation of type D, such as LedsDriver.class
Returns:
The first matching driver, or throws an exception
Throws:
NoSuchDriverException - if no driver is found that implements the given class

addDriver

public static void addDriver(Driver new_driver)
Add a driver to the list of registered drivers.

Parameters:
new_driver - An instance of the new driver

getFirstDriver

public static Driver getFirstDriver()
Get the first driver in the set of registered drivers.

Returns:
The first registered driver

removeDriver

public static void removeDriver(Driver driver)
Remove a driver to the list of registered drivers.

Parameters:
driver - instance of the driver to remove


Copyright © 2007 Sentilla Corporation. All Rights Reserved.