Package org.apache.qpid.jms.policy
Class JmsDefaultPrefetchPolicy
- java.lang.Object
-
- org.apache.qpid.jms.policy.JmsDefaultPrefetchPolicy
-
- All Implemented Interfaces:
JmsPrefetchPolicy
public class JmsDefaultPrefetchPolicy extends java.lang.Object implements JmsPrefetchPolicy
Defines the prefetch message policies for different types of consumers
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DURABLE_TOPIC_PREFETCH
static int
DEFAULT_QUEUE_BROWSER_PREFETCH
static int
DEFAULT_QUEUE_PREFETCH
static int
DEFAULT_TOPIC_PREFETCH
static int
MAX_PREFETCH_SIZE
-
Constructor Summary
Constructors Constructor Description JmsDefaultPrefetchPolicy()
Initialize default prefetch policiesJmsDefaultPrefetchPolicy(JmsDefaultPrefetchPolicy source)
Creates a new JmsPrefetchPolicy instance copied from the source policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmsDefaultPrefetchPolicy
copy()
Copy this policy into a newly allocated instance.boolean
equals(java.lang.Object obj)
int
getConfiguredPrefetch(JmsSession session, JmsDestination destination, boolean durable, boolean browser)
Returns the prefetch value to use when creating a MessageConsumer instance.int
getDurableTopicPrefetch()
int
getMaxPrefetchSize()
Gets the currently configured max prefetch size value.int
getQueueBrowserPrefetch()
int
getQueuePrefetch()
int
getTopicPrefetch()
int
hashCode()
void
setAll(int prefetch)
Sets the prefetch values for all options in this policy to the set limit.void
setDurableTopicPrefetch(int durableTopicPrefetch)
Sets the durable topic prefetch value, this value is limited by the max prefetch size setting.void
setMaxPrefetchSize(int maxPrefetchSize)
Sets the maximum prefetch size value.void
setQueueBrowserPrefetch(int queueBrowserPrefetch)
void
setQueuePrefetch(int queuePrefetch)
void
setTopicPrefetch(int topicPrefetch)
-
-
-
Field Detail
-
MAX_PREFETCH_SIZE
public static final int MAX_PREFETCH_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_QUEUE_PREFETCH
public static final int DEFAULT_QUEUE_PREFETCH
- See Also:
- Constant Field Values
-
DEFAULT_QUEUE_BROWSER_PREFETCH
public static final int DEFAULT_QUEUE_BROWSER_PREFETCH
- See Also:
- Constant Field Values
-
DEFAULT_DURABLE_TOPIC_PREFETCH
public static final int DEFAULT_DURABLE_TOPIC_PREFETCH
- See Also:
- Constant Field Values
-
DEFAULT_TOPIC_PREFETCH
public static final int DEFAULT_TOPIC_PREFETCH
- See Also:
- Constant Field Values
-
-
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
-
copy
public JmsDefaultPrefetchPolicy copy()
Description copied from interface:JmsPrefetchPolicy
Copy this policy into a newly allocated instance.- Specified by:
copy
in 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:JmsPrefetchPolicy
Returns the prefetch value to use when creating a MessageConsumer instance.- Specified by:
getConfiguredPrefetch
in 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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-