Package org.onosproject.net.driver
Class DefaultDriverHandler
- java.lang.Object
-
- org.onosproject.net.driver.DefaultDriverHandler
-
- All Implemented Interfaces:
DriverHandler
public class DefaultDriverHandler extends java.lang.Object implements DriverHandler
Default implementation of driver handler.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ServiceDirectory
serviceDirectory
-
Constructor Summary
Constructors Constructor Description DefaultDriverHandler(DriverData data)
Creates new driver handler with the attached driver data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Behaviour>
Tbehaviour(java.lang.Class<T> behaviourClass)
Returns the specified facet of behaviour to interact with the device.DriverData
data()
Returns the device driver data.Driver
driver()
Returns the parent device driver.<T> T
get(java.lang.Class<T> serviceClass)
Returns the reference to the implementation of the specified service.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.driver.DriverHandler
hasBehaviour
-
-
-
-
Field Detail
-
serviceDirectory
protected static ServiceDirectory serviceDirectory
-
-
Constructor Detail
-
DefaultDriverHandler
public DefaultDriverHandler(DriverData data)
Creates new driver handler with the attached driver data.- Parameters:
data
- driver data to attach
-
-
Method Detail
-
driver
public Driver driver()
Description copied from interface:DriverHandler
Returns the parent device driver.- Specified by:
driver
in interfaceDriverHandler
- Returns:
- device driver
-
data
public DriverData data()
Description copied from interface:DriverHandler
Returns the device driver data.- Specified by:
data
in interfaceDriverHandler
- Returns:
- device driver data
-
behaviour
public <T extends Behaviour> T behaviour(java.lang.Class<T> behaviourClass)
Description copied from interface:DriverHandler
Returns the specified facet of behaviour to interact with the device.- Specified by:
behaviour
in interfaceDriverHandler
- Type Parameters:
T
- type of behaviour- Parameters:
behaviourClass
- behaviour class- Returns:
- behaviour
-
get
public <T> T get(java.lang.Class<T> serviceClass)
Description copied from interface:DriverHandler
Returns the reference to the implementation of the specified service. Provides access to run-time context.- Specified by:
get
in interfaceDriverHandler
- Type Parameters:
T
- type of service- Parameters:
serviceClass
- service class- Returns:
- service implementation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-