Spring.Messaging.Nms Parser for the NMS <listener-container> element. Mark Fisher Juergen Hoeller Mark Pollack (.NET) Parse the specified XmlElement and register the resulting ObjectDefinitions with the IObjectDefinitionRegistry embedded in the supplied The element to be parsed. TThe object encapsulating the current state of the parsing process. Provides access to a IObjectDefinitionRegistry The primary object definition.

This method is never invoked if the parser is namespace aware and was called to process the root node.

Namespace parser for the nms namespace. Mark Fisher Juergen Hoeller Mark Pollack (.NET) Register a MessageListenerContainer for the 'listener-container' tag. NMS MessageConsumer decorator that adapts all calls to a shared MessageConsumer instance underneath. Juergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. The target. Receives the next message produced for this message consumer. the next message produced for this message consumer, , or null if this message consumer is concurrently closed Receives the next message that arrives within the specified timeout interval. The timeout value. the next message produced for this message consumer, or null if the timeout expires or this message consumer is concurrently closed Receives the next message if one is immediately available. the next message produced for this message consumer, or null if one is not available No-op implementation since it is caching. Dispose of wrapped MessageConsumer Description that shows this is a cached MessageConsumer Description that shows this is a cached MessageConsumer Gets the target MessageConsumer, the consumer we are 'wrapping' The target MessageConsumer. Register for message events. A Delegate that is called each time a Message is dispatched to allow the client to do any necessary transformations on the received message before it is delivered. MessageProducer decorator that adapts calls to a shared MessageProducer instance underneath, managing QoS settings locally within the decorator. Juergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. The target. Sends the specified message. The message. Sends a message to the specified message. The message to send. The QOS to use for sending . The message priority. The time to live. Sends a message to the specified destination. The destination. The message. Sends a message the specified destination. The destination. The message to send. The QOS to use for sending . The priority. The time to live. Creates the message. A new message Creates the text message. A new text message. Creates the text message. The text. A texst message with the given text. Creates the map message. a new map message. Creates the object message. The body. A new object message with the given body. Creates the bytes message. A new bytes message. Creates the bytes message. The body. A new bytes message with the given body. Creates the stream message. A new stream message. Reset properties. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Returns string indicated this is a wrapped MessageProducer Gets the target MessageProducer, the producer we are 'wrapping' The target MessageProducer. A delegate that is called each time a Message is sent from this Producer which allows the application to perform any needed transformations on the Message before it is sent. The Session instance sets the delegate on each Producer it creates. Gets or sets a value indicating what DeliveryMode this should use, for example a persistent QOS Gets or sets the time to live value for messages sent with this producer. The time to live. Gets or sets the request timeout for the message producer. The request timeout. Gets or sets the priority of messages sent with this producer. The priority. Gets or sets a value indicating whether disable setting of the message ID property. true if disable message ID setting; otherwise, false. Gets or sets a value indicating whether disable setting the message timestamp property. true if disable message timestamp; otherwise, false. Wrapper for Session that caches producers and registers itself as available to the session cache when being closed. Generally used for testing purposes or if need to get at the wrapped Session object via the TargetSession property (for vendor specific methods). Juergen Hoeller Mark Pollack Subinterface of Session to be implemented by implementations that wrap an Session to provide added functionality. Allows access to the the underlying target Session. Mark Pollack Gets the target session of the decorator. This will typically be the native provider Session or a wrapper from a session pool. The underlying session, never null Initializes a new instance of the class. The target session. The session list. The CachingConnectionFactory. Creates the producer, potentially returning a cached instance. A message producer, potentially cached. Creates the producer, potentially returning a cached instance. The destination. A message producer. If have not yet reached session cache size, cache the session, otherwise dispose of all cached message producers and close the session. Creates the consumer, potentially returning a cached instance. The destination. A message consumer Creates the consumer, potentially returning a cached instance. The destination. The selector. A message consumer Creates the consumer, potentially returning a cached instance. The destination. The selector. if set to true [no local]. A message consumer. Creates the durable consumer, potentially returning a cached instance. The destination. The name of the durable subscription. The selector. if set to true [no local]. A message consumer Deletes the durable consumer. The name of the durable subscription. Creates the consumer. The destination. The selector. if set to true [no local]. The durable subscription name. Gets the queue. The name. Gets the topic. The name. Creates the temporary queue. Creates the temporary topic. Deletes the destination. The destination. Creates the message. Creates the text message. Creates the text message. The text. Creates the map message. Creates the object message. The body. Creates the bytes message. Creates the bytes message. The body. Creates the stream message. Commits this instance. Rollbacks this instance. Call dispose on the target. Creates the queue browser with a specified selector The queue. The selector. The Queue browser Creates the queue browser. The queue. The Queue browser Returns a that represents the current . A that represents the current . Gets the target, for testing purposes. The target. A Delegate that is called each time a Message is dispatched to allow the client to do any necessary transformations on the received message before it is delivered. The Session instance sets the delegate on each Consumer it creates. A delegate that is called each time a Message is sent from this Producer which allows the application to perform any needed transformations on the Message before it is sent. The Session instance sets the delegate on each Producer it creates. Gets or sets the request timeout. The request timeout. Gets a value indicating whether this is transacted. true if transacted; otherwise, false. Gets the acknowledgement mode. The acknowledgement mode. subclass that adds Session, MessageProducer, and MessageConsumer caching. This ConnectionFactory also switches the ReconnectOnException property to true by default, allowing for automatic recovery of the underlying Connection. By default, only one single Session will be cached, with further requested Sessions being created and disposed on demand. Consider raising the SessionCacheSize property in case of a high-concurrency environment. NOTE: This ConnectionFactory requires explicit closing of all Sessions obtained from its shared Connection. This is the usual recommendation for native NMS access code anyway. However, with this ConnectionFactory, its use is mandatory in order to actually allow for Session reuse. Note also that MessageConsumers obtained from a cached Session won't get closed until the Session will eventually be removed from the pool. This may lead to semantic side effects in some cases. For a durable subscriber, the logical Session.Close() call will also close the subscription. Re-registering a durable consumer for the same subscription on the same Session handle is not supported; close and reobtain a cached Session first. Juergen Hoeller Mark Pollack (.NET) A ConnectionFactory adapter that returns the same Connection from all CreateConnection() calls, and ignores calls to Connection.Close(). According to the JMS Connection model, this is perfectly thread-safe. The shared Connection can be automatically recovered in case of an Exception. You can either pass in a specific Connection directly or let this factory lazily create a Connection via a given target ConnectionFactory. Useful for testing and in applications when you want to keep using the same Connection for multiple calls, without having a pooling ConnectionFactory underneath. This may span any number of transactions, even concurrently executing transactions. Note that Spring's message listener containers support the use of a shared Connection within each listener container instance. Using SingleConnectionFactory with a MessageListenerContainer only really makes sense for sharing a single Connection across multiple listener containers. Juergen Hoeller Mark Pollack Mark Pollack (.NET) Exception handler for exceptions from the messaging infrastrcture. Mark Pollack Called when there is an exception in message processing. The exception. Wrapped Connection Proxy Connection Whether the shared Connection has been started Synchronization monitor for the shared Connection Initializes a new instance of the class. Initializes a new instance of the class that alwasy returns the given Connection. The single Connection. Initializes a new instance of the class that alwasy returns a single Connection. The target connection factory. Creates the connection. A single shared connection Creates the connection. Name of the user. The password. Initialize the underlying shared Connection. Closes and reinitializes the Connection if an underlying Connection is present already. Exception listener callback that renews the underlying single Connection. The exception from the messaging infrastructure. Prepares the connection before it is exposed. The default implementation applies ExceptionListener and client id. Can be overridden in subclasses. The Connection to prepare. if thrown by any NMS API methods. Template method for obtaining a (potentially cached) Session. The connection to operate on. The session ack mode. the Session to use, or null to indicate creation of a raw standard Session reate a JMS Connection via this template's ConnectionFactory. Closes the given connection. The connection. Ensure that the connection or TargetConnectionFactory are specified. Close the underlying shared connection. The provider of this ConnectionFactory needs to care for proper shutdown. As this object implements an application context will automatically invoke this on distruction o Resets the underlying shared Connection, to be reinitialized on next access. Wrap the given Connection with a proxy that delegates every method call to it but suppresses close calls. This is useful for allowing application code to handle a special framework Connection just like an ordinary Connection from a ConnectionFactory. The original connection to wrap. the wrapped connection Gets or sets the target connection factory which will be used to create a single connection. The target connection factory. Gets or sets the client id for the single Connection created and exposed by this ConnectionFactory. Note that the client IDs need to be unique among all active Connections of teh underlying provider. Furthermore, a client ID can only be assigned if the original ConnectionFactory hasn't already assigned one. The client id. Gets or sets the exception listener implementation that should be registered with with the single Connection created by this factory, if any. The exception listener. Gets or sets a value indicating whether the single Connection should be reset (to be subsequently renewed) when a NMSException is reported by the underlying Connection. Default is false. Switch this to true to automatically trigger recover based on your messaging provider's exception notifications. Internally, this will lead to a special ExceptionListener (this SingleConnectionFactory itself) being registered with the underlying Connection. This can also be combined with a user-specified ExceptionListener, if desired. true attempt to reconnect on exception during next access; otherwise, false. Get/or set the broker Uri. Get/or set the redelivery policy that new IConnection objects are assigned upon creation. A Delegate that is called each time a Message is dispatched to allow the client to do any necessary transformations on the received message before it is delivered. The ConnectionFactory sets the provided delegate instance on each Connection instance that is created from this factory, each connection in turn passes the delegate along to each Session it creates which then passes that along to the Consumers it creates. A delegate that is called each time a Message is sent from this Producer which allows the application to perform any needed transformations on the Message before it is sent. The ConnectionFactory sets the provided delegate instance on each Connection instance that is created from this factory, each connection in turn passes the delegate along to each Session it creates which then passes that along to the Producers it creates. Gets the connection monitor. The connection monitor. Gets a value indicating whether this instance is started. true if this instance is started; otherwise, false. Initializes a new instance of the class. and sets the ReconnectOnException to true Initializes a new instance of the class for the given IConnectionFactory The target connection factory. Resets the Session cache as well as resetting the connection. Obtaining a cached Session. The connection to operate on. The session ack mode. The Session to use Wraps the given Session so that it delegates every method call to the target session but adapts close calls. This is useful for allowing application code to handle a special framework Session just like an ordinary Session. The original Session to wrap. The List of cached Sessions that the given Session belongs to. The wrapped Session Gets or sets the size of the session cache. This cache size is the maximum limit for the number of cached Sessions per session acknowledgement type (auto, client, dups_ok, transacted). As a consequence, the actual number of cached Sessions may be up to four times as high as the specified value - in the unlikely case of mixing and matching different acknowledgement types. Default is 1: caching a single Session, (re-)creating further ones on demand. Specify a number like 10 if you'd like to raise the number of cached Sessions; that said, 1 may be sufficient for low-concurrency scenarios. The size of the session cache. Gets or sets a value indicating whether to cache MessageProducers per Session instance. (more specifically: one MessageProducer per Destination and Session). Default is "true". Switch this to "false" in order to always, recreate MessageProducers on demand. true if should cache message producers; otherwise, false. Gets or sets a value indicating whether o cache JMS MessageConsumers per NMS Session instance. Mmore specifically: one MessageConsumer per Destination, selector String and Session. Note that durable subscribers will only be cached until logical closing of the Session handle. Default is "true". Switch this to "false" in order to always recreate MessageConsumers on demand. true to cache consumers per session instance; otherwise, false. Gets or sets a value indicating whether this instance is active. true if this instance is active; otherwise, false. Implementation of Spring IExceptionListener interface that supports chaining allowing the addition of multiple ExceptionListener instances in order. Juergen Hoeller Mark Pollack (.NET) Adds the exception listener to the chain The listener. Called when an exception occurs in message processing. The exception. Gets the exception listeners as an array. The exception listeners. Helper class for obtaining transactional NMS resources for a given ConnectionFactory. Juergen Hoeller Mark Pollack (.NET) Releases the given connection, stopping it (if necessary) and eventually closing it. Checks , if available. This is essentially a more sophisticated version of The connection to release. (if this is null, the call will be ignored) The ConnectionFactory that the Connection was obtained from. (may be null) whether the Connection might have been started by the application. Return the innermost target Session of the given Session. If the given Session is a decorated session, it will be unwrapped until a non-decorated Session is found. Otherwise, the passed-in Session will be returned as-is. The session to unwrap The innermost target Session, or the passed-in one if no decorator Determines whether the given JMS Session is transactional, that is, bound to the current thread by Spring's transaction facilities. The session to check. The ConnectionFactory that the Session originated from true if is session transactional, bound to current thread; otherwise, false. Obtain a NMS Session that is synchronized with the current transaction, if any. the ConnectionFactory to obtain a Session for the existing NMS Connection to obtain a Session for (may be null) whether to allow for a local NMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a ADO.NET-based one for a specific DataSource, for example), with the NMS transaction committing right after the main transaction. If not allowed, the given ConnectionFactory needs to handle transaction enlistment underneath the covers. the transactional Session, or null if none found NMSException in case of NMS failure Obtain a NMS Session that is synchronized with the current transaction, if any. the TransactionSynchronizationManager key to bind to (usually the ConnectionFactory) the ResourceFactory to use for extracting or creating NMS resources whether the underlying Connection approach should be started in order to allow for receiving messages. Note that a reused Connection may already have been started before, even if this flag is false. the transactional Session, or null if none found NMSException in case of NMS failure Callback interface for resource creation. Serving as argument for the DoGetTransactionalSession method. Fetch an appropriate Session from the given MessageResourceHolder. the MessageResourceHolder an appropriate Session fetched from the holder, or null if none found Fetch an appropriate Connection from the given MessageResourceHolder. the MessageResourceHolder an appropriate Connection fetched from the holder, or null if none found Create a new NMS Connection for registration with a MessageResourceHolder. the new NMS Connection NMSException if thrown by NMS API methods Create a new NMS ISession for registration with a MessageResourceHolder. the NMS Connection to create a ISession for the new NMS Session NMSException if thrown by NMS API methods Return whether to allow for a local NMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a ADO.NET-based one for a specific IDbProvider, for example), with the NMS transaction committing right after the main transaction. Returns whether to allow for synchronizing a local NMS transaction Callback for resource cleanup at the end of a non-native NMS transaction Extension of the ConnectionFactory interface, indicating how to release Connections obtained from it. Juergen Hoeller Mark Pollack (.NET) Shoulds we stop the connection, obtained from this ConnectionFactory? The connection to check. wheter a stop call is necessary Connection holder, wrapping a NMS Connection and a NMS Session. MessageTransactionManager binds instances of this class to the thread, for a given NMS ConnectionFactory.

