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() |
getComponentImplementation, getComponentInstance, getHandler, isEnabled
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 propertiesprotected InvocationSwitcher getInvocationSwitcher()
getInvocationSwitcher
in class AbstractSwitchingInvocationAdaptor<T>
Copyright © 2002-2018 Atlassian. All Rights Reserved.