Not intended to be used directly. See MessageTemplate.
+ ///
+ ///
+ /// Juergen Hoeller
+ /// Mark Pollack (.NET)
+ public class MessageDestinationAccessor : MessagingAccessor
+ {
+ #region Fields
+
+ private IDestinationResolver destinationResolver = new DynamicDestinationResolver();
+
+ private bool pubSubDomain = false;
+
+ #endregion
+
+ #region Properties
+
+ ///
+ /// 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.
+ virtual public IDestinationResolver DestinationResolver
+ {
+ get
+ {
+ return destinationResolver;
+ }
+
+ set
+ {
+ AssertUtils.ArgumentNotNull(value, "DestinationResolver must not be null");
+ this.destinationResolver = value;
+ }
+
+ }
+
+
+ ///
+ /// 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.
+ public virtual bool PubSubDomain
+ {
+ get
+ {
+ return pubSubDomain;
+ }
+
+ set
+ {
+ this.pubSubDomain = value;
+ }
+
+ }
+
+ #endregion
+
+ ///
+ /// Resolves the given destination name to a NMS destination.
+ ///
+ /// The current session.
+ /// Name of the destination.
+ /// The located IDestination
+ /// If resolution failed.
+ public virtual IDestination ResolveDestinationName(ISession session, System.String destinationName)
+ {
+ return DestinationResolver.ResolveDestinationName(session, destinationName, PubSubDomain);
+ }
+ }
+}