Note: This is an SPI class, not intended to be used by applications.

Juergen Hoeller Mark Pollack (.NET)
Create a new MessageResourceHolder that is open for resources to be added. Initializes a new instance of the class at is open for resources to be added. The connection factory that this resource holder is associated with (may be null) Initializes a new instance of the class for the given Session. The session. Create a new MessageResourceHolder for the given NMS resources. the NMS Connection the NMS Session Initializes a new instance of the class. The connection factory. The connection. The session. Adds the connection to the list of resources managed by this holder. The connection. Adds the session to the list of resources managed by this holder. The session. Adds the session and connection to the list of resources managed by this holder. The session. The connection. Gets the connection managed by this resource holder A Connection, or null if no managed connection. Gets the connection of a given type managed by this resource holder. This is used when storing Queue or Topic Connections (from the older 1.0.2 API) as compared to the 'unified domain' API , just Connection, in the newer 1.2 API. Type of the connection. The connection, or null if not found. Gets the first session manged by this holder or null if not available. The session or null if not available. Gets the session managed by this holder by type. Type of the session. The session or null if not available. Gets the session of a given type associated with the given connection Type of the session. The connection. The sessin or null if not available. Commits all sessions. Closes all sessions then stops and closes all connections, in that order. Determines whether the holder contains the specified session. The session. true if the holder contains the specified session; otherwise, false. Gets a value indicating whether this is frozen, namely that additional resources can be registered with the holder. If using any of the constructors with a Session, the holder will be set to the frozen state. true if frozen; otherwise, false. A implementation for a single NMS ConnectionFactory. Binds a Connection/Session pair from the specified ConnecctionFactory to the thread, potentially allowing for one thread-bound Session per ConnectionFactory. Application code is required to retrieve the transactional Session via . Spring's will autodetect a thread-bound Session and automatically participate in it. The use of as a target for this transaction manager is strongly recommended. CachingConnectionFactory uses a single NMS Connection for all NMS access in order to avoid the overhead of repeated Connection creation, as well as maintaining a cache of Sessions. Each transaction will then share the same NMS Connection, while still using its own individual NMS Session. The use of a raw target ConnectionFactory would not only be inefficient because of the lack of resource reuse. It might also lead to strange effects when your NMS provider doesn't accept MessageProducer.close() calls and/or MessageConsumer.close() calls before Session.commit(), with the latter supposed to commit all the messages that have been sent through the producer handle and received through the consumer handle. As a safe general solution, always pass in a into this transaction manager's ConnectionFactory property. Transaction synchronization is turned off by default, as this manager might be used alongside an IDbProvider based Spring transaction manager such as the AdoPlatformTransactionManager, which has stronger needs for synchronization. Juergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a NmsTemplate via a ApplicationContext, typically setting the ConnectionFactory via ConnectionFactory property. Turns off transaction synchronization by default, as this manager might be used alongside a dbprovider-based Spring transaction manager like AdoPlatformTransactionManager, which has stronger needs for synchronization. Only one manager is allowed to drive synchronization at any point of time. Initializes a new instance of the class given a ConnectionFactory. The connection factory to obtain connections from. Make sure the ConnectionFactory has been set. Get the MessageTransactionObject. he MessageTransactionObject. Begin a new transaction with the given transaction definition. Transaction object returned by . instance, describing propagation behavior, isolation level, timeout etc. Does not have to care about applying the propagation behavior, as this has already been handled by this abstract manager. In the case of creation or system errors. Suspend the resources of the current transaction. Transaction object returned by . An object that holds suspended resources (will be kept unexamined for passing it into .) Transaction synchronization will already have been suspended. in case of system errors. Resume the resources of the current transaction. Transaction object returned by . The object that holds suspended resources as returned by . Transaction synchronization will be resumed afterwards. In the case of system errors. Perform an actual commit on the given transaction. The status representation of the transaction. In the case of system errors. Perform an actual rollback on the given transaction. The status representation of the transaction. In the case of system errors. Set the given transaction rollback-only. Only called on rollback if the current transaction takes part in an existing one. The status representation of the transaction. In the case of system errors. Cleanup resources after transaction completion. Transaction object returned by . Called after and execution on any outcome. Check if the given transaction object indicates an existing transaction (that is, a transaction which has already started). Transaction object returned by . True if there is an existing transaction. In the case of system errors. Creates the connection via thie manager's ConnectionFactory. The new Connection If thrown by underlying messaging APIs Creates the session for the given Connection The connection to create a Session for. the new Session If thrown by underlying messaging APIs Gets or sets the connection factory that this instance should manage transaction. for. The connection factory. Gets the resource factory that this transaction manager operates on, In tihs case the ConnectionFactory The ConnectionFactory. NMS Transaction object, representing a MessageResourceHolder. Used as transaction object by MessageTransactionManager Add information to show this is a shared NMS connection Description of connection wrapper Exception thrown when a synchronized local transaction failed to complete (after the main transaction has already completed). Jergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. Creates a new instance of the SynchedLocalTransactionFailedException class. with the specified message. A message about the exception. Creates a new instance of the SynchedLocalTransactionFailedException class with the specified message and root cause. A message about the exception. The root exception that is being wrapped. Initializes a new instance of the class. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Creates a NMS message given a Session

