Class SpringNamespaceHandler.SpringBeanBuilder

  • All Implemented Interfaces:
    com.tangosol.coherence.config.builder.ParameterizedBuilder<java.lang.Object>, com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
    Enclosing class:
    SpringNamespaceHandler

    public static class SpringNamespaceHandler.SpringBeanBuilder
    extends java.lang.Object
    implements com.tangosol.coherence.config.builder.ParameterizedBuilder<java.lang.Object>, com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
    Implementation of ParameterizedBuilder that "realizes" a named bean from a Spring BeanFactory. The BeanFactory is obtained via the following:
    1. The BeanFactory is looked up in the constructor provided ResourceRegistry via the factory name indicated by getFactoryName()
    2. If the BeanFactory is not present in the registry, a SpringNamespaceHandler.SpringBeanFactoryBuilder via the same name will be looked up in the registry, and this builder will realize an instance of the BeanFactory
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder

        com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected BeanFactory ensureBeanFactory​(com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader)
      Ensure the BeanFactory used by this builder to provide the bean indicated via getBeanName().
      com.tangosol.config.expression.Expression<java.lang.String> getBeanName()
      Return an Expression used to determine the name of the bean provided by this builder.
      com.tangosol.config.expression.Expression<java.lang.String> getFactoryName()
      Return an Expression used to determine the name of the BeanFactory used by this builder.
      com.tangosol.coherence.config.ParameterList getParameterList()
      Return the ParameterList containing optional properties to inject into the realized bean.
      java.lang.Object realize​(com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader, com.tangosol.coherence.config.ParameterList listParameters)
      boolean realizes​(java.lang.Class<?> clzClass, com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader)
      void setBeanName​(com.tangosol.config.expression.Expression<java.lang.String> exprBeanName)
      Set the Expression used to determine the name of the bean provided by this builder.
      void setFactoryName​(com.tangosol.config.expression.Expression<java.lang.String> exprFactoryName)
      Set the Expression used to determine the name of the BeanFactory used by this builder.
      void setParameterList​(com.tangosol.coherence.config.ParameterList listParameters)
      Sets the ParameterList containing optional properties to inject into the realized bean.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpringBeanBuilder

        public SpringBeanBuilder​(com.tangosol.util.ResourceRegistry registry)
        Parameters:
        registry - the ResourceRegistry this builder will use to locate the BeanFactory that will provide the requested bean
    • Method Detail

      • getFactoryName

        public com.tangosol.config.expression.Expression<java.lang.String> getFactoryName()
        Return an Expression used to determine the name of the BeanFactory used by this builder.
        Returns:
        an Expression for the BeanFactory name
      • setFactoryName

        @Injectable
        public void setFactoryName​(com.tangosol.config.expression.Expression<java.lang.String> exprFactoryName)
        Set the Expression used to determine the name of the BeanFactory used by this builder.
        Parameters:
        exprFactoryName - the Expression for the BeanFactory name
      • getBeanName

        public com.tangosol.config.expression.Expression<java.lang.String> getBeanName()
        Return an Expression used to determine the name of the bean provided by this builder.
        Returns:
        an Expression for the bean name
      • setBeanName

        @Injectable
        public void setBeanName​(com.tangosol.config.expression.Expression<java.lang.String> exprBeanName)
        Set the Expression used to determine the name of the bean provided by this builder.
        Parameters:
        exprBeanName - an Expression for the bean name
      • getParameterList

        public com.tangosol.coherence.config.ParameterList getParameterList()
        Return the ParameterList containing optional properties to inject into the realized bean.
        Returns:
        the ParameterList
      • setParameterList

        public void setParameterList​(com.tangosol.coherence.config.ParameterList listParameters)
        Sets the ParameterList containing optional properties to inject into the realized bean.
        Parameters:
        listParameters - the ParameterList
      • realize

        public java.lang.Object realize​(com.tangosol.config.expression.ParameterResolver resolver,
                                        java.lang.ClassLoader loader,
                                        com.tangosol.coherence.config.ParameterList listParameters)
        Specified by:
        realize in interface com.tangosol.coherence.config.builder.ParameterizedBuilder<java.lang.Object>
      • realizes

        public boolean realizes​(java.lang.Class<?> clzClass,
                                com.tangosol.config.expression.ParameterResolver resolver,
                                java.lang.ClassLoader loader)
        Specified by:
        realizes in interface com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
      • ensureBeanFactory

        protected BeanFactory ensureBeanFactory​(com.tangosol.config.expression.ParameterResolver resolver,
                                                java.lang.ClassLoader loader)
        Ensure the BeanFactory used by this builder to provide the bean indicated via getBeanName().
        Parameters:
        resolver - the ParameterResolver to use for resolving parameters
        loader - the ClassLoader for loading any necessary classes
        Returns:
        the BeanFactory used by this builder