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

public abstract Class JmsDestinationAccessor

extends JmsAccessor
Class Inheritance
Known Direct Subclasses
org.springframework.jms.core.JmsTemplate, org.springframework.jms.listener.AbstractJmsListeningContainer
Imports
jakarta.jms.Destination, .JMSException, .Message, .MessageConsumer, .Session, org.springframework.jms.support.JmsAccessor, org.springframework.lang.Nullable, org.springframework.util.Assert

Base class for org.springframework.jms.core.JmsTemplate and other JMS-accessing gateway helpers, adding destination-related properties to JmsAccessor's common properties.

Not intended to be used directly. See org.springframework.jms.core.JmsTemplate.

Author
Juergen Hoeller
Since
1.2.5
See Also
org.springframework.jms.support.JmsAccessor, org.springframework.jms.core.JmsTemplate

Field Summary

Modifier and TypeField and Description
private DestinationResolver
private boolean
public static final long
RECEIVE_TIMEOUT_INDEFINITE_WAIT

Timeout value indicating a blocking receive without timeout.

public static final long
RECEIVE_TIMEOUT_NO_WAIT

Timeout value indicating that a receive operation should check if a message is immediately available without blocking.

Inherited from org.springframework.jms.support.JmsAccessor:
logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DestinationResolver
getDestinationResolver()

Return the DestinationResolver for this accessor (never null).

public boolean
isPubSubDomain()

Return whether the Publish/Subscribe domain (Topics) is used.

protected Message

Returns:

the JMS Message received, or null if none
receiveFromConsumer
(MessageConsumer
the JMS MessageConsumer to receive with
consumer
,
long
the receive timeout (a negative value indicates a no-wait receive; 0 indicates an indefinite wait attempt)
timeout
)

Actually receive a message from the given consumer.

protected Destination

Returns:

the located Destination
resolveDestinationName
(Session
the current JMS Session
session
,
String
the name of the destination
destinationName
)

Resolve the given destination name into a JMS Destination, via this accessor's DestinationResolver.

public void
setDestinationResolver(DestinationResolver destinationResolver)

Set the DestinationResolver that is to be used to resolve jakarta.jms.Destination references for this accessor.

public void
setPubSubDomain(boolean
"true" for the Publish/Subscribe domain (Topics), "false" for the Point-to-Point domain (Queues)
pubSubDomain
)

Configure the destination accessor with knowledge of the JMS domain used.

Inherited from org.springframework.jms.support.JmsAccessor:
afterPropertiesSetconvertJmsAccessExceptioncreateConnectioncreateSessiongetConnectionFactorygetSessionAcknowledgeModeisClientAcknowledgeisSessionTransactedobtainConnectionFactorysetConnectionFactorysetSessionAcknowledgeModesetSessionAcknowledgeModeNamesetSessionTransacted

Field Detail

destinationResolverback to summary
private DestinationResolver destinationResolver
pubSubDomainback to summary
private boolean pubSubDomain
RECEIVE_TIMEOUT_INDEFINITE_WAITback to summary
public static final long RECEIVE_TIMEOUT_INDEFINITE_WAIT

Timeout value indicating a blocking receive without timeout.

Since
4.3
RECEIVE_TIMEOUT_NO_WAITback to summary
public static final long RECEIVE_TIMEOUT_NO_WAIT

Timeout value indicating that a receive operation should check if a message is immediately available without blocking.

Since
4.3

Constructor Detail

JmsDestinationAccessorback to summary
public JmsDestinationAccessor()

Method Detail

getDestinationResolverback to summary
public DestinationResolver getDestinationResolver()

Return the DestinationResolver for this accessor (never null).

isPubSubDomainback to summary
public boolean isPubSubDomain()

Return whether the Publish/Subscribe domain (Topics) is used. Otherwise, the Point-to-Point domain (Queues) is used.

receiveFromConsumerback to summary
protected Message receiveFromConsumer(MessageConsumer consumer, long timeout) throws JMSException

Actually receive a message from the given consumer.

Parameters
consumer:MessageConsumer

the JMS MessageConsumer to receive with

timeout:long

the receive timeout (a negative value indicates a no-wait receive; 0 indicates an indefinite wait attempt)

Returns:Message

the JMS Message received, or null if none

Annotations
@Nullable
Exceptions
JMSException:
if thrown by JMS API methods
Since
4.3
See Also
RECEIVE_TIMEOUT_NO_WAIT, RECEIVE_TIMEOUT_INDEFINITE_WAIT
resolveDestinationNameback to summary
protected Destination resolveDestinationName(Session session, String destinationName) throws JMSException

Resolve the given destination name into a JMS Destination, via this accessor's DestinationResolver.

Parameters
session:Session

the current JMS Session

destinationName:String

the name of the destination

Returns:Destination

the located Destination

Exceptions
JMSException:
if resolution failed
See Also
setDestinationResolver
setDestinationResolverback to summary
public void setDestinationResolver(DestinationResolver destinationResolver)

Set the DestinationResolver that is to be used to resolve jakarta.jms.Destination references for this accessor.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

See Also
org.springframework.jms.support.destination.DynamicDestinationResolver, org.springframework.jms.support.destination.JndiDestinationResolver
setPubSubDomainback to summary
public void setPubSubDomain(boolean pubSubDomain)

Configure the destination accessor with knowledge of the JMS domain used. Default is Point-to-Point (Queues).

This setting primarily indicates what type of destination to resolve if dynamic destinations are enabled.

Parameters
pubSubDomain:boolean

"true" for the Publish/Subscribe domain (Topics), "false" for the Point-to-Point domain (Queues)

See Also
setDestinationResolver