Author: dkulp
Date: Tue Jan 27 18:09:57 2009
New Revision: 738178
URL: http://svn.apache.org/viewvc?rev=738178&view=rev
Log:
Expose a couple more jms listener properties to the config
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=738178&r1=738177&r2=738178&view=diff
==============================================================================
---
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Tue Jan 27 18:09:57 2009
@@ -29,6 +29,12 @@
import org.springframework.transaction.PlatformTransactionManager;
public class JMSConfiguration implements InitializingBean {
+ /**
+ * The use of -1 is to make easier to determine
+ * if the setCacheLevel has been called.
+ */
+ public static final int DEFAULT_VALUE = -1;
+
static final boolean DEFAULT_USEJMS11 = true;
private boolean usingEndpointInfo = true;
@@ -61,6 +67,43 @@
private String messageType = JMSConstants.TEXT_MESSAGE_TYPE;
private boolean pubSubDomain;
private boolean useConduitIdSelector = true;
+ private boolean autoResolveDestination;
+ private long recoveryInterval = DEFAULT_VALUE;
+ private int cacheLevel = DEFAULT_VALUE;
+ private String cacheLevelName;
+
+ public String getCacheLevelName() {
+ return cacheLevelName;
+ }
+
+ public void setCacheLevelName(String cacheLevelName) {
+ this.cacheLevelName = cacheLevelName;
+ }
+
+ public int getCacheLevel() {
+ return cacheLevel;
+ }
+
+ public void setCacheLevel(int cacheLevel) {
+ this.cacheLevel = cacheLevel;
+ }
+
+ public long getRecoveryInterval() {
+ return recoveryInterval;
+ }
+
+ public void setRecoveryInterval(long recoveryInterval) {
+ this.recoveryInterval = recoveryInterval;
+ }
+
+ public boolean isAutoResolveDestination() {
+ return autoResolveDestination;
+ }
+
+ public void setAutoResolveDestination(boolean autoResolveDestination) {
+ this.autoResolveDestination = autoResolveDestination;
+ }
+
public boolean isUsingEndpointInfo() {
return this.usingEndpointInfo;
Modified:
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=738178&r1=738177&r2=738178&view=diff
==============================================================================
---
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++
cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Tue Jan 27 18:09:57 2009
@@ -94,6 +94,14 @@
jmsListener.setSessionTransacted(jmsConfig.isSessionTransacted());
jmsListener.setTransactionManager(jmsConfig.getTransactionManager());
jmsListener.setMessageListener(listenerHandler);
+ if (jmsConfig.getRecoveryInterval() != JMSConfiguration.DEFAULT_VALUE)
{
+ jmsListener.setRecoveryInterval(jmsConfig.getRecoveryInterval());
+ }
+ if (jmsConfig.getCacheLevelName() != null &&
(jmsConfig.getCacheLevelName().trim().length() > 0)) {
+ jmsListener.setCacheLevelName(jmsConfig.getCacheLevelName());
+ } else if (jmsConfig.getCacheLevel() !=
JMSConfiguration.DEFAULT_VALUE) {
+ jmsListener.setCacheLevel(jmsConfig.getCacheLevel());
+ }
if (messageSelectorPrefix != null &&
jmsConfig.isUseConduitIdSelector()) {
jmsListener.setMessageSelector("JMSCorrelationID LIKE '" +
messageSelectorPrefix + "%'");
}
@@ -107,10 +115,14 @@
taskExecutor.setConcurrencyLimit(jmsConfig.getMaxConcurrentTasks());
jmsListener.setTaskExecutor(taskExecutor);
}
- JmsTemplate jmsTemplate = createJmsTemplate(jmsConfig, null);
- Destination dest = JMSFactory.resolveOrCreateDestination(jmsTemplate,
destinationName, jmsConfig
- .isPubSubDomain());
- jmsListener.setDestination(dest);
+ if (jmsConfig.isAutoResolveDestination()) {
+ jmsListener.setDestinationName(destinationName);
+ } else {
+ JmsTemplate jmsTemplate = createJmsTemplate(jmsConfig, null);
+ Destination dest =
JMSFactory.resolveOrCreateDestination(jmsTemplate, destinationName, jmsConfig
+ .isPubSubDomain());
+ jmsListener.setDestination(dest);
+ }
jmsListener.initialize();
return jmsListener;
}