public interface StrategyBuilder
StrategyRegistry
, implementing a version of the Gang
of Four Strategy pattern.
The constructed service is configured with a number of adapters (that implement the same service interface). Method
invocations on the service are routed to one of the adapters.
The first parameter of each method is used to select the appropriate adapter.
The ideal interface for use with this builder has only one method.Modifier and Type | Method and Description |
---|---|
<S> S |
build(Class<S> adapterType,
Map<Class,S> registrations) |
<S> S |
build(StrategyRegistry<S> registry)
Given a number of adapters implementing the service interface, builds a "dispatcher" implementations that
delegates to the one of the adapters.
|
<S> S build(StrategyRegistry<S> registry)
S
- the service interface typeregistry
- defines the adapters based on parameter type (of the first parameter)5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.