T
- the interface being switched@ParametersAreNonnullByDefault public class AppPropertiesComponentAdaptor<T> extends AbstractSwitchingInvocationAdaptor<T>
ComponentAdapter
that switches between two implementations of
a given interface based on whether a particular flag is set in ApplicationProperties
.ApplicationProperties.getOption(String)
interfaceClass
Constructor and Description |
---|
AppPropertiesComponentAdaptor(org.picocontainer.PicoContainer container,
Class<T> interfaceClass,
Class<? extends T> enabledClass,
Class<? extends T> disabledClass,
String appPropertiesKey)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected InvocationSwitcher |
getInvocationSwitcher()
Returns the invocation switcher that will choose between the "enabled" and "disabled" implementations.
|
getComponentImplementation, getComponentInstance
accept, findAdapterOfType, getComponentInstance, getComponentKey, getDelegate, getDescriptor, verify
public AppPropertiesComponentAdaptor(org.picocontainer.PicoContainer container, Class<T> interfaceClass, Class<? extends T> enabledClass, Class<? extends T> disabledClass, String appPropertiesKey)
container
- the Pico container from which to retrieve the application propertiesinterfaceClass
- the interface whose implementation is being switchedenabledClass
- the implementation to use if the flag is setdisabledClass
- the implementation to use if the flag is not setappPropertiesKey
- the key of the flag in application properties@Nonnull protected InvocationSwitcher getInvocationSwitcher()
AbstractSwitchingInvocationAdaptor
getInvocationSwitcher
in class AbstractSwitchingInvocationAdaptor<T>
Copyright © 2002-2024 Atlassian. All Rights Reserved.