java.lang.Object | |
↳ | org.springframework.jms.support.JmsAccessor |
![]() |
![]() |
Base class for JmsTemplate
and other
JMS-accessing gateway helpers, defining common properties such as the
JMS ConnectionFactory to operate on. The subclass
JmsDestinationAccessor
adds further, destination-related properties.
Not intended to be used directly.
See JmsTemplate
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger | Logger available to subclasses |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
| |||||||||||
Return the ConnectionFactory that this accessor uses for obtaining
JMS Connection Connections.
| |||||||||||
Return the acknowledgement mode for JMS Session sessions.
| |||||||||||
Return whether the JMS Session sessions used by this
accessor are supposed to be transacted.
| |||||||||||
Set the ConnectionFactory to use for obtaining JMS Connection Connections.
| |||||||||||
Set the JMS acknowledgement mode that is used when creating a JMS
Session to send a message.
| |||||||||||
Set the JMS acknowledgement mode by the name of the corresponding constant
in the JMS Session interface, e.g.
| |||||||||||
Set the transaction mode that is used when creating a JMS Session.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert the specified checked javax.jms.JMSException JMSException to
a Spring runtime
JmsException
equivalent. | |||||||||||
Create a JMS Connection via this template's ConnectionFactory.
| |||||||||||
Create a JMS Session for the given Connection.
| |||||||||||
Determine whether the given Session is in client acknowledge mode.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Logger available to subclasses
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
Return the ConnectionFactory that this accessor uses for obtaining JMS Connection Connections.
Return the acknowledgement mode for JMS Session sessions.
Return whether the JMS Session sessions used by this accessor are supposed to be transacted.
Set the ConnectionFactory to use for obtaining JMS Connection Connections.
Set the JMS acknowledgement mode that is used when creating a JMS Session to send a message.
Default is Session#AUTO_ACKNOWLEDGE.
Vendor-specific extensions to the acknowledgment mode can be set here as well.
Note that that inside an EJB the parameters to create(Queue/Topic)Session(boolean transacted, int acknowledgeMode) method are not taken into account. Depending on the transaction context in the EJB, the container makes its own decisions on these values. See section 17.3.5 of the EJB spec.
sessionAcknowledgeMode | the acknowledgement mode constant |
---|
Set the JMS acknowledgement mode by the name of the corresponding constant in the JMS Session interface, e.g. "CLIENT_ACKNOWLEDGE".
If you want to use vendor-specific extensions to the acknowledgment mode,
use setSessionAcknowledgeModeName(String)
instead.
constantName | the name of the Session acknowledge mode constant |
---|
Set the transaction mode that is used when creating a JMS Session. Default is "false".
Note that within a JTA transaction, the parameters passed to
create(Queue/Topic)Session(boolean transacted, int acknowledgeMode)
method are not taken into account. Depending on the J2EE transaction context,
the container makes its own decisions on these values. Analogously, these
parameters are not taken into account within a locally managed transaction
either, since the accessor operates on an existing JMS Session in this case.
Setting this flag to "true" will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. The latter has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.
Convert the specified checked javax.jms.JMSException JMSException to
a Spring runtime JmsException
equivalent.
The default implementation delegates to the
convertJmsAccessException(JMSException)
method.
ex | the original checked JMSException to convert |
---|
JmsException
wrapping ex
Create a JMS Connection via this template's ConnectionFactory.
This implementation uses JMS 1.1 API.
if thrown by JMS API methods | |
JMSException |
Create a JMS Session for the given Connection.
This implementation uses JMS 1.1 API.
con | the JMS Connection to create a Session for |
---|
if thrown by JMS API methods | |
JMSException |
Determine whether the given Session is in client acknowledge mode.
This implementation uses JMS 1.1 API.
session | the JMS Session to check |
---|
if thrown by JMS API methods | |
JMSException |