Class BeanFactoryChannelResolver
java.lang.Object
org.springframework.integration.support.channel.BeanFactoryChannelResolver
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>
public class BeanFactoryChannelResolver
extends java.lang.Object
implements org.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>, org.springframework.beans.factory.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.
- See Also:
BeanFactory
-
Constructor Summary
Constructors Constructor Description BeanFactoryChannelResolver()
Create a new instance of theBeanFactoryChannelResolver
class.BeanFactoryChannelResolver(org.springframework.beans.factory.BeanFactory beanFactory)
Create a new instance of theBeanFactoryChannelResolver
class. -
Method Summary
Modifier and Type Method Description org.springframework.messaging.MessageChannel
resolveDestination(java.lang.String name)
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
BeanFactoryChannelResolver
public BeanFactoryChannelResolver()Create a new instance of theBeanFactoryChannelResolver
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. -
BeanFactoryChannelResolver
public BeanFactoryChannelResolver(org.springframework.beans.factory.BeanFactory beanFactory)Create a new instance of theBeanFactoryChannelResolver
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 theBeanFactory
that creates it (c.f. theBeanFactoryAware
contract). So only use this constructor if you are instantiating this object explicitly rather than defining a bean.- Parameters:
beanFactory
- the bean factory to be used to lookupMessageChannel
s.
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
resolveDestination
public org.springframework.messaging.MessageChannel resolveDestination(java.lang.String name)- Specified by:
resolveDestination
in interfaceorg.springframework.messaging.core.DestinationResolver<org.springframework.messaging.MessageChannel>
-