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
  • Constructor Details

    • FeatureProxyFactoryBean

      public FeatureProxyFactoryBean()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getObject

      public Object getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<Object>
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<Object>
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface org.springframework.beans.factory.FactoryBean<Object>
    • getFeature

      public String getFeature()
    • setFeature

      @Deprecated public void setFeature(String feature)
      Deprecated.
    • setFeature

      public void setFeature(Feature 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)