Java Doc for JmsTemplate.java in  » J2EE » spring-framework-2.5 » org » springframework » jms » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.5 » org.springframework.jms.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.jms.support.destination.JmsDestinationAccessor
   org.springframework.jms.core.JmsTemplate

All known Subclasses:   org.springframework.jms.core.JmsTemplate102,
JmsTemplate
public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations(Code)
Helper class that simplifies synchronous JMS access code.

NOTE: This class requires a JMS 1.1+ provider because it builds on the domain-independent API. Use the JmsTemplate102 subclass for a JMS 1.0.2 provider, e.g. when running on a J2EE 1.3 server.

If you want to use dynamic destination creation, you must specify the type of JMS destination to create, using the "pubSubDomain" property. For other operations, this is not necessary, in contrast to when working with JmsTemplate102. Point-to-Point (Queues) is the default domain.

Default settings for JMS Sessions are "not transacted" and "auto-acknowledge". As defined by the J2EE specification, the transaction and acknowledgement parameters are ignored when a JMS Session is created inside an active transaction, no matter if a JTA transaction or a Spring-managed transaction. To configure them for native JMS usage, specify appropriate values for the "sessionTransacted" and "sessionAcknowledgeMode" bean properties.

This template uses a org.springframework.jms.support.destination.DynamicDestinationResolver and a org.springframework.jms.support.converter.SimpleMessageConverter as default strategies for resolving a destination name or converting a message, respectively. These defaults can be overridden through the "destinationResolver" and "messageConverter" bean properties.
author:
   Mark Pollack
author:
   Juergen Hoeller
since:
   1.1
See Also:   JmsTemplate.setConnectionFactory
See Also:   JmsTemplate.setPubSubDomain
See Also:   JmsTemplate.setDestinationResolver
See Also:   JmsTemplate.setMessageConverter
See Also:   JmsTemplate102
See Also:   javax.jms.MessageProducer
See Also:   javax.jms.MessageConsumer



Field Summary
final public static  longRECEIVE_TIMEOUT_INDEFINITE_WAIT
     Timeout value indicating a blocking receive without timeout.
final public static  longRECEIVE_TIMEOUT_NO_WAIT
     Timeout value indicating that a receive operation should check if a message is immediately available without blocking.

Constructor Summary
public  JmsTemplate()
     Create a new JmsTemplate for bean-style usage.
public  JmsTemplate(ConnectionFactory connectionFactory)
     Create a new JmsTemplate, given a ConnectionFactory.

Method Summary
public  voidconvertAndSend(Object message)
    
public  voidconvertAndSend(Destination destination, Object message)
    
public  voidconvertAndSend(String destinationName, Object message)
    
public  voidconvertAndSend(Object message, MessagePostProcessor postProcessor)
    
public  voidconvertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor)
    
public  voidconvertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor)
    
protected  MessageConsumercreateConsumer(Session session, Destination destination, String messageSelector)
     Create a JMS MessageConsumer for the given Session and Destination.
protected  MessageProducercreateProducer(Session session, Destination destination)
     Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).
protected  ObjectdoConvertFromMessage(Message message)
     Extract the content from the given JMS message.
protected  MessageProducerdoCreateProducer(Session session, Destination destination)
     Create a raw JMS MessageProducer for the given Session and Destination.
protected  MessagedoReceive(Session session, Destination destination, String messageSelector)
     Receive a JMS message.
protected  MessagedoReceive(Session session, MessageConsumer consumer)
     Actually receive a JMS message.
protected  voiddoSend(Session session, Destination destination, MessageCreator messageCreator)
     Send the given JMS message.
protected  voiddoSend(MessageProducer producer, Message message)
     Actually send the given JMS message.
public  Objectexecute(SessionCallback action, boolean startConnection)
     Execute the action specified by the given action object within a JMS Session.
public  Objectexecute(SessionCallback action)
    
public  Objectexecute(ProducerCallback action)
    
