public class BeanFactoryChannelResolver extends Object implements DestinationResolver<MessageChannel>, BeanFactoryAware
DestinationResolver
implementation based on a Spring BeanFactory
.
Will lookup Spring managed beans identified by bean name,
expecting them to be of type MessageChannel
.
Consults a HeaderChannelRegistry
, if available, if the bean is not found.
BeanFactory
Constructor and Description |
---|
BeanFactoryChannelResolver()
Create a new instance of the
BeanFactoryChannelResolver class. |
BeanFactoryChannelResolver(BeanFactory beanFactory)
Create a new instance of the
BeanFactoryChannelResolver class. |
Modifier and Type | Method and Description |
---|---|
MessageChannel |
resolveDestination(String name) |
void |
setBeanFactory(BeanFactory beanFactory) |
public BeanFactoryChannelResolver()
BeanFactoryChannelResolver
class.
The BeanFactory to access must be set via setBeanFactory
.
This will happen automatically if this resolver is defined within an
ApplicationContext thereby receiving the callback upon initialization.
public BeanFactoryChannelResolver(BeanFactory beanFactory)
BeanFactoryChannelResolver
class.
Use of this constructor is redundant if this object is being created
by a Spring IoC container as the supplied BeanFactory
will be
replaced by the BeanFactory
that creates it (c.f. the
BeanFactoryAware
contract). So only use this constructor if you
are instantiating this object explicitly rather than defining a bean.
beanFactory
- the bean factory to be used to lookup MessageChannel
s.public void setBeanFactory(BeanFactory beanFactory)
setBeanFactory
in interface BeanFactoryAware
public MessageChannel resolveDestination(String name)
resolveDestination
in interface DestinationResolver<MessageChannel>