public class BeanFactoryMessageChannelDestinationResolver extends Object implements DestinationResolver<MessageChannel>, BeanFactoryAware
DestinationResolver
that interprets a destination
name as the bean name of a MessageChannel
and looks up the bean in
the configured BeanFactory
.Constructor and Description |
---|
BeanFactoryMessageChannelDestinationResolver()
A default constructor that can be used when the resolver itself is configured
as a Spring bean and will have the
BeanFactory injected as a result
of ing having implemented BeanFactoryAware . |
BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
A constructor that accepts a
BeanFactory useful if instantiating this
resolver manually rather than having it defined as a Spring-managed bean. |
Modifier and Type | Method and Description |
---|---|
MessageChannel |
resolveDestination(String name)
Resolve the given destination name.
|
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
public BeanFactoryMessageChannelDestinationResolver()
BeanFactory
injected as a result
of ing having implemented BeanFactoryAware
.public BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
BeanFactory
useful if instantiating this
resolver manually rather than having it defined as a Spring-managed bean.beanFactory
- the bean factory to perform lookups againstpublic void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeanInitializationException
public MessageChannel resolveDestination(String name)
DestinationResolver
resolveDestination
in interface DestinationResolver<MessageChannel>
name
- the destination name to resolvenull
)