Top Description Fields Constructors Methods
org.springframework.jms.support.destination

public Class BeanFactoryDestinationResolver

extends Object
implements DestinationResolver, BeanFactoryAware
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.Aware, org.springframework.jms.support.destination.DestinationResolver
Imports
jakarta.jms.Destination, .JMSException, .Session, org.springframework.beans.BeansException, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, org.springframework.lang.Nullable, org.springframework.util.Assert

DestinationResolver implementation based on a Spring BeanFactory.

Will lookup Spring managed beans identified by bean name, expecting them to be of type jakarta.jms.Destination.

Author
Juergen Hoeller
Since
2.5
See Also
org.springframework.beans.factory.BeanFactory

Field Summary

Modifier and TypeField and Description
private BeanFactory

Constructor Summary

AccessConstructor and Description
public
public
BeanFactoryDestinationResolver(BeanFactory
the bean factory to be used to lookup Destination
beanFactory
)

Create a new instance of the BeanFactoryDestinationResolver class.

Method Summary

Modifier and TypeMethod and Description
public Destination
resolveDestinationName(Session
the current JMS Session (may be null if the resolver implementation is able to work without it)
session
,
String
the name of the destination
destinationName
,
boolean
true if the domain is pub-sub, false if P2P
pubSubDomain
)

Implements org.springframework.jms.support.destination.DestinationResolver.resolveDestinationName.

Resolve the given destination name, either as located resource or as dynamic destination.

public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanFactoryback to summary
private BeanFactory beanFactory
Annotations
@Nullable

Constructor Detail

BeanFactoryDestinationResolverback to summary
public BeanFactoryDestinationResolver()

Create a new instance of the BeanFactoryDestinationResolver class.

The BeanFactory to access must be set via setBeanFactory.

See Also
setBeanFactory
BeanFactoryDestinationResolverback to summary
public BeanFactoryDestinationResolver(BeanFactory beanFactory)

Create a new instance of the BeanFactoryDestinationResolver 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 using this class outside the context of a Spring IoC container.

Parameters
beanFactory:BeanFactory

the bean factory to be used to lookup Destination

Method Detail

resolveDestinationNameback to summary
public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException

Implements org.springframework.jms.support.destination.DestinationResolver.resolveDestinationName.

Doc from org.springframework.jms.support.destination.DestinationResolver.resolveDestinationName.

Resolve the given destination name, either as located resource or as dynamic destination.

Parameters
session:Session

the current JMS Session (may be null if the resolver implementation is able to work without it)

destinationName:String

the name of the destination

pubSubDomain:boolean

true if the domain is pub-sub, false if P2P

Returns:Destination

the JMS destination (either a topic or a queue)

Annotations
@Override
Exceptions
JMSException:
if the JMS Session failed to resolve the destination
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

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.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override