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
FactoryBeanthat 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
-
-
Constructor Summary
Constructors Constructor Description FeatureProxyFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()ObjectgetActive()StringgetFeature()ObjectgetInactive()ObjectgetObject()Class<?>getObjectType()Class<?>getProxyType()booleanisSingleton()voidsetActive(Object active)voidsetFeature(String feature)voidsetInactive(Object inactive)voidsetProxyType(Class<?> proxyType)
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getObjectType
public Class<?> getObjectType()
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<Object>
-
getFeature
public String getFeature()
-
setFeature
public void setFeature(String feature)
-
getActive
public Object getActive()
-
setActive
public void setActive(Object active)
-
getInactive
public Object getInactive()
-
setInactive
public void setInactive(Object inactive)
-
getProxyType
public Class<?> getProxyType()
-
setProxyType
public void setProxyType(Class<?> proxyType)
-
-