Class JmsDefaultPrefetchPolicy

java.lang.Object
org.apache.qpid.jms.policy.JmsDefaultPrefetchPolicy
All Implemented Interfaces:
JmsPrefetchPolicy

public class JmsDefaultPrefetchPolicy extends Object implements JmsPrefetchPolicy
Defines the prefetch message policies for different types of consumers
  • Field Details

    • MAX_PREFETCH_SIZE

      public static final int MAX_PREFETCH_SIZE
      See Also:
    • DEFAULT_QUEUE_PREFETCH

      public static final int DEFAULT_QUEUE_PREFETCH
      See Also:
    • DEFAULT_QUEUE_BROWSER_PREFETCH

      public static final int DEFAULT_QUEUE_BROWSER_PREFETCH
      See Also:
    • DEFAULT_DURABLE_TOPIC_PREFETCH

      public static final int DEFAULT_DURABLE_TOPIC_PREFETCH
      See Also:
    • DEFAULT_TOPIC_PREFETCH

      public static final int DEFAULT_TOPIC_PREFETCH
      See Also:
  • Constructor Details

    • 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 Details

    • copy

      public JmsDefaultPrefetchPolicy copy()
      Description copied from interface: JmsPrefetchPolicy
      Copy this policy into a newly allocated instance.
      Specified by:
      copy in interface JmsPrefetchPolicy
      Returns:
      a new JmsPrefetchPolicy that is a copy of this one.
    • 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 Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object