polishing

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3289 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller 2010-04-22 17:38:49 +00:00
parent 4e04cfae4a
commit 17101c0dfe
3 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,7 +19,6 @@ package org.springframework.jms.listener;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.jms.Connection;
import javax.jms.JMSException;
@ -209,7 +208,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
*/
public void shutdown() throws JmsException {
logger.debug("Shutting down JMS listener container");
boolean wasRunning = false;
boolean wasRunning;
synchronized (this.lifecycleMonitor) {
wasRunning = this.running;
this.running = false;
@ -549,6 +548,9 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
}
}
/**
* Determine the number of currently paused tasks, if any.
*/
public int getPausedTaskCount() {
synchronized (this.lifecycleMonitor) {
return this.pausedTasks.size();

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -517,6 +517,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
* @see SessionAwareMessageListener
* @see #setExposeListenerSession
*/
@SuppressWarnings("unchecked")
protected void doInvokeListener(SessionAwareMessageListener listener, Session session, Message message)
throws JMSException {

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -236,7 +236,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
if (this.transactionManager != null) {
// Execute receive within transaction.
TransactionStatus status = this.transactionManager.getTransaction(this.transactionDefinition);
boolean messageReceived = true;
boolean messageReceived;
try {
messageReceived = doReceiveAndExecute(invoker, session, consumer, status);
}
@ -288,7 +288,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
transactional = (sessionToUse != null);
}
if (sessionToUse == null) {
Connection conToUse = null;
Connection conToUse;
if (sharedConnectionEnabled()) {
conToUse = getSharedConnection();
}