The Session typically is provided by an instance of the MessageTemplate class.

Mark Pollack
Create a Message to be sent. the NMS Session to be used to create the IMessage (never null) the Message to be sent NMSException if thrown by NMS API methods Interfaced based approach to listen to messaging events. Called when a message is delivered. The message. To be used with NmsTemplate's send method that convert an object to a message. It allows for further modification of the message after it has been processed by the converter. This is useful for setting of NMS Header and Properties. Mark Pollack Apply a IMessagePostProcessor to the message. The returned message is typically a modified version of the original. the NMS message from the IMessageConverter the modified version of the Message NMSException if thrown by NMS API methods Specifies a basic set of NMS operations.

Implemented by NmsTemplate. Not often used but a useful option to enhance testability, as it can easily be mocked or stubbed.

Provides NmsTemplate's send(..) and receive(..) methods that mirror various NMS API methods. See the NMS specification and NMS API docs for details on those methods.

Mark Pollack Juergen Hoeller Mark Pollack (.NET)
Execute the action specified by the given action object within a NMS Session. callback object that exposes the session the result object from working with the session NMSException if there is any problem Execute the action specified by the given action object within a NMS Session. delegate that exposes the session the result object from working with the session NMSException if there is any problem Send a message to a NMS destination. The callback gives access to the NMS session and MessageProducer in order to do more complex send operations. delegate that exposes the session/producer pair the result object from working with the session NMSException if there is any problem Send a message to a NMS destination. The callback gives access to the NMS session and MessageProducer in order to do more complex send operations. callback object that exposes the session/producer pair the result object from working with the session NMSException if there is any problem Send a message to the default destination.

This will only work with a default destination specified!

