StrategySelector contract.
| Modifier and Type | Field and Description |
|---|---|
| private final ClassLoaderService | |
| private final Map | |
| private static final Logger | |
| private final Map | |
| private static final StrategyCreator |
| Access | Constructor and Description |
|---|---|
| public | StrategySelectorImpl(ClassLoaderService
The class loader service usable by this StrategySelectorImpl instance. classLoaderService)Constructs a StrategySelectorImpl using the given class loader service. |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | getRegisteredStrategyImplementors(Class<T> strategy)
Implements org. |
| public <T> void | registerStrategyImplementor(Class<T>
The strategy contract. strategy, String The registration name name, Class<? extends T> The implementation Class implementation)Implements org. |
| public <T> void | |
| public <T> T | resolveDefaultableStrategy(Class<T>
The type (interface) of the strategy to be resolved. strategy, Object The reference to the strategy for which we need to resolve an instance. strategyReference, final T THe default value to use if strategyReference is null defaultValue)Implements org. |
| public <T> T | resolveDefaultableStrategy(Class<T>
The type (interface) of the strategy to be resolved. strategy, Object The reference to the strategy for which we need to resolve an instance. strategyReference, Callable<T> A strategy for resolving the default value strategyReference resolves to null. defaultResolver)Implements org. |
| public <T> T | |
| public <T> T | resolveStrategy(Class<T> strategy, Object strategyReference, T defaultValue, StrategyCreator<T> creator)
Implements org. |
| public <T> T | resolveStrategy(Class<T> strategy, Object strategyReference, Callable<T> defaultResolver, StrategyCreator<T> creator)
Implements org. |
| public <T> Class | selectStrategyImplementor(Class<T>
The type of strategy to be resolved. strategy, String The name of the strategy to locate; might be either a registered name or the implementation FQN. name)Implements org. |
| public <T> void | unRegisterStrategyImplementor(Class<T>
The strategy contract. strategy, Class<? extends T> The implementation Class implementation)Implements org. |
| classLoaderService | back to summary |
|---|---|
| private final ClassLoaderService classLoaderService | |
| lazyStrategyImplementorByStrategyMap | back to summary |
|---|---|
| private final Map<Class<T>, LazyServiceResolver<T>> lazyStrategyImplementorByStrategyMap | |
| log | back to summary |
|---|---|
| private static final Logger log | |
| namedStrategyImplementorByStrategyMap | back to summary |
|---|---|
| private final Map<Class<T>, Map<String, Class<T>>> namedStrategyImplementorByStrategyMap | |
| STANDARD_STRATEGY_CREATOR | back to summary |
|---|---|
| private static final StrategyCreator<T> STANDARD_STRATEGY_CREATOR | |
| StrategySelectorImpl | back to summary |
|---|---|
| public StrategySelectorImpl(ClassLoaderService classLoaderService) Constructs a StrategySelectorImpl using the given class loader service.
| |
| getRegisteredStrategyImplementors | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Retrieve all of the registered implementors of the given strategy. Useful to allow defaulting the choice to the single registered implementor when only one is registered
| |
| registerStrategyImplementor | back to summary |
|---|---|
| public <T> void registerStrategyImplementor(Class<T> strategy, String name, Class<? extends T> implementation) Implements org. Doc from org. Registers a named implementor of a particular strategy contract. | |
| registerStrategyLazily | back to summary |
|---|---|
| public <T> void registerStrategyLazily(Class<T> strategy, LazyServiceResolver<T> resolver) | |
| resolveDefaultableStrategy | back to summary |
|---|---|
| public <T> T resolveDefaultableStrategy(Class<T> strategy, Object strategyReference, final T defaultValue) Implements org. Doc from org. Resolve strategy instances. The incoming reference might be:
| |
| resolveDefaultableStrategy | back to summary |
|---|---|
| public <T> T resolveDefaultableStrategy(Class<T> strategy, Object strategyReference, Callable<T> defaultResolver) Implements org. Doc from org. Resolve strategy instances. The incoming reference might be:
| |
| resolveStrategy | back to summary |
|---|---|
public <T> T resolveStrategy(Class<T> strategy, Object strategyReference)
| |
| resolveStrategy | back to summary |
|---|---|
| public <T> T resolveStrategy(Class<T> strategy, Object strategyReference, T defaultValue, StrategyCreator<T> creator) Implements org.
| |
| resolveStrategy | back to summary |
|---|---|
| public <T> T resolveStrategy(Class<T> strategy, Object strategyReference, Callable<T> defaultResolver, StrategyCreator<T> creator) Implements org.
| |
| selectStrategyImplementor | back to summary |
|---|---|
| public <T> Class Implements org. Doc from org. Locate the named strategy implementation.
| |
| unRegisterStrategyImplementor | back to summary |
|---|---|
| public <T> void unRegisterStrategyImplementor(Class<T> strategy, Class<? extends T> implementation) Implements org. Doc from org. Un-registers a named implementor of a particular strategy contract. Un-registers all named registrations for the given strategy contract naming the given class. | |