Package com.oracle.coherence.spring
Class SpringNamespaceHandler.SpringBeanBuilder
- java.lang.Object
-
- com.oracle.coherence.spring.SpringNamespaceHandler.SpringBeanBuilder
-
- All Implemented Interfaces:
com.tangosol.coherence.config.builder.ParameterizedBuilder<Object>,com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
- Enclosing class:
- SpringNamespaceHandler
public static class SpringNamespaceHandler.SpringBeanBuilder extends Object implements com.tangosol.coherence.config.builder.ParameterizedBuilder<Object>, com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
Implementation ofParameterizedBuilderthat "realizes" a named bean from a SpringBeanFactory. TheBeanFactoryis obtained via the following:- The
BeanFactoryis looked up in the constructor providedResourceRegistryvia the factory name indicated bygetFactoryName() - If the
BeanFactoryis not present in the registry, aSpringNamespaceHandler.SpringBeanFactoryBuildervia the same name will be looked up in the registry, and this builder will realize an instance of theBeanFactory
-
-
Constructor Summary
Constructors Constructor Description SpringBeanBuilder(com.tangosol.util.ResourceRegistry registry)Construct aSpringNamespaceHandler.SpringBeanBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanFactoryensureBeanFactory(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader)Ensure theBeanFactoryused by this builder to provide the bean indicated viagetBeanName().com.tangosol.config.expression.Expression<String>getBeanName()Return anExpressionused to determine the name of the bean provided by this builder.com.tangosol.config.expression.Expression<String>getFactoryName()Return anExpressionused to determine the name of theBeanFactoryused by this builder.com.tangosol.coherence.config.ParameterListgetParameterList()Return theParameterListcontaining optional properties to inject into the realized bean.Objectrealize(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader, com.tangosol.coherence.config.ParameterList listParameters)booleanrealizes(Class<?> clzClass, com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader)voidsetBeanName(com.tangosol.config.expression.Expression<String> exprBeanName)Set theExpressionused to determine the name of the bean provided by this builder.voidsetFactoryName(com.tangosol.config.expression.Expression<String> exprFactoryName)Set theExpressionused to determine the name of theBeanFactoryused by this builder.voidsetParameterList(com.tangosol.coherence.config.ParameterList listParameters)Sets theParameterListcontaining optional properties to inject into the realized bean.
-
-
-
Constructor Detail
-
SpringBeanBuilder
public SpringBeanBuilder(com.tangosol.util.ResourceRegistry registry)
Construct aSpringNamespaceHandler.SpringBeanBuilder.- Parameters:
registry- theResourceRegistrythis builder will use to locate theBeanFactorythat will provide the requested bean
-
-
Method Detail
-
getFactoryName
public com.tangosol.config.expression.Expression<String> getFactoryName()
Return anExpressionused to determine the name of theBeanFactoryused by this builder.- Returns:
- an
Expressionfor theBeanFactoryname
-
setFactoryName
@Injectable public void setFactoryName(com.tangosol.config.expression.Expression<String> exprFactoryName)
Set theExpressionused to determine the name of theBeanFactoryused by this builder.- Parameters:
exprFactoryName- theExpressionfor theBeanFactoryname
-
getBeanName
public com.tangosol.config.expression.Expression<String> getBeanName()
Return anExpressionused to determine the name of the bean provided by this builder.- Returns:
- an
Expressionfor the bean name
-
setBeanName
@Injectable public void setBeanName(com.tangosol.config.expression.Expression<String> exprBeanName)
Set theExpressionused to determine the name of the bean provided by this builder.- Parameters:
exprBeanName- anExpressionfor the bean name
-
getParameterList
public com.tangosol.coherence.config.ParameterList getParameterList()
Return theParameterListcontaining optional properties to inject into the realized bean.- Returns:
- the
ParameterList
-
setParameterList
public void setParameterList(com.tangosol.coherence.config.ParameterList listParameters)
Sets theParameterListcontaining optional properties to inject into the realized bean.- Parameters:
listParameters- theParameterList
-
realize
public Object realize(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader, com.tangosol.coherence.config.ParameterList listParameters)
- Specified by:
realizein interfacecom.tangosol.coherence.config.builder.ParameterizedBuilder<Object>
-
realizes
public boolean realizes(Class<?> clzClass, com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader)
- Specified by:
realizesin interfacecom.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
-
ensureBeanFactory
protected BeanFactory ensureBeanFactory(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader)
Ensure theBeanFactoryused by this builder to provide the bean indicated viagetBeanName().- Parameters:
resolver- theParameterResolverto use for resolving parametersloader- theClassLoaderfor loading any necessary classes- Returns:
- the
BeanFactoryused by this builder
-
-