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 of
ParameterizedBuilder
that "realizes" a named
bean from a Spring BeanFactory
. The BeanFactory
is
obtained via the following:
- The
BeanFactory
is looked up in the constructor providedResourceRegistry
via the factory name indicated bygetFactoryName()
- If the
BeanFactory
is not present in the registry, aSpringNamespaceHandler.SpringBeanFactoryBuilder
via the same name will be looked up in the registry, and this builder will realize an instance of theBeanFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder
com.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
-
Constructor Summary
ConstructorDescriptionSpringBeanBuilder
(com.tangosol.util.ResourceRegistry registry) Construct aSpringNamespaceHandler.SpringBeanBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionprotected BeanFactory
ensureBeanFactory
(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader) Ensure theBeanFactory
used by this builder to provide the bean indicated viagetBeanName()
.com.tangosol.config.expression.Expression<String>
Return anExpression
used to determine the name of the bean provided by this builder.com.tangosol.config.expression.Expression<String>
Return anExpression
used to determine the name of theBeanFactory
used by this builder.com.tangosol.coherence.config.ParameterList
Return theParameterList
containing optional properties to inject into the realized bean.realize
(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader, com.tangosol.coherence.config.ParameterList listParameters) boolean
realizes
(Class<?> clzClass, com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader) void
setBeanName
(com.tangosol.config.expression.Expression<String> exprBeanName) Set theExpression
used to determine the name of the bean provided by this builder.void
setFactoryName
(com.tangosol.config.expression.Expression<String> exprFactoryName) Set theExpression
used to determine the name of theBeanFactory
used by this builder.void
setParameterList
(com.tangosol.coherence.config.ParameterList listParameters) Sets theParameterList
containing optional properties to inject into the realized bean.
-
Constructor Details
-
SpringBeanBuilder
public SpringBeanBuilder(com.tangosol.util.ResourceRegistry registry) Construct aSpringNamespaceHandler.SpringBeanBuilder
.- Parameters:
registry
- theResourceRegistry
this builder will use to locate theBeanFactory
that will provide the requested bean
-
-
Method Details
-
getFactoryName
Return anExpression
used to determine the name of theBeanFactory
used by this builder.- Returns:
- an
Expression
for theBeanFactory
name
-
setFactoryName
@Injectable public void setFactoryName(com.tangosol.config.expression.Expression<String> exprFactoryName) Set theExpression
used to determine the name of theBeanFactory
used by this builder.- Parameters:
exprFactoryName
- theExpression
for theBeanFactory
name
-
getBeanName
Return anExpression
used to determine the name of the bean provided by this builder.- Returns:
- an
Expression
for the bean name
-
setBeanName
Set theExpression
used to determine the name of the bean provided by this builder.- Parameters:
exprBeanName
- anExpression
for the bean name
-
getParameterList
public com.tangosol.coherence.config.ParameterList getParameterList()Return theParameterList
containing optional properties to inject into the realized bean.- Returns:
- the
ParameterList
-
setParameterList
public void setParameterList(com.tangosol.coherence.config.ParameterList listParameters) Sets theParameterList
containing 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:
realize
in interfacecom.tangosol.coherence.config.builder.ParameterizedBuilder<Object>
-
realizes
public boolean realizes(Class<?> clzClass, com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader) - Specified by:
realizes
in interfacecom.tangosol.coherence.config.builder.ParameterizedBuilder.ReflectionSupport
-
ensureBeanFactory
protected BeanFactory ensureBeanFactory(com.tangosol.config.expression.ParameterResolver resolver, ClassLoader loader) Ensure theBeanFactory
used by this builder to provide the bean indicated viagetBeanName()
.- Parameters:
resolver
- theParameterResolver
to use for resolving parametersloader
- theClassLoader
for loading any necessary classes- Returns:
- the
BeanFactory
used by this builder
-