public class BeanFactoryMessageChannelDestinationResolver extends Object implements DestinationResolver<MessageChannel>, BeanFactoryAware
Constructor and Description |
---|
BeanFactoryMessageChannelDestinationResolver()
Create a new instance of the
BeanFactoryMessageChannelDestinationResolver class. |
BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
Create a new instance of the
BeanFactoryMessageChannelDestinationResolver class. |
Modifier and Type | Method and Description |
---|---|
MessageChannel |
resolveDestination(String name) |
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
public BeanFactoryMessageChannelDestinationResolver()
BeanFactoryMessageChannelDestinationResolver
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 BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
BeanFactoryMessageChannelDestinationResolver
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 MessageChannel resolveDestination(String name)
resolveDestination
in interface DestinationResolver<MessageChannel>
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
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.BeansException
- in case of initialization errorsBeanInitializationException