added missing @Override annotations

This commit is contained in:
Juergen Hoeller 2012-01-15 19:54:10 +01:00
parent 3fdbe1081d
commit 697bc43c40
4 changed files with 22 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -151,6 +151,7 @@ public abstract class AbstractJmsListeningContainer extends JmsDestinationAccess
/** /**
* Delegates to {@link #validateConfiguration()} and {@link #initialize()}. * Delegates to {@link #validateConfiguration()} and {@link #initialize()}.
*/ */
@Override
public void afterPropertiesSet() { public void afterPropertiesSet() {
super.afterPropertiesSet(); super.afterPropertiesSet();
validateConfiguration(); validateConfiguration();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -410,6 +410,7 @@ public abstract class AbstractMessageListenerContainer extends AbstractJmsListen
return this.acceptMessagesWhileStopping; return this.acceptMessagesWhileStopping;
} }
@Override
protected void validateConfiguration() { protected void validateConfiguration() {
if (this.destination == null) { if (this.destination == null) {
throw new IllegalArgumentException("Property 'destination' or 'destinationName' is required"); throw new IllegalArgumentException("Property 'destination' or 'destinationName' is required");

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -75,8 +75,7 @@ import org.springframework.transaction.support.TransactionSynchronizationUtils;
* @see #receiveAndExecute * @see #receiveAndExecute
* @see #setTransactionManager * @see #setTransactionManager
*/ */
public abstract class AbstractPollingMessageListenerContainer extends AbstractMessageListenerContainer public abstract class AbstractPollingMessageListenerContainer extends AbstractMessageListenerContainer {
implements BeanNameAware {
/** /**
* The default receive timeout: 1000 ms = 1 second. * The default receive timeout: 1000 ms = 1 second.
@ -100,6 +99,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
private volatile Boolean commitAfterNoMessageReceived; private volatile Boolean commitAfterNoMessageReceived;
@Override
public void setSessionTransacted(boolean sessionTransacted) { public void setSessionTransacted(boolean sessionTransacted) {
super.setSessionTransacted(sessionTransacted); super.setSessionTransacted(sessionTransacted);
this.sessionTransactedCalled = true; this.sessionTransactedCalled = true;
@ -188,6 +188,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
} }
@Override
public void initialize() { public void initialize() {
// Set sessionTransacted=true in case of a non-JTA transaction manager. // Set sessionTransacted=true in case of a non-JTA transaction manager.
if (!this.sessionTransactedCalled && if (!this.sessionTransactedCalled &&
@ -374,6 +375,7 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
* container's "sessionTransacted" flag being set to "true". * container's "sessionTransacted" flag being set to "true".
* @see org.springframework.jms.connection.JmsResourceHolder * @see org.springframework.jms.connection.JmsResourceHolder
*/ */
@Override
protected boolean isSessionLocallyTransacted(Session session) { protected boolean isSessionLocallyTransacted(Session session) {
if (!super.isSessionLocallyTransacted(session)) { if (!super.isSessionLocallyTransacted(session)) {
return false; return false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2011 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -470,6 +470,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
} }
} }
@Override
protected void validateConfiguration() { protected void validateConfiguration() {
super.validateConfiguration(); super.validateConfiguration();
synchronized (this.lifecycleMonitor) { synchronized (this.lifecycleMonitor) {
@ -484,6 +485,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
// Implementation of AbstractMessageListenerContainer's template methods // Implementation of AbstractMessageListenerContainer's template methods
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@Override
public void initialize() { public void initialize() {
// Adapt default cache level. // Adapt default cache level.
if (this.cacheLevel == CACHE_AUTO) { if (this.cacheLevel == CACHE_AUTO) {
@ -516,6 +518,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* @see #scheduleNewInvoker * @see #scheduleNewInvoker
* @see #setTaskExecutor * @see #setTaskExecutor
*/ */
@Override
protected void doInitialize() throws JMSException { protected void doInitialize() throws JMSException {
synchronized (this.lifecycleMonitor) { synchronized (this.lifecycleMonitor) {
for (int i = 0; i < this.concurrentConsumers; i++) { for (int i = 0; i < this.concurrentConsumers; i++) {
@ -527,6 +530,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
/** /**
* Destroy the registered JMS Sessions and associated MessageConsumers. * Destroy the registered JMS Sessions and associated MessageConsumers.
*/ */
@Override
protected void doShutdown() throws JMSException { protected void doShutdown() throws JMSException {
logger.debug("Waiting for shutdown of message listener invokers"); logger.debug("Waiting for shutdown of message listener invokers");
try { try {
@ -549,6 +553,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
/** /**
* Overridden to reset the stop callback, if any. * Overridden to reset the stop callback, if any.
*/ */
@Override
public void start() throws JmsException { public void start() throws JmsException {
synchronized (this.lifecycleMonitor) { synchronized (this.lifecycleMonitor) {
this.stopCallback = null; this.stopCallback = null;
@ -658,6 +663,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* @see #setCacheLevel * @see #setCacheLevel
* @see #CACHE_CONNECTION * @see #CACHE_CONNECTION
*/ */
@Override
protected final boolean sharedConnectionEnabled() { protected final boolean sharedConnectionEnabled() {
return (getCacheLevel() >= CACHE_CONNECTION); return (getCacheLevel() >= CACHE_CONNECTION);
} }
@ -666,6 +672,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* Re-executes the given task via this listener container's TaskExecutor. * Re-executes the given task via this listener container's TaskExecutor.
* @see #setTaskExecutor * @see #setTaskExecutor
*/ */
@Override
protected void doRescheduleTask(Object task) { protected void doRescheduleTask(Object task) {
this.taskExecutor.execute((Runnable) task); this.taskExecutor.execute((Runnable) task);
} }
@ -674,6 +681,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* Tries scheduling a new invoker, since we know messages are coming in... * Tries scheduling a new invoker, since we know messages are coming in...
* @see #scheduleNewInvokerIfAppropriate() * @see #scheduleNewInvokerIfAppropriate()
*/ */
@Override
protected void messageReceived(Object invoker, Session session) { protected void messageReceived(Object invoker, Session session) {
((AsyncMessageListenerInvoker) invoker).setIdle(false); ((AsyncMessageListenerInvoker) invoker).setIdle(false);
scheduleNewInvokerIfAppropriate(); scheduleNewInvokerIfAppropriate();
@ -682,6 +690,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
/** /**
* Marks the affected invoker as idle. * Marks the affected invoker as idle.
*/ */
@Override
protected void noMessageReceived(Object invoker, Session session) { protected void noMessageReceived(Object invoker, Session session) {
((AsyncMessageListenerInvoker) invoker).setIdle(true); ((AsyncMessageListenerInvoker) invoker).setIdle(true);
} }
@ -745,6 +754,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* asynchronous invokers to establish the shared Connection on first access. * asynchronous invokers to establish the shared Connection on first access.
* @see #refreshConnectionUntilSuccessful() * @see #refreshConnectionUntilSuccessful()
*/ */
@Override
protected void establishSharedConnection() { protected void establishSharedConnection() {
try { try {
super.establishSharedConnection(); super.establishSharedConnection();
@ -760,6 +770,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* <code>Connection.start()</code>, relying on listeners to perform * <code>Connection.start()</code>, relying on listeners to perform
* appropriate recovery. * appropriate recovery.
*/ */
@Override
protected void startSharedConnection() { protected void startSharedConnection() {
try { try {
super.startSharedConnection(); super.startSharedConnection();
@ -774,6 +785,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
* <code>Connection.stop()</code>, relying on listeners to perform * <code>Connection.stop()</code>, relying on listeners to perform
* appropriate recovery after a restart. * appropriate recovery after a restart.
*/ */
@Override
protected void stopSharedConnection() { protected void stopSharedConnection() {
try { try {
super.stopSharedConnection(); super.stopSharedConnection();