protected  ConnectiongetConnection(JmsResourceHolder holder)
     Fetch an appropriate Connection from the given JmsResourceHolder.
public  DestinationgetDefaultDestination()
     Return the destination to be used on send/receive operations that do not have a destination parameter.
public  StringgetDefaultDestinationName()
     Return the destination name to be used on send/receive operations that do not have a destination parameter.
public  intgetDeliveryMode()
     Return the delivery mode to use when sending a message.
public  MessageConvertergetMessageConverter()
     Return the message converter for this template.
public  intgetPriority()
     Return the priority of a message when sending.
public  longgetReceiveTimeout()
     Return the timeout to use for receive calls (in milliseconds).
protected  SessiongetSession(JmsResourceHolder holder)
     Fetch an appropriate Session from the given JmsResourceHolder.
public  longgetTimeToLive()
     Return the time-to-live of the message when sending.
protected  voidinitDefaultStrategies()
     Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter.
public  booleanisExplicitQosEnabled()
     If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message.
public  booleanisMessageIdEnabled()
     Return whether message IDs are enabled.
public  booleanisMessageTimestampEnabled()
     Return whether message timestamps are enabled.
public  booleanisPubSubNoLocal()
     Return whether to inhibit the delivery of messages published by its own connection.
protected  booleanisSessionLocallyTransacted(Session session)
     Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.

Note: The Session's own transacted flag will already have been checked before.

public  Messagereceive()
    
public  Messagereceive(Destination destination)
    
public  Messagereceive(String destinationName)
    
public  ObjectreceiveAndConvert()
    
public  ObjectreceiveAndConvert(Destination destination)
    
public  ObjectreceiveAndConvert(String destinationName)
    
public  MessagereceiveSelected(String messageSelector)
    
public  MessagereceiveSelected(Destination destination, String messageSelector)
    
public  MessagereceiveSelected(String destinationName, String messageSelector)
    
public  ObjectreceiveSelectedAndConvert(String messageSelector)
    
public  ObjectreceiveSelectedAndConvert(Destination destination, String messageSelector)
    
public  ObjectreceiveSelectedAndConvert(String destinationName, String messageSelector)
    
public  voidsend(MessageCreator messageCreator)
    
public  voidsend(Destination destination, MessageCreator messageCreator)
    
public  voidsend(String destinationName, MessageCreator messageCreator)
    
public  voidsetDefaultDestination(Destination destination)
     Set the destination to be used on send/receive operations that do not have a destination parameter.
public  voidsetDefaultDestinationName(String destinationName)
     Set the destination name to be used on send/receive operations that do not have a destination parameter.
public  voidsetDeliveryMode(int deliveryMode)
     Set the delivery mode to use when sending a message.
public  voidsetDeliveryPersistent(boolean deliveryPersistent)
     Set whether message delivery should be persistent or non-persistent, specified as boolean value ("true" or "false").
public  voidsetExplicitQosEnabled(boolean explicitQosEnabled)
     Set if the QOS values (deliveryMode, priority, timeToLive) should be used for sending a message.
public  voidsetMessageConverter(MessageConverter messageConverter)
     Set the message converter for this template.
public  voidsetMessageIdEnabled(boolean messageIdEnabled)
     Set whether message IDs are enabled.
public  voidsetMessageTimestampEnabled(boolean messageTimestampEnabled)
     Set whether message timestamps are enabled.
public  voidsetPriority(int priority)
     Set the priority of a message when sending.
public  voidsetPubSubNoLocal(boolean pubSubNoLocal)
     Set whether to inhibit the delivery of messages published by its own connection.
public  voidsetReceiveTimeout(long receiveTimeout)
     Set the timeout to use for receive calls (in milliseconds).
public  voidsetTimeToLive(long timeToLive)
     Set the time-to-live of the message when sending.

Field Detail
RECEIVE_TIMEOUT_INDEFINITE_WAIT
final public static long RECEIVE_TIMEOUT_INDEFINITE_WAIT(Code)
Timeout value indicating a blocking receive without timeout.



