Package org.togglz.spring.proxy
Class FeatureProxyFactoryBean
java.lang.Object
org.togglz.spring.proxy.FeatureProxyFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<Object>,org.springframework.beans.factory.InitializingBean
public class FeatureProxyFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.beans.factory.InitializingBean
Implementation of FactoryBean that creates a proxy that delegates invocation to one of two target beans depending on
that state of a given feature.
You can use the factory like this:
<bean id="someService" class="org.togglz.spring.proxy.FeatureProxyFactoryBean"> <property name="feature" value=FEATURE_ONE /> <property name="active" ref="newServiceImpl" /> <property name="inactive" ref="oldServiceImpl" /> </bean>
- Author:
- Christian Kaltepoth
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClass<?>Class<?>booleanvoidvoidsetFeature(String feature) Deprecated.voidsetFeature(Feature feature) voidsetInactive(Object inactive) voidsetProxyType(Class<?> proxyType)
-
Constructor Details
-
FeatureProxyFactoryBean
public FeatureProxyFactoryBean()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
getFeature
-
setFeature
Deprecated.usesetFeature(Feature)instead -
setFeature
-
getActive
-
setActive
-
getInactive
-
setInactive
-
getProxyType
-
setProxyType
-
setFeature(Feature)instead