brooklyn.entity.drivers
Interface EntityDriverManager
- All Superinterfaces:
- EntityDriverFactory
public interface EntityDriverManager
- extends EntityDriverFactory
Responsible for creating a driver for a given entity/location. Also used for customizing which
type of driver should be used by entities in given locations.
The idea is that an entity should not be tightly coupled to a specific driver implementation,
so that there is flexibility for driver changes, without changing the entity itself. The
advantage is that drivers can easily be reconfigured, replaced or new drivers for different
environments can be added, without needing to modify Brooklyn.
To obtain an instance of a driver, use build(DriverDependentEntity, Location).
This will use the registered driver types, or if one is not registered will fallback to the
default strategy.
build
<D extends EntityDriver> D build(DriverDependentEntity<D> entity,
Location location)
- Builds a new
EntityDriver for the given entity/location.
- Specified by:
build in interface EntityDriverFactory
- Type Parameters:
D - - Parameters:
entity - the DriverDependentEntity to create the EntityDriver for.location - the Location where the DriverDependentEntity is running.
- Returns:
- the creates EntityDriver.
registerDriver
<D extends EntityDriver> void registerDriver(Class<D> driverInterface,
Class<? extends Location> locationClazz,
Class<? extends D> driverClazz)
Copyright © 2013. All Rights Reserved.