RECEIVE_TIMEOUT_NO_WAIT
final public static long RECEIVE_TIMEOUT_NO_WAIT(Code)
Timeout value indicating that a receive operation should check if a message is immediately available without blocking.




Constructor Detail
JmsTemplate
public JmsTemplate()(Code)
Create a new JmsTemplate for bean-style usage.

Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a JmsTemplate via a BeanFactory, typically setting the ConnectionFactory via setConnectionFactory.
See Also:   JmsTemplate.setConnectionFactory




JmsTemplate
public JmsTemplate(ConnectionFactory connectionFactory)(Code)
Create a new JmsTemplate, given a ConnectionFactory.
Parameters:
  connectionFactory - the ConnectionFactory to obtain Connections from




Method Detail
convertAndSend
public void convertAndSend(Object message) throws JmsException(Code)



convertAndSend
public void convertAndSend(Destination destination, Object message) throws JmsException(Code)



convertAndSend
public void convertAndSend(String destinationName, Object message) throws JmsException(Code)



convertAndSend
public void convertAndSend(Object message, MessagePostProcessor postProcessor) throws JmsException(Code)



convertAndSend
public void convertAndSend(Destination destination, Object message, MessagePostProcessor postProcessor) throws JmsException(Code)



convertAndSend
public void convertAndSend(String destinationName, Object message, MessagePostProcessor postProcessor) throws JmsException(Code)



createConsumer
protected MessageConsumer createConsumer(Session session, Destination destination, String messageSelector) throws JMSException(Code)
Create a JMS MessageConsumer for the given Session and Destination.

This implementation uses JMS 1.1 API.
Parameters:
  session - the JMS Session to create a MessageConsumer for
Parameters:
  destination - the JMS Destination to create a MessageConsumer for
Parameters:
  messageSelector - the message selector for this consumer (can be null) the new JMS MessageConsumer
throws:
  JMSException - if thrown by JMS API methods




createProducer
protected MessageProducer createProducer(Session session, Destination destination) throws JMSException(Code)
Create a JMS MessageProducer for the given Session and Destination, configuring it to disable message ids and/or timestamps (if necessary).

Delegates to doCreateProducer for creation of the raw JMS MessageProducer, which needs to be specific to JMS 1.1 or 1.0.2.
Parameters:
  session - the JMS Session to create a MessageProducer for
Parameters:
  destination - the JMS Destination to create a MessageProducer for the new JMS MessageProducer
throws:
  JMSException - if thrown by JMS API methods
See Also:   JmsTemplate.doCreateProducer
See Also:   JmsTemplate.setMessageIdEnabled
See Also:   JmsTemplate.setMessageTimestampEnabled




doConvertFromMessage
protected Object doConvertFromMessage(Message message)(Code)
Extract the content from the given JMS message.
Parameters:
  message - the JMS Message to convert (can be null) the content of the message, or null if none



doCreateProducer
protected MessageProducer doCreateProducer(Session session, Destination destination) throws JMSException(Code)
Create a raw JMS MessageProducer for the given Session and Destination.

This implementation uses JMS 1.1 API.
Parameters:
  session - the JMS Session to create a MessageProducer for
Parameters:
  destination - the JMS Destination to create a MessageProducer for the new JMS MessageProducer
throws:
  JMSException - if thrown by JMS API methods




doReceive
protected Message doReceive(Session session, Destination destination, String messageSelector) throws JMSException(Code)
Receive a JMS message.
Parameters:
  session - the JMS Session to operate on
Parameters:
  destination - the JMS Destination to receive from
Parameters:
  messageSelector - the message selector for this consumer (can be null) the JMS Message received, or null if none
throws:
  JMSException - if thrown by JMS API methods



doReceive
protected Message doReceive(Session session, MessageConsumer consumer) throws JMSException(Code)
Actually receive a JMS message.
Parameters:
  session - the JMS Session to operate on
Parameters:
  consumer - the JMS MessageConsumer to send with the JMS Message received, or null if none
throws:
  JMSException - if thrown by JMS API methods



doSend
protected void doSend(Session session, Destination destination, MessageCreator messageCreator) throws JMSException(Code)
Send the given JMS message.
Parameters:
  session - the JMS Session to operate on
Parameters:
  destination - the JMS Destination to send to
Parameters:
  messageCreator - callback to create a JMS Message
throws:
  JMSException - if thrown by JMS API methods



doSend
protected void doSend(MessageProducer producer, Message message) throws JMSException(Code)
Actually send the given JMS message.
Parameters:
  producer - the JMS MessageProducer to send with
Parameters:
  message - the JMS Message to send
throws:
  JMSException - if thrown by JMS API methods



execute
public Object execute(SessionCallback action, boolean startConnection) throws JmsException(Code)
Execute the action specified by the given action object within a JMS Session. Generalized version of execute(SessionCallback), allowing the JMS Connection to be started on the fly.

Use execute(SessionCallback) for the general case. Starting the JMS Connection is just necessary for receiving messages, which is preferably achieved through the receive methods.
Parameters:
  action - callback object that exposes the Session
Parameters:
  startConnection - whether to start the Connection the result object from working with the Session
throws:
  JmsException - if there is any problem
See Also:   JmsTemplate.execute(SessionCallback)
See Also:   JmsTemplate.receive




execute
public Object execute(SessionCallback action) throws JmsException(Code)



execute
public Object execute(ProducerCallback action) throws JmsException(Code)



getConnection
protected Connection getConnection(JmsResourceHolder holder)(Code)
Fetch an appropriate Connection from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Connection.
Parameters:
  holder - the JmsResourceHolder an appropriate Connection fetched from the holder,or null if none found




getDefaultDestination
public Destination getDefaultDestination()(Code)
Return the destination to be used on send/receive operations that do not have a destination parameter.



getDefaultDestinationName
public String getDefaultDestinationName()(Code)
Return the destination name to be used on send/receive operations that do not have a destination parameter.



getDeliveryMode
public int getDeliveryMode()(Code)
Return the delivery mode to use when sending a message.



getMessageConverter
public MessageConverter getMessageConverter()(Code)
Return the message converter for this template.



getPriority
public int getPriority()(Code)
Return the priority of a message when sending.



getReceiveTimeout
public long getReceiveTimeout()(Code)
Return the timeout to use for receive calls (in milliseconds).



getSession
protected Session getSession(JmsResourceHolder holder)(Code)
Fetch an appropriate Session from the given JmsResourceHolder.

This implementation accepts any JMS 1.1 Session.
Parameters:
  holder - the JmsResourceHolder an appropriate Session fetched from the holder,or null if none found




getTimeToLive
public long getTimeToLive()(Code)
Return the time-to-live of the message when sending.



initDefaultStrategies
protected void initDefaultStrategies()(Code)
Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter.
See Also:   JmsTemplate.setDestinationResolver
See Also:   JmsTemplate.setMessageConverter
See Also:   org.springframework.jms.support.destination.DynamicDestinationResolver
See Also:   org.springframework.jms.support.converter.SimpleMessageConverter



isExplicitQosEnabled
public boolean isExplicitQosEnabled()(Code)
If "true", then the values of deliveryMode, priority, and timeToLive will be used when sending a message. Otherwise, the default values, that may be set administratively, will be used. true if overriding default values of QOS parameters(deliveryMode, priority, and timeToLive)
See Also:   JmsTemplate.setDeliveryMode
See Also:   JmsTemplate.setPriority
See Also:   JmsTemplate.setTimeToLive



isMessageIdEnabled
public boolean isMessageIdEnabled()(Code)
Return whether message IDs are enabled.



isMessageTimestampEnabled
public boolean isMessageTimestampEnabled()(Code)
Return whether message timestamps are enabled.



isPubSubNoLocal
public boolean isPubSubNoLocal()(Code)
Return whether to inhibit the delivery of messages published by its own connection.



isSessionLocallyTransacted
protected boolean isSessionLocallyTransacted(Session session)(Code)
Check whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.

Note: The Session's own transacted flag will already have been checked before. This method is about finding out whether the Session's transaction is local or externally coordinated.
Parameters:
  session - the Session to check whether the given Session is locally transacted
See Also:   JmsTemplate.isSessionTransacted()
See Also:   org.springframework.jms.connection.ConnectionFactoryUtils.isSessionTransactional




receive
public Message receive() throws JmsException(Code)



receive
public Message receive(Destination destination) throws JmsException(Code)



receive
public Message receive(String destinationName) throws JmsException(Code)



receiveAndConvert
public Object receiveAndConvert() throws JmsException(Code)



receiveAndConvert
public Object receiveAndConvert(Destination destination) throws JmsException(Code)



receiveAndConvert
public Object receiveAndConvert(String destinationName) throws JmsException(Code)



receiveSelected
public Message receiveSelected(String messageSelector) throws JmsException(Code)



receiveSelected
public Message receiveSelected(Destination destination, String messageSelector) throws JmsException(Code)



receiveSelected
public Message receiveSelected(String destinationName, String messageSelector) throws JmsException(Code)



receiveSelectedAndConvert
public Object receiveSelectedAndConvert(String messageSelector) throws JmsException(Code)



receiveSelectedAndConvert
public Object receiveSelectedAndConvert(Destination destination, String messageSelector) throws JmsException(Code)



receiveSelectedAndConvert
public Object receiveSelectedAndConvert(String destinationName, String messageSelector) throws JmsException(Code)



send
public void send(MessageCreator messageCreator) throws JmsException(Code)



send
public void send(Destination destination, MessageCreator messageCreator) throws JmsException(Code)



send
public void send(String destinationName, MessageCreator messageCreator) throws JmsException(Code)



setDefaultDestination
public void setDefaultDestination(Destination destination)(Code)
Set the destination to be used on send/receive operations that do not have a destination parameter.

Alternatively, specify a "defaultDestinationName", to be dynamically resolved via the DestinationResolver.
See Also:   JmsTemplate.send(MessageCreator)
See Also:   JmsTemplate.convertAndSend(Object)
See Also:   JmsTemplate.convertAndSend(Object,MessagePostProcessor)
See Also:   JmsTemplate.setDefaultDestinationName(String)




setDefaultDestinationName
public void setDefaultDestinationName(String destinationName)(Code)
Set the destination name to be used on send/receive operations that do not have a destination parameter. The specified name will be dynamically resolved via the DestinationResolver.

Alternatively, specify a JMS Destination object as "defaultDestination".
See Also:   JmsTemplate.send(MessageCreator)
See Also:   JmsTemplate.convertAndSend(Object)
See Also:   JmsTemplate.convertAndSend(Object,MessagePostProcessor)
See Also:   JmsTemplate.setDestinationResolver
See Also:   JmsTemplate.setDefaultDestination(javax.jms.Destination)




setDeliveryMode
public void setDeliveryMode(int deliveryMode)(Code)
Set the delivery mode to use when sending a message. Default is the Message default: "PERSISTENT".

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".
Parameters:
  deliveryMode - the delivery mode to use
See Also:   JmsTemplate.isExplicitQosEnabled
See Also:   javax.jms.DeliveryMode.PERSISTENT
See Also:   javax.jms.DeliveryMode.NON_PERSISTENT
See Also:   javax.jms.Message.DEFAULT_DELIVERY_MODE
See Also:   javax.jms.MessageProducer.send(javax.jms.Messageintintlong)




setDeliveryPersistent
public void setDeliveryPersistent(boolean deliveryPersistent)(Code)
Set whether message delivery should be persistent or non-persistent, specified as boolean value ("true" or "false"). This will set the delivery mode accordingly, to either "PERSISTENT" (1) or "NON_PERSISTENT" (2).

Default it "true" aka delivery mode "PERSISTENT".
See Also:   JmsTemplate.setDeliveryMode(int)
See Also:   javax.jms.DeliveryMode.PERSISTENT
See Also:   javax.jms.DeliveryMode.NON_PERSISTENT




setExplicitQosEnabled
public void setExplicitQosEnabled(boolean explicitQosEnabled)(Code)
Set if the QOS values (deliveryMode, priority, timeToLive) should be used for sending a message.
See Also:   JmsTemplate.setDeliveryMode
See Also:   JmsTemplate.setPriority
See Also:   JmsTemplate.setTimeToLive



setMessageConverter
public void setMessageConverter(MessageConverter messageConverter)(Code)
Set the message converter for this template. Used to resolve Object parameters to convertAndSend methods and Object results from receiveAndConvert methods.

The default converter is a SimpleMessageConverter, which is able to handle BytesMessages, TextMessages and ObjectMessages.
See Also:   JmsTemplate.convertAndSend
See Also:   JmsTemplate.receiveAndConvert
See Also:   org.springframework.jms.support.converter.SimpleMessageConverter




setMessageIdEnabled
public void setMessageIdEnabled(boolean messageIdEnabled)(Code)
Set whether message IDs are enabled. Default is "true".

This is only a hint to the JMS producer. See the JMS javadocs for details.
See Also:   javax.jms.MessageProducer.setDisableMessageID




setMessageTimestampEnabled
public void setMessageTimestampEnabled(boolean messageTimestampEnabled)(Code)
Set whether message timestamps are enabled. Default is "true".

This is only a hint to the JMS producer. See the JMS javadocs for details.
See Also:   javax.jms.MessageProducer.setDisableMessageTimestamp




setPriority
public void setPriority(int priority)(Code)
Set the priority of a message when sending.

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".
See Also:   JmsTemplate.isExplicitQosEnabled
See Also:   javax.jms.Message.DEFAULT_PRIORITY
See Also:   javax.jms.MessageProducer.send(javax.jms.Messageintintlong)




setPubSubNoLocal
public void setPubSubNoLocal(boolean pubSubNoLocal)(Code)
Set whether to inhibit the delivery of messages published by its own connection. Default is "false".
See Also:   javax.jms.TopicSession.createSubscriber(javax.jms.TopicStringboolean)



setReceiveTimeout
public void setReceiveTimeout(long receiveTimeout)(Code)
Set the timeout to use for receive calls (in milliseconds).

The default is JmsTemplate.RECEIVE_TIMEOUT_INDEFINITE_WAIT , which indicates a blocking receive without timeout.

Specify JmsTemplate.RECEIVE_TIMEOUT_NO_WAIT to inidicate that a receive operation should check if a message is immediately available without blocking.
See Also:   javax.jms.MessageConsumer.receive(long)
See Also:   javax.jms.MessageConsumer.receive
See Also:   javax.jms.MessageConsumer.receiveNoWait




setTimeToLive
public void setTimeToLive(long timeToLive)(Code)
Set the time-to-live of the message when sending.

Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true".
Parameters:
  timeToLive - the message's lifetime (in milliseconds)
See Also:   JmsTemplate.isExplicitQosEnabled
See Also:   javax.jms.Message.DEFAULT_TIME_TO_LIVE
See Also:   javax.jms.MessageProducer.send(javax.jms.Messageintintlong)




Methods inherited from org.springframework.jms.support.destination.JmsDestinationAccessor
public DestinationResolver getDestinationResolver()(Code)(Java Doc)
public boolean isPubSubDomain()(Code)(Java Doc)
protected Destination resolveDestinationName(Session session, String destinationName) throws JMSException(Code)(Java Doc)
public void setDestinationResolver(DestinationResolver destinationResolver)(Code)(Java Doc)
public void setPubSubDomain(boolean pubSubDomain)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.