public abstract class JmsDestinationAccessor extends JmsAccessor
JmsTemplate
and other
JMS-accessing gateway helpers, adding destination-related properties to
JmsAccessor's
common properties.
Not intended to be used directly.
See JmsTemplate
.
JmsAccessor
,
JmsTemplate
Modifier and Type | Field and Description |
---|---|
static long |
RECEIVE_TIMEOUT_INDEFINITE_WAIT
Timeout value indicating a blocking receive without timeout.
|
static long |
RECEIVE_TIMEOUT_NO_WAIT
Timeout value indicating that a receive operation should
check if a message is immediately available without blocking.
|
logger
Constructor and Description |
---|
JmsDestinationAccessor() |
Modifier and Type | Method and Description |
---|---|
DestinationResolver |
getDestinationResolver()
Return the DestinationResolver for this accessor (never
null ). |
boolean |
isPubSubDomain()
Return whether the Publish/Subscribe domain (
Topics ) is used. |
protected Message |
receiveFromConsumer(MessageConsumer consumer,
long timeout)
Actually receive a message from the given consumer.
|
protected Destination |
resolveDestinationName(Session session,
java.lang.String destinationName)
Resolve the given destination name into a JMS
Destination ,
via this accessor's DestinationResolver . |
void |
setDestinationResolver(DestinationResolver destinationResolver)
Set the
DestinationResolver that is to be used to resolve
Destination references for this accessor. |
void |
setPubSubDomain(boolean pubSubDomain)
Configure the destination accessor with knowledge of the JMS domain used.
|
afterPropertiesSet, convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted
public static final long RECEIVE_TIMEOUT_NO_WAIT
public static final long RECEIVE_TIMEOUT_INDEFINITE_WAIT
public void setDestinationResolver(DestinationResolver destinationResolver)
DestinationResolver
that is to be used to resolve
Destination
references for this accessor.
The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.
public DestinationResolver getDestinationResolver()
null
).public void setPubSubDomain(boolean pubSubDomain)
This setting primarily indicates what type of destination to resolve if dynamic destinations are enabled.
pubSubDomain
- "true" for the Publish/Subscribe domain (Topics
),
"false" for the Point-to-Point domain (Queues
)setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)
public boolean isPubSubDomain()
protected Destination resolveDestinationName(Session session, java.lang.String destinationName) throws JMSException
Destination
,
via this accessor's DestinationResolver
.session
- the current JMS Session
destinationName
- the name of the destinationDestination
JMSException
- if resolution failedsetDestinationResolver(org.springframework.jms.support.destination.DestinationResolver)
protected Message receiveFromConsumer(MessageConsumer consumer, long timeout) throws JMSException
consumer
- the JMS MessageConsumer to receive withtimeout
- the receive timeout (a negative value indicates
a no-wait receive; 0 indicates an indefinite wait attempt)null
if noneJMSException
- if thrown by JMS API methodsRECEIVE_TIMEOUT_NO_WAIT
,
RECEIVE_TIMEOUT_INDEFINITE_WAIT