callback to create a message NMSException if there is any problem
Send a message to the specified destination. The IMessageCreator callback creates the message given a Session. the destination to send this message to callback to create a message NMSException if there is any problem Send a message to the specified destination. The IMessageCreator callback creates the message given a Session. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) callback to create a message NMSException if there is any problem Send a message to the default destination.

This will only work with a default destination specified!

delegate callback to create a message NMSException if there is any problem
Send a message to the specified destination. The IMessageCreator callback creates the message given a Session. the destination to send this message to delegate callback to create a message NMSException if there is any problem Send a message to the specified destination. The IMessageCreator callback creates the message given a Session. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) delegate callback to create a message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter.

This will only work with a default destination specified!

the object to convert to a message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. the destination to send this message to the object to convert to a message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

the object to convert to a message the callback to modify the message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the destination to send this message to the object to convert to a message the callback to modify the message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message. the callback to modify the message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

the object to convert to a message the callback to modify the message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the destination to send this message to the object to convert to a message the callback to modify the message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message. the callback to modify the message NMSException if there is any problem Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Callback for sending a message to a NMS destination.

To be used with the MessageTemplate.Execute(IProducerCallback) method, often implemented as an anonymous inner class.

The typical implementation will perform multiple operations on the supplied NMS Session and MessageProducer.

Mark Pollack
Perform operations on the given Session and MessageProducer. The message producer is not associated with any destination. the NMS Session object to use the NMS MessageProducer object to use a result object from working with the Session, if any (can be null) Callback for executing any number of operations on a provided Session To be used with the NmsTemplate.Execute(ISessionCallback)} method. See for the equivalent callback that can be used as a (anonymous) delegate. Mark Pollack Execute any number of operations against the supplied NMS Session, possibly returning a result. the NMS Session a result object from working with the Session, if any (so can be null) NMSException if there is any problem Delegate that creates a NMS message given a ISession the NMS Session to be used to create the Message (never null) the Message to be sent NMSException if thrown by NMS API methods Delegate that is used with NmsTemplate's ConvertAndSend method that converts an object. It allows for further modification of the message after it has been processed by the converter. This is useful for setting of NMS Header and Properties. Mark Pollack Convenient super class for application classes that need NMS access. Requires a ConnectionFactory or a NmsTemplate instance to be set. It will create its own NmsTemplate if a ConnectionFactory is passed in. A custom NmsTemplate instance can be created for a given ConnectionFactory through overriding the createNmsTemplate method. Creates a NmsTemplate for the given ConnectionFactory. Only invoked if populating the gateway with a ConnectionFactory reference. Can be overridden in subclasses to provide a different NmsTemplate instance The connection factory. Ensures that the JmsTemplate is specified and calls . Subclasses can override this for custom initialization behavior. Gets called after population of this instance's properties. Gets or sets the NMS template for the gateway. The NMS template. Gets or sets he NMS connection factory to be used by the gateway. Will automatically create a NmsTemplate for the given ConnectionFactory. The connection factory. Helper class that simplifies NMS access code. If you want to use dynamic destination creation, you must specify the type of NMS destination to create, using the "pubSubDomain" property. For other operations, this is not necessary. Point-to-Point (Queues) is the default domain. Default settings for NMS Sessions is "auto-acknowledge". This template uses a DynamicDestinationResolver and a SimpleMessageConverter as default strategies for resolving a destination name or converting a message, respectively. Mark Pollack Juergen Hoeller Mark Pollack (.NET) Base class for NmsTemplate} and other NMS-accessing gateway helpers, adding destination-related properties to MessagingAccessor's common properties.

Not intended to be used directly. See NmsTemplate.

Juergen Hoeller Mark Pollack (.NET)
Base class for NmsTemplate and other NMS-accessing gateway helpers It defines common properties like the ConnectionFactory}. The subclass NmsIDestinationAccessor adds further, destination-related properties. Not intended to be used directly. See NmsTemplate. Juergen Hoeller Mark Pollack (.NET) Verify that ConnectionFactory property has been set. Creates the connection via the ConnectionFactory. Creates the session for the given Connection The connection to create a session for. The new session Returns whether the ISession is in client acknowledgement mode. The session to check. true if in client ack mode, false otherwise Gets or sets the connection factory to use for obtaining NMS Connections. The connection factory. Gets or sets the session acknowledge mode for NMS Sessions including whether or not the session is transacted Set the NMS acknowledgement mode that is used when creating a NMS Session to send a message. The default is AUTO_ACKNOWLEDGE. The session acknowledge mode. Set the transaction mode that is used when creating a NMS Session. Default is "false". Setting this flag to "true" will use a short local NMS transaction when running outside of a managed transaction, and a synchronized local NMS transaction in case of a managed transaction being present. The latter has the effect of a local NMS transaction being managed alongside the main transaction (which might be a native ADO.NET transaction), with the NMS transaction committing right after the main transaction. Resolves the given destination name to a NMS destination. The current session. Name of the destination. The located IDestination If resolution failed. Gets or sets the destination resolver that is to be used to resolve IDestination references for this accessor. The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations. The destination resolver. Gets or sets a value indicating whether Publish/Subscribe domain (Topics) is used. Otherwise, the Point-to-Point domain (Queues) is used. this setting tells what type of destination to create if dynamic destinations are enabled. true if Publish/Subscribe domain; otherwise, false for the Point-to-Point domain. Timeout value indicating that a receive operation should check if a message is immediately available without blocking. Timeout value indicating a blocking receive without timeout. Create a new NmsTemplate. Note: The ConnectionFactory has to be set before using the instance. This constructor can be used to prepare a NmsTemplate via an ObjectFactory, typically setting the ConnectionFactory. Create a new NmsTemplate, given a ConnectionFactory. the ConnectionFactory to obtain IConnections from Initialize the default implementations for the template's strategies: DynamicDestinationResolver and SimpleMessageConverter. Execute the action specified by the given action object within a NMS Session. Generalized version of execute(ISessionCallback), allowing the NMS Connection to be started on the fly.

Use execute(ISessionCallback) for the general case. Starting the NMS Connection is just necessary for receiving messages, which is preferably achieved through the receive methods.

callback object that exposes the session Start the connection before performing callback action. the result object from working with the session NMSException if there is any problem
Extract the content from the given JMS message. The Message to convert (can be null). The content of the message, or null if none Fetch an appropriate Connection from the given MessageResourceHolder. the MessageResourceHolder an appropriate IConnection fetched from the holder, or null if none found Fetch an appropriate Session from the given MessageResourceHolder. the MessageResourceHolder an appropriate ISession fetched from the holder, or null if none found Create a NMS 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 NMS MessageProducer

