Class BeanFactoryMessageChannelDestinationResolver
- java.lang.Object
- org.springframework.messaging.core.BeanFactoryMessageChannelDestinationResolver
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,DestinationResolver<MessageChannel>
public class BeanFactoryMessageChannelDestinationResolver extends Object implements DestinationResolver<MessageChannel>, BeanFactoryAware
An implementation ofDestinationResolver
that interprets a destination name as the bean name of aMessageChannel
and looks up the bean in the configuredBeanFactory
.- Since:
- 4.0
- Author:
- Mark Fisher
Constructor Summary
Constructors Constructor Description BeanFactoryMessageChannelDestinationResolver()
A default constructor that can be used when the resolver itself is configured as a Spring bean and will have theBeanFactory
injected as a result of ing having implementedBeanFactoryAware
.BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
A constructor that accepts aBeanFactory
useful if instantiating this resolver manually rather than having it defined as a Spring-managed bean.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageChannel
resolveDestination(String name)
Resolve the given destination name.void
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
Constructor Detail
BeanFactoryMessageChannelDestinationResolver
public BeanFactoryMessageChannelDestinationResolver()
A default constructor that can be used when the resolver itself is configured as a Spring bean and will have theBeanFactory
injected as a result of ing having implementedBeanFactoryAware
.
BeanFactoryMessageChannelDestinationResolver
public BeanFactoryMessageChannelDestinationResolver(BeanFactory beanFactory)
A constructor that accepts aBeanFactory
useful if instantiating this resolver manually rather than having it defined as a Spring-managed bean.- Parameters:
beanFactory
- the bean factory to perform lookups against
Method Detail
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface:BeanFactoryAware
Callback that supplies the owning factory to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
BeanInitializationException
resolveDestination
public MessageChannel resolveDestination(String name)
Description copied from interface:DestinationResolver
Resolve the given destination name.- Specified by:
resolveDestination
in interfaceDestinationResolver<MessageChannel>
- Parameters:
name
- the destination name to resolve- Returns:
- the resolved destination (never
null
)