Class JmsDefaultPrefetchPolicy

  • All Implemented Interfaces:
    JmsPrefetchPolicy

    public class JmsDefaultPrefetchPolicy
    extends java.lang.Object
    implements JmsPrefetchPolicy
    Defines the prefetch message policies for different types of consumers
    • Constructor Detail

      • JmsDefaultPrefetchPolicy

        public JmsDefaultPrefetchPolicy()
        Initialize default prefetch policies
      • JmsDefaultPrefetchPolicy

        public JmsDefaultPrefetchPolicy​(JmsDefaultPrefetchPolicy source)
        Creates a new JmsPrefetchPolicy instance copied from the source policy.
        Parameters:
        source - The policy instance to copy values from.
    • Method Detail

      • getConfiguredPrefetch

        public int getConfiguredPrefetch​(JmsSession session,
                                         JmsDestination destination,
                                         boolean durable,
                                         boolean browser)
        Description copied from interface: JmsPrefetchPolicy
        Returns the prefetch value to use when creating a MessageConsumer instance.
        Specified by:
        getConfiguredPrefetch in interface JmsPrefetchPolicy
        Parameters:
        session - the Session that own the MessageConsumer being created. (null for a ConnectionConsumer).
        destination - the Destination that the consumer will be subscribed to.
        durable - indicates if the subscription being created is a durable subscription (Topics only).
        browser - indicates if the subscription being created is a message browser (Queues only).
        Returns:
        the prefetch value to assign the MessageConsumer being created.
      • getDurableTopicPrefetch

        public int getDurableTopicPrefetch()
        Returns:
        Returns the durableTopicPrefetch.
      • setDurableTopicPrefetch

        public void setDurableTopicPrefetch​(int durableTopicPrefetch)
        Sets the durable topic prefetch value, this value is limited by the max prefetch size setting.
        Parameters:
        durableTopicPrefetch - The durableTopicPrefetch to set.
      • getQueuePrefetch

        public int getQueuePrefetch()
        Returns:
        Returns the queuePrefetch.
      • setQueuePrefetch

        public void setQueuePrefetch​(int queuePrefetch)
        Parameters:
        queuePrefetch - The queuePrefetch to set.
      • getQueueBrowserPrefetch

        public int getQueueBrowserPrefetch()
        Returns:
        Returns the queueBrowserPrefetch.
      • setQueueBrowserPrefetch

        public void setQueueBrowserPrefetch​(int queueBrowserPrefetch)
        Parameters:
        queueBrowserPrefetch - The queueBrowserPrefetch to set.
      • getTopicPrefetch

        public int getTopicPrefetch()
        Returns:
        Returns the topicPrefetch.
      • setTopicPrefetch

        public void setTopicPrefetch​(int topicPrefetch)
        Parameters:
        topicPrefetch - The topicPrefetch to set.
      • getMaxPrefetchSize

        public int getMaxPrefetchSize()
        Gets the currently configured max prefetch size value.
        Returns:
        the currently configured max prefetch value.
      • setMaxPrefetchSize

        public void setMaxPrefetchSize​(int maxPrefetchSize)
        Sets the maximum prefetch size value.
        Parameters:
        maxPrefetchSize - The maximum allowed value for any of the prefetch size options.
      • setAll

        public void setAll​(int prefetch)
        Sets the prefetch values for all options in this policy to the set limit. If the value given is larger than the max prefetch value of this policy the new limit will be capped at the max prefetch value.
        Parameters:
        prefetch - The prefetch value to apply to all prefetch limits.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object