the NMS Session to create a MessageProducer for the NMS Destination to create a MessageProducer for the new NMS MessageProducer NMSException if thrown by NMS API methods
Determines whether the given Session is locally transacted, that is, whether its transaction is managed by this template class's Session handling and not by an external transaction coordinator. 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. The session to check. true if the session is locally transacted; otherwise, false. Create a raw NMS MessageProducer for the given Session and Destination. the NMS Session to create a MessageProducer for the NMS IDestination to create a MessageProducer for the new NMS MessageProducer NMSException if thrown by NMS API methods Create a NMS MessageConsumer for the given Session and Destination. the NMS Session to create a MessageConsumer for the NMS Destination to create a MessageConsumer for the message selector for this consumer (can be null) the new NMS IMessageConsumer NMSException if thrown by NMS API methods Send the given message. The session to operate on. The destination to send to. The message creator delegate callback to create a Message. Send the given message. The session to operate on. The destination to send to. The message creator callback to create a Message. Send the given NMS message. the NMS Session to operate on the NMS Destination to send to callback to create a NMS Message delegate callback to create a NMS Message NMSException if thrown by NMS API methods Actually send the given NMS message. the NMS MessageProducer to send with the NMS Message to send NMSException if thrown by NMS API methods Execute the action specified by the given action object within a NMS Session. delegate that exposes the session the result object from working with the session Note that the value of PubSubDomain affects the behavior of this method. If PubSubDomain equals true, then a Session is passed to the callback. If false, then a ISession is passed to the callback.b NMSException if there is any problem Execute the action specified by the given action object within a NMS Session.

Note: The value of PubSubDomain affects the behavior of this method. If PubSubDomain equals true, then a Session is passed to the callback. If false, then a Session is passed to the callback.

callback object that exposes the session the result object from working with the session NMSException if there is any problem
Send a message to a NMS destination. The callback gives access to the NMS session and MessageProducer in order to do more complex send operations. callback object that exposes the session/producer pair the result object from working with the session NMSException if there is any problem Send a message to a NMS destination. The callback gives access to the NMS session and MessageProducer in order to do more complex send operations. delegate that exposes the session/producer pair the result object from working with the session NMSException if there is any problem Send a message to the default destination.

This will only work with a default destination specified!

delegate callback to create a message NMSException if there is any problem
Send a message to the specified destination. The MessageCreator callback creates the message given a Session. the destination to send this message to delegate callback to create a message NMSException if there is any problem Send a message to the specified destination. The MessageCreator callback creates the message given a Session. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) delegate callback to create a message NMSException if there is any problem Send a message to the default destination.

This will only work with a default destination specified!

callback to create a message NMSException if there is any problem
Send a message to the specified destination. The MessageCreator callback creates the message given a Session. the destination to send this message to callback to create a message NMSException if there is any problem Send a message to the specified destination. The MessageCreator callback creates the message given a Session. the destination to send this message to callback to create a message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter.

This will only work with a default destination specified!

the object to convert to a message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. the destination to send this message to the object to convert to a message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

the object to convert to a message the callback to modify the message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the destination to send this message to the object to convert to a message the callback to modify the message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message. the callback to modify the message NMSException if there is any problem Send the given object to the default destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion.

This will only work with a default destination specified!

