Package org.apache.qpid.jms.policy
Class JmsDefaultPrefetchPolicy
java.lang.Object
org.apache.qpid.jms.policy.JmsDefaultPrefetchPolicy
- All Implemented Interfaces:
JmsPrefetchPolicy
Defines the prefetch message policies for different types of consumers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionInitialize default prefetch policiesCreates a new JmsPrefetchPolicy instance copied from the source policy. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copy this policy into a newly allocated instance.booleanintgetConfiguredPrefetch(JmsSession session, JmsDestination destination, boolean durable, boolean browser) Returns the prefetch value to use when creating a MessageConsumer instance.intintGets the currently configured max prefetch size value.intintintinthashCode()voidsetAll(int prefetch) Sets the prefetch values for all options in this policy to the set limit.voidsetDurableTopicPrefetch(int durableTopicPrefetch) Sets the durable topic prefetch value, this value is limited by the max prefetch size setting.voidsetMaxPrefetchSize(int maxPrefetchSize) Sets the maximum prefetch size value.voidsetQueueBrowserPrefetch(int queueBrowserPrefetch) voidsetQueuePrefetch(int queuePrefetch) voidsetTopicPrefetch(int topicPrefetch)
-
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
Creates a new JmsPrefetchPolicy instance copied from the source policy.- Parameters:
source- The policy instance to copy values from.
-
-
Method Details
-
copy
Description copied from interface:JmsPrefetchPolicyCopy this policy into a newly allocated instance.- Specified by:
copyin interfaceJmsPrefetchPolicy- 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:JmsPrefetchPolicyReturns the prefetch value to use when creating a MessageConsumer instance.- Specified by:
getConfiguredPrefetchin interfaceJmsPrefetchPolicy- 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() -
equals
-