public class BeanFactoryDestinationResolver extends java.lang.Object implements DestinationResolver, 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 javax.jms.Destination
.
BeanFactory
Constructor and Description |
---|
BeanFactoryDestinationResolver()
Create a new instance of the
BeanFactoryDestinationResolver class. |
BeanFactoryDestinationResolver(org.springframework.beans.factory.BeanFactory beanFactory)
Create a new instance of the
BeanFactoryDestinationResolver class. |
Modifier and Type | Method and Description |
---|---|
Destination |
resolveDestinationName(Session session,
java.lang.String destinationName,
boolean pubSubDomain)
Resolve the given destination name, either as located resource
or as dynamic destination.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
public BeanFactoryDestinationResolver()
BeanFactoryDestinationResolver
class.
The BeanFactory to access must be set via setBeanFactory
.
public BeanFactoryDestinationResolver(org.springframework.beans.factory.BeanFactory beanFactory)
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.
beanFactory
- the bean factory to be used to lookup Destinatiosn
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
public Destination resolveDestinationName(Session session, java.lang.String destinationName, boolean pubSubDomain) throws JMSException
DestinationResolver
resolveDestinationName
in interface DestinationResolver
session
- the current JMS Session
(may be null
if the resolver implementation is able to work without it)destinationName
- the name of the destinationpubSubDomain
- true
if the domain is pub-sub, false
if P2PJMSException
- if the JMS Session failed to resolve the destination