Class StoreRedirectorProxyFactory<I>

  • Type Parameters:
    I - The component interface class
    All Implemented Interfaces:
    org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

    public class StoreRedirectorProxyFactory<I>
    extends java.lang.Object
    implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
    This factory provides component redirection based on Store or Node References passed into the component. Redirection is driven by StoreRef and NodeRef parameters. If none are given in the method call, the default component is called. Otherwise, the store type is extracted from these parameters and the appropriate component called for the store type. An error is thrown if multiple store types are found.
    Author:
    David Caruana
    • Constructor Detail

      • StoreRedirectorProxyFactory

        public StoreRedirectorProxyFactory()
    • Method Detail

      • setProxyInterface

        public void setProxyInterface​(java.lang.Class<I> proxyInterface)
        Sets the proxy interface
        Parameters:
        proxyInterface - the proxy interface
      • setDefaultBinding

        public void setDefaultBinding​(I defaultBinding)
        Sets the default component binding
        Parameters:
        defaultBinding - the component to call by default
      • setRedirectedProtocolBindings

        public void setRedirectedProtocolBindings​(java.util.Map<java.lang.String,​I> protocolBindings)
        Sets the binding of store type (protocol string) to component
        Parameters:
        protocolBindings - the bindings
      • setRedirectedStoreBindings

        public void setRedirectedStoreBindings​(java.util.Map<java.lang.String,​I> storeBindings)
        Sets the binding of store type (protocol string) to component
        Parameters:
        storeBindings - the bindings
      • afterPropertiesSet

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

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

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

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