the object to convert to a message the callback to modify the message NMSException if there is any problem
Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the destination to send this message to the object to convert to a message the callback to modify the message NMSException if there is any problem Send the given object to the specified destination, converting the object to a NMS message with a configured IMessageConverter. The IMessagePostProcessor callback allows for modification of the message after conversion. the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the object to convert to a message. the callback to modify the message NMSException if there is any problem Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message received by the consumer, or null if the timeout expires NMSException if there is any problem
Receive a message. The session to operate on. The destination to receive from. The message selector for this consumer (can be null The Message received, or null if none. Receive a message. The session to operate on. The consumer to receive with. The Message received, or null if none Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the default destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

This will only work with a default destination specified!

the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the destination to receive a message from the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Receive a message synchronously from the specified destination, but only wait up to a specified time for delivery. Convert the message into an object with a configured IMessageConverter.

This method should be used carefully, since it will block the thread until the message becomes available or until the timeout value is exceeded.

the name of the destination to send this message to (to be resolved to an actual destination by a DestinationResolver) the NMS message selector expression (or null if none). See the NMS specification for a detailed definition of selector expressions. the message produced for the consumer or null if the timeout expires. NMSException if there is any problem
Gets or sets the default 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. The default destination. Gets or sets the name of the default destination name to be used on send/receive operations that do not have a destination parameter. Alternatively, specify a NMS IDestination object as "DefaultDestination" The name of the default destination. Gets or sets 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 IBytesMessages, ITextMessages and IObjectMessages.

The message converter.
Gets or sets a value indicating whether Message Ids are enabled. true if message id enabled; otherwise, false. Gets or sets a value indicating whether message timestamps are enabled. true if [message timestamp enabled]; otherwise, false. Gets or sets a value indicating whether to inhibit the delivery of messages published by its own connection. true if inhibit the delivery of messages published by its own connection; otherwise, false. Gets or sets the receive timeout to use for recieve calls (in milliseconds) The default is -1, which means no timeout. The receive timeout. Gets or sets a value indicating whether to use explicit Quality of Service values. 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 use explicit QoS values; otherwise, false. Sets a value indicating whether message delivery should be persistent or non-persistent This will set the delivery to persistent or non-persistent

Default it "true" aka delivery mode "PERSISTENT".

true if [delivery persistent]; otherwise, false.
Gets or sets a value indicating what DeliveryMode this should use, for example a persistent QOS Gets or sets the priority when sending. Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true". The priority. Gets or sets the time to live when sending Since a default value may be defined administratively, this is only used when "isExplicitQosEnabled" equals "true". The time to live. ResourceFactory implementation that delegates to this template's callback methods. Implemention of NMS ITrace interface that will log NMS messages to Common.Logging. Registering of this class is done by default in NmsTemplate and SimpleMessageListenerContainer if the value of Apache.NMS.Tracer.Trace is null, indicating it was not set. Mark Pollack Initializes a new instance of the class. The log name used is typeof(NmsTrace). Initializes a new instance of the class. The log instance to use for logging. Logs message at Debug Level. The message. Logs message at Info Level. The message. Logs message at Warn Level. The message. Logs message at Error Level. The message. Logs message at Fatal Level. The message. Gets a value indicating whether the debug log level is enabled. true if this instance is debug enabled; otherwise, false. Gets a value indicating whether the info log level is enabled. true if this instance is info enabled; otherwise, false. Gets a value indicating whether the warn log level is enabled. true if this instance is warn enabled; otherwise, false. Gets a value indicating whether the error log level is enabled. true if this instance is error enabled; otherwise, false. Gets a value indicating whether the fatal log level is enabled. true if this instance is fatal enabled; otherwise, false. Perform operations on the given Session and MessageProducer. The message producer is not associated with any destination. the NMS Session object to use the NMS MessageProducer object to use a result object from working with the Session, if any (can be null) Callback delegate for code that operates on a Session. The NMS ISession object. Allows you to execute any number of operations on a single ISession, possibly returning a result a result. A result object from working with the Session, if any (so can be null) NMSException if there is any problem Mark Pollack Exception to be thrown when the execution of a listener method failed. Juergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. Initializes a new instance of the class, with the specified message The message. Initializes a new instance of the class, with the specified message and root cause exception The message. The inner exception. Initializes a new instance of the class. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Message listener adapter that delegates the handling of messages to target listener methods via reflection, with flexible message type conversion. Allows listener methods to operate on message content types, completely independent from the NMS API. By default, the content of incoming messages gets extracted before being passed into the target listener method, to let the target method operate on message content types such as String or byte array instead of the raw Message. Message type conversion is delegated to a Spring . By default, a will be used. (If you do not want such automatic message conversion taking place, then be sure to set the property to null.) If a target listener method returns a non-null object (typically of a message content type such as String or byte array), it will get wrapped in a NMS Message and sent to the response destination (either the NMS "reply-to" destination or the specified. The sending of response messages is only available when using the entry point (typically through a Spring message listener container). Usage as standard NMS MessageListener does not support the generation of response messages. Consult the reference documentation for examples of method signatures compliant with this adapter class. Juergen Hoeller Mark Pollack (.NET) Variant of the standard NMS MessageListener interface, offering not only the received Message but also the underlying Session object. The latter can be used to send reply messages, without the need to access an external Connection/Session, i.e. without the need to access the underlying ConnectionFactory. Supported by Spring's as direct alternative to the standard MessageListener interface. Juergen Hoeller Mark Pollack (.NET) Callback for processing a received NMS message. Implementors are supposed to process the given Message, typically sending reply messages through the given Session. the received NMS message the underlying NMS Session NMSException if thrown by NMS methods The default handler method name. Initializes a new instance of the class with default settings. Initializes a new instance of the class for the given handler object The delegate object. Standard JMS {@link MessageListener} entry point. Delegates the message to the target listener method, with appropriate conversion of the message arguments In case of an exception, the method will be invoked. Note Does not support sending response messages based on result objects returned from listener methods. Use the entry point (typically through a Spring message listener container) for handling result objects as well. The incoming message. Spring entry point. Delegates the message to the target listener method, with appropriate conversion of the message argument. If the target method returns a non-null object, wrap in a NMS message and send it back. The incoming message. The session to operate on. Initialize the default implementations for the adapter's strategies. Handle the given exception that arose during listener execution. The default implementation logs the exception at error level. This method only applies when used as standard NMS MessageListener. In case of the Spring mechanism, exceptions get handled by the caller instead. The exception to handle. Extract the message body from the given message. The message. the content of the message, to be passed into the listener method as argument if thrown by NMS API methods Gets the name of the listener method that is supposed to handle the given message. The default implementation simply returns the configured default listener method, if any. The NMS request message. The converted JMS request message, to be passed into the listener method as argument. the name of the listener method (never null) if thrown by NMS API methods Handles the given result object returned from the listener method, sending a response message back. The result object to handle (never null). The original request message. The session to operate on (may be null). Builds a JMS message to be sent as response based on the given result object. The JMS Session to operate on. The content of the message, as returned from the listener method. the JMS Message (never null) If there was an error in message conversion if thrown by NMS API methods Post-process the given response message before it will be sent. The default implementation sets the response's correlation id to the request message's correlation id. The original incoming message. The outgoing JMS message about to be sent. if thrown by NMS API methods Determine a response destination for the given message. The default implementation first checks the JMS Reply-To Destination of the supplied request; if that is not null it is returned; if it is null, then the configured default response destination is returned; if this too is null, then an is thrown. The original incoming message. Tthe outgoing message about to be sent. The session to operate on. the response destination (never null) if thrown by NMS API methods if no destination can be determined. Resolves the default response destination into a Destination, using this accessor's in case of a destination name. The session to operate on. The located destination Sends the given response message to the given destination. The session to operate on. The destination to send to. The outgoing message about to be sent. Post-process the given message producer before using it to send the response. The default implementation is empty. The producer that will be used to send the message. The outgoing message about to be sent. Gets or sets the handler object to delegate message listening to. Specified listener methods have to be present on this target object. If no explicit handler object has been specified, listener methods are expected to present on this adapter instance, that is, on a custom subclass of this adapter, defining listener methods. The handler object. Gets or sets the default handler method to delegate to, for the case where no specific listener method has been determined. Out-of-the-box value is ("HandleMessage"}. The default handler method. Sets the default destination to send response messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field. Response destinations are only relevant for listener methods that return result objects, which will be wrapped in a response message and sent to a response destination. Alternatively, specify a "DefaultResponseQueueName" or "DefaultResponseTopicName", to be dynamically resolved via the DestinationResolver. The default response destination. Sets the name of the default response queue to send response messages to. This will be applied in case of a request message that does not carry a "NMSReplyTo" field. Alternatively, specify a JMS Destination object as "defaultResponseDestination". The name of the default response destination queue. Sets the name of the default response topic to send response messages to. This will be applied in case of a request message that does not carry a "NMSReplyTo" field. Alternatively, specify a JMS Destination object as "defaultResponseDestination". The name of the default response destination topic. Gets or sets the destination resolver that should be used to resolve response destination names for this adapter. The default resolver is a . Specify another implementation, for other strategies, perhaps from a directory service. The destination resolver. Gets or sets the message converter that will convert incoming JMS messages to listener method arguments, and objects returned from listener methods back to NMS messages. The default converter is a {@link SimpleMessageConverter}, which is able to handle BytesMessages}, TextMessages, MapMessages, and ObjectMessages. The message converter. Internal class combining a destination name and its target destination type (queue or topic). Common base class for all containers which need to implement listening based on a Connection (either shared or freshly obtained for each attempt). Inherits basic Connection and Session configuration handling from the base class. This class provides basic lifecycle management, in particular management of a shared Connection. Subclasses are supposed to plug into this lifecycle, implementing the as well as Juergen Hoeller Mark Pollack(.NET) The monitor object to lock on when performing operations on the connection. The monitor object to lock on when performing operations that update the lifecycle of the container. Call base class method, then and then Validates the configuration of this container. The default implementation is empty. To be overriden in subclasses. Calls when the application context destroys the container instance. Initializes this container. Creates a Connection, starts the Connection (if the property hasn't been turned off), and calls . If startup failed Stop the shared connection, call , and close this container. Starts this container. if starting failed. Start the shared Connection, if any, and notify all invoker tasks. Stops this container. if stopping failed. Notify all invoker tasks and stop the shared Connection, if any. if thrown by NMS API methods. Register any invokers within this container. Subclasses need to implement this method for their specific invoker management process. A shared Connection, if any, will already have been started at this point. Close the registered invokers. Subclasses need to implement this method for their specific invoker management process. A shared Connection, if any, will automatically be closed afterwards. Establishes a shared Connection for this container. The default implementation delegates to which does one immediate attempt and throws an exception if it fails. Can be overridden to have a recovery process in place, retrying until a Connection can be successfully established. If thrown by NMS API methods Refreshes the shared connection that this container holds. Called on startup and also after an infrastructure exception that occurred during invoker setup and/or execution. If thrown by NMS API methods Creates the shared connection for this container. The default implementation creates a standard Connection and prepares it through the prepared Connection if the creation failed. Prepares the given connection, which is about to be registered as shared Connection for this container. The default implementation sets the specified client id, if any. Subclasses can override this to apply further settings. The connection to prepare. If the preparation efforts failed. Starts the shared connection. If thrown by NMS API methods Stops the shared connection. if thrown by NMS API methods. Gets or sets the client id for a shared Connection created and used by this container. Note that client ids need to be unique among all active Connections of the underlying JMS provider. Furthermore, a client id can only be assigned if the original ConnectionFactory hasn't already assigned one. The client id. Set whether to automatically start the listener after initialization.

Default is "true"; set this to "false" to allow for manual startup.

Set the name of the object in the object factory that created this object. The name of the object in the factory.

Invoked after population of normal object properties but before an init callback like 's method or a custom init-method.

Gets a value indicating whether this container is currently running, that is, whether it has been started and not stopped yet. true if this container is running; otherwise, false. Gets a value indicating whether this container's listeners are generally allowed to run. >This implementation always returns true; the default 'running' state is purely determined by /. Subclasses may override this method to check against temporary conditions that prevent listeners from actually running. In other words, they may apply further restrictions to the 'running' state, returning false if such a restriction prevents listeners from running. true if running allowed; otherwise, false. Gets a value indicating whether this container is currently active, that is, whether it has been set up but not shut down yet. true if active; otherwise, false. Return whether a shared NMS Connection should be maintained by this listener container base class. Gets the shared connection maintained by this container. Available after initialization. The shared connection (never null) if this container does not maintain a shared Connection, or if the Connection hasn't been initialized yet. Exception that indicates that the initial setup of this container's shared Connection failed. This is indicating to invokers that they need to establish the shared Connection themselves on first access. Initializes a new instance of the class. Initializes a new instance of the class. The message. Initializes a new instance of the class, with the specified message and root cause exception The message. The inner exception. Initializes a new instance of the class. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Abstract base class for message listener containers. Can either host a standard NMS MessageListener or a Spring-specific Validate that the destination is not null and that if the subscription is durable, then we are not using the Pub/Sub domain. Executes the specified listener, committing or rolling back the transaction afterwards (if necessary). The session to operate on. The received message. Executes the specified listener, committing or rolling back the transaction afterwards (if necessary). The session to operate on. The received message. If thrown by NMS API methods. Invokes the specified listener: either as standard NMS MessageListener or (preferably) as Spring SessionAwareMessageListener. The session to operate on. The received message. If thrown by NMS API methods. Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new NMS Session (potentially with its own transaction) to the listener if demanded. The Spring ISessionAwareMessageListener to invoke. The session to operate on. The received message. If thrown by NMS API methods. Invoke the specified listener as standard JMS MessageListener. Default implementation performs a plain invocation of the OnMessage methods The listener to invoke. The received message. if thrown by the NMS API methods Perform a commit or message acknowledgement, as appropriate The session to commit. The message to acknowledge. In case of commit failure Determines 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. 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. The session to check. true if the is session locally transacted; otherwise, false. Perform a rollback, if appropriate. The session to rollback. In case of a rollback error Perform a rollback, handling rollback excepitons properly. The session to rollback. The thrown application exception. in case of a rollback error. Handle the given exception that arose during listener execution. The default implementation logs the exception at error level, not propagating it to the JMS provider - assuming that all handling of acknowledgement and/or transactions is done by this listener container. This can be overridden in subclasses. The exceptin to handle Invokes the error handler. The exception. Invokes the registered exception listener, if any. The exception that arose during NMS processing. Checks the message listener, throwing an exception if it does not correspond to a supported listener type. By default, only a standard JMS MessageListener object or a Spring object will be accepted. The message listener. Gets or sets the destination to receive messages from. Will be null if the configured destination is not an actual Destination type; c.f. when the destination is a String. The destination. Gets or sets the name of the destination to receive messages from. Will be null if the configured destination is not a string type; c.f. when it is an actual Destination object. The name of the destination. Gets or sets the message selector. The message selector expression (or null if none).. Gets or sets the message listener to register. This can be either a standard NMS MessageListener object or a Spring object. The message listener. Gets or sets a value indicating whether the subscription is durable. Set whether to make the subscription durable. The durable subscription name to be used can be specified through the "DurableSubscriptionName" property. Default is "false". Set this to "true" to register a durable subscription, typically in combination with a "DurableSubscriptionName" value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain). true if the subscription is durable; otherwise, false. Gets or sets the name of the durable subscription to create. To be applied in case of a topic (pub-sub domain) with subscription durability activated. The durable subscription name needs to be unique within this client's client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each durable subscription. The name of the durable subscription. Gets or sets the exception listener to notify in case of a NMSException thrown by the registered message listener or the invocation infrastructure. The exception listener. Sets an ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default there will be no ErrorHandler so that error-level logging is the only result. The error handler. Gets or sets a value indicating whether to expose listener session to a registered as well as to calls. Default is "true", reusing the listener's Session. Turn this off to expose a fresh Session fetched from the same underlying Connection instead, which might be necessary on some messaging providers. Note that Sessions managed by an external transaction manager will always get exposed to calls. So in terms of NmsTemplate exposure, this setting only affects locally transacted Sessions. true if expose listener session; otherwise, false. Gets or sets a value indicating whether to accept messages while the listener container is in the process of stopping. Return whether to accept received messages while the listener container receive attempt. Switch this flag on to fully process such messages even in the stopping phase, with the drawback that even newly sent messages might still get processed (if coming in before all receive timeouts have expired). Aborting receive attempts for such incoming messages might lead to the provider's retry count decreasing for the affected messages. If you have a high number of concurrent consumers, make sure that the number of retries is higher than the number of consumers, to be on the safe side for all potential stopping scenarios. true if accept messages while in the process of stopping; otherwise, false. Internal exception class that indicates a rejected message on shutdown. Used to trigger a rollback for an external transaction manager in that case. MessageResourceHolder marker subclass that indicates local exposure, i.e. that does not indicate an externally managed transaction. Juergen Hoeller Mark Pollack (.NET) Initializes a new instance of the class. The session. Exception thrown when the maximum connection recovery time has been exceeded. Mark Pollack Initializes a new instance of the class. Initializes a new instance of the class, with the specified message The message. Initializes a new instance of the class, with the specified message and root cause exception The message. The inner exception. Initializes a new instance of the class. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. Message listener container that uses the plain NMS client API's MessageConsumer.Listener method to create concurrent MessageConsumers for the specified listeners. Mark Pollack The default recovery time interval between connection reconnection attempts The total time connection recovery will be attempted. Call base class for valdation and then check that if the subscription is durable that the number of concurrent consumers is equal to one. Creates the specified number of concurrent consumers, in the form of a JMS Session plus associated MessageConsumer Re-initializes this container's NMS message consumers, if not initialized already. Registers this listener container as NMS ExceptionListener on the shared connection. implementation, invoked by the NMS provider in case of connection failures. Re-initializes this listener container's shared connection and its sessions and consumers. The reported connection exception. Refresh the underlying Connection, not returning before an attempt has been successful. Called in case of a shared Connection as well as without shared Connection, so either needs to operate on the shared Connection or on a temporary Connection that just gets established for validation purposes. The default implementation retries until it successfully established a Connection, for as long as this message listener container is active. Applies the specified recovery interval between retries. The amount of time to sleep in between recovery attempts. Initialize the Sessions and MessageConsumers for this container. in case of setup failure. Creates a MessageConsumer for the given Session, registering a MessageListener for the specified listener The session to work on. the MessageConsumer"/> if thrown by NMS methods Close the message consumers and sessions. NMSException if destruction failed Creates a MessageConsumer for the given Session and Destination. The session to create a MessageConsumer for. The destination to create a MessageConsumer for. The new MessageConsumer Gets or sets a value indicating whether to inhibit the delivery of messages published by its own connection. Default is "false". true if should inhibit the delivery of messages published by its own connection; otherwise, false. Specify the number of concurrent consumers to create. Default is 1. Raising the number of concurrent consumers is recommendable in order to scale the consumption of messages coming in from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In general, stick with 1 consumer for low-volume queues. Do not raise the number of concurrent consumers for a topic. This would lead to concurrent consumption of the same message, which is hardly ever desirable. The concurrent consumers. Sets the time interval between connection recovery attempts. The default is 5 seconds. The recovery interval. Sets the max recovery time to try reconnection attempts. The default is 10 minutes. The max recovery time. Always use a shared NMS connection Strategy interface that specifies a IMessageConverter between .NET objects and NMS messages. Mark Pollack Juergen Hoeller Mark Pollack (.NET) Convert a .NET object to a NMS Message using the supplied session to create the message object. the object to convert the Session to use for creating a NMS Message the NMS Message NMSException if thrown by NMS API methods MessageConversionException in case of conversion failure Convert from a NMS Message to a .NET object. the message to convert the converted .NET object MessageConversionException in case of conversion failure Provides a layer of indirection when adding the 'type' of the object as a message property. Mark Pollack Convert from a type to a string. The type of object to convert. Convert from a string to a type The type id. Gets the name of the field in the message that has type information.. The name of the type id field. Thrown by IMessageConverter implementations when the conversion of an object to/from a Message fails. Mark Pollack Initializes a new instance of the class. Creates a new instance of the IMessageConverterException class. with the specified message. A message about the exception. Creates a new instance of the IMessageConverterException class with the specified message and root cause. A message about the exception. The root exception that is being wrapped. Initializes a new instance of the class. The SerializationInfo that holds the serialized object data about the exception being thrown. The StreamingContext that contains contextual information about the source or destination. A simple message converter that can handle ITextMessages, IBytesMessages, IMapMessages, and IObjectMessages. Used as default by NmsTemplate, for ConvertAndSend and ReceiveAndConvert operations.

Converts a String to a NMS ITextMessage, a byte array to a NMS IBytesMessage, a Map to a NMS IMapMessage, and a Serializable object to a NMS IObjectMessage (or vice versa).

Juergen Hoeller Mark Pollack (.NET)
Convert a .NET object to a NMS Message using the supplied session to create the message object. the object to convert the Session to use for creating a NMS Message the NMS Message NMSException if thrown by NMS API methods MessageConversionException in case of conversion failure Convert from a NMS Message to a .NET object. the message to convert the converted .NET object MessageConversionException in case of conversion failure Create a NMS ITextMessage for the given String. the String to convert current NMS session the resulting message NMSException if thrown by NMS methods Create a NMS IBytesMessage for the given byte array. the byyte array to convert current NMS session the resulting message NMSException if thrown by NMS methods Create a NMS IMapMessage for the given Map. the Map to convert current NMS session the resulting message NMSException if thrown by NMS methods Create a NMS IObjectMessage for the given Serializable object. the Serializable object to convert current NMS session the resulting message NMSException if thrown by NMS methods Extract a String from the given ITextMessage. the message to convert the resulting String NMSException if thrown by NMS methods Extract a byte array from the given IBytesMessage. the message to convert the resulting byte array NMSException if thrown by NMS methods Extract a IDictionary from the given IMapMessage. the message to convert the resulting Map NMSException if thrown by NMS methods Extracts the serializable object from the given object message. The message to convert. The resulting serializable object. Provides a layer of indirection when adding the 'type' of the object as a message property. Initializes a new instance of the [ERROR: invalid expression DeclaringTypeKind]. Convert from a type to a string. The type of object to convert. Convert from a string to a type. Will look into the IdTypeMapping dictionary first to resolve the type, then check if it is the well known typeId of 'Hashtable' followed by a strategy to resolve a fully qualfied name from a simple type name. This strategy requires that The type id. The type associated with the string. If the type can not be resolved. Afters the properties set. Gets or sets the id type mapping. The id type mapping. Gets the name of the field in the message that has type information.. The name of the type id field. Sets the default hashtable class. The default hashtable class. Gets or sets a value indicating whether use the assembly qualified name when creating a string from a type reference. By setting this property to true you will be able to easily share types that are available on both the publisher and consumer with minimal configuration. However, this means that the publishers and subscribers would be tightly coupled despite the use of loosely coupled messaging middleware. true if to the assembly qualified name; otherwise, false. Gets or sets the default namespace. The default namespace. Gets or sets the default name of the assembly. The default name of the assembly. Convert an object via XML serialization for sending via an ITextMessage Mark Pollack Convert a .NET object to a NMS Message using the supplied session to create the message object. the object to convert the Session to use for creating a NMS Message the NMS Message NMSException if thrown by NMS API methods MessageConversionException in case of conversion failure Gets the XML string for an object The object to convert. XML string Convert from a NMS Message to a .NET object. the message to convert the converted .NET object MessageConversionException in case of conversion failure Gets the type of the target given the message. The message. Type of the target Converts a byte array to a UTF8 string. The characters. UTF8 string Converts a UTF8 string to a byte array The p XML string. Sets the type mapper. The type mapper. Gets or sets a value indicating whether encoder should emit UTF8 byte order mark. Default is false. true to specify that a Unicode byte order mark is provided; otherwise, false. Gets or sets a value indicating whether to throw an exception on invalid bytes. Default is true. true to specify that an exception be thrown when an invalid encoding is detected; otherwise, false. Simple DestinationResolver implementation resolving destination names as dynamic destinations. Juergen Hoeller Mark Pollack (.NET) Strategy interface for resolving NMS destinations. Used by MessageTemplate for resolving destination names from simple Strings to actual IDestination implementation instances. The default DestinationResolver implementation used by MessageTemplate instances is the DynamicDestinationResolver class. Consider using the JndiDestinationResolver for more advanced scenarios. Juergen Hoeller Mark Pollack (.NET) Resolve the given destination name, either as located resource or as dynamic destination. the current NMS Session the name of the destination true if the domain is pub-sub, false if P2P the NMS destination (either a topic or a queue) NMSException if resolution failed Resolve the given destination name, either as located resource or as dynamic destination. the current NMS Session the name of the destination true if the domain is pub-sub, false if P2P the NMS destination (either a topic or a queue) NMSException if resolution failed Resolve the given destination name to a Topic. the current NMS Session the name of the desired Topic. the NMS Topic name NMSException if resolution failed Resolve the given destination name to a Queue. the current NMS Session the name of the desired Queue. the NMS Queue name NMSException if resolution failed Generic utility methods for working with NMS. Mainly for internal use within the framework, but also useful for custom NMS access code. Close the given NMS Connection and ignore any thrown exception. This is useful for typical finally blocks in manual NMS code. the NMS Connection to close (may be null) Close the given NMS Connection and ignore any thrown exception. This is useful for typical finally blocks in manual NMS code. the NMS Connection to close (may be null) whether to call stop() before closing Close the given NMS Session and ignore any thrown exception. This is useful for typical finally blocks in manual NMS code. the NMS Session to close (may be null) Close the given NMS MessageProducer and ignore any thrown exception. This is useful for typical finally blocks in manual NMS code. the NMS MessageProducer to close (may be null) Close the given NMS MessageConsumer and ignore any thrown exception. This is useful for typical finally blocks in manual NMS code. the NMS MessageConsumer to close (may be null) Commit the Session if not within a distributed transaction. Needs investigation - no distributed tx in .NET messaging providers the NMS Session to commit NMSException if committing failed Rollback the Session if not within a distributed transaction. Needs investigation - no distributed tx in EMS the NMS Session to rollback NMSException if committing failed