activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r405397 - /incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
Date Tue, 09 May 2006 11:51:11 GMT
Author: aco
Date: Tue May  9 04:51:10 2006
New Revision: 405397

URL: http://svn.apache.org/viewcvs?rev=405397&view=rev
Log:
- Added means to configure the prefetch and optimizeAcknowledge setting of the connectionFactory
in the WebClient.

Modified:
    incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java

Modified: incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java?rev=405397&r1=405396&r2=405397&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
(original)
+++ incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/WebClient.java
Tue May  9 04:51:10 2006
@@ -64,6 +64,8 @@
 public class WebClient implements HttpSessionActivationListener, HttpSessionBindingListener,
Externalizable {
     public static final String webClientAttribute = "org.apache.activemq.webclient";
     public static final String connectionFactoryAttribute = "org.apache.activemq.connectionFactory";
+    public static final String connectionFactoryPrefetch = "org.apache.activemq.connectionFactory.prefetch";
+    public static final String connectionFactoryOptimizeAck = "org.apache.activemq.connectionFactory.optimizeAck";
     public static final String brokerUrlInitParam = "org.apache.activemq.brokerURL";
 
     private static final Log log = LogFactory.getLog(WebClient.class);
@@ -93,6 +95,7 @@
             client = WebClient.createWebClient(request);
             session.setAttribute(webClientAttribute, client);
         }
+
         return client;
     }
     /**
@@ -233,6 +236,19 @@
             }
 
             ActiveMQConnectionFactory amqfactory = new ActiveMQConnectionFactory(brokerURL);
+
+            // Set prefetch policy for factory
+            if (servletContext.getInitParameter(connectionFactoryPrefetch) != null) {
+                int prefetch = Integer.valueOf(servletContext.getInitParameter(connectionFactoryPrefetch)).intValue();
+                amqfactory.getPrefetchPolicy().setAll(prefetch);
+            }
+
+            // Set optimize acknowledge setting
+            if (servletContext.getInitParameter(connectionFactoryOptimizeAck) != null) {
+                boolean optimizeAck = Boolean.valueOf(servletContext.getInitParameter(connectionFactoryOptimizeAck)).booleanValue();
+                amqfactory.setOptimizeAcknowledge(optimizeAck);
+            }
+
             factory = amqfactory;
 
             servletContext.setAttribute(connectionFactoryAttribute, factory);



Mime
View raw message