SGF-89 - Fixed invalid invocation of ContinuousQueryListeners.
ContinuousQueryListenerAdapter did not return after the invocation of the handleEvent(…) method of the listener delegate implements ContinousQueryListener. This caused an exception if the listener implementation did not one of the supported method signatures for reflection invocation. Fixed that by adding the necessary return statement. Added according test cases.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011 the original author or authors.
|
||||
* Copyright 2011-2012 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.
|
||||
@@ -68,6 +68,7 @@ import com.gemstone.gemfire.cache.query.CqQuery;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Costin Leau
|
||||
* @author Oliver Gierke
|
||||
* @see org.springframework.jms.listener.adapter.MessageListenerAdapter
|
||||
*/
|
||||
public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
|
||||
@@ -260,7 +261,6 @@ public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
|
||||
* @param event the incoming GemFire event
|
||||
* @see #handleListenerException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onEvent(CqEvent event) {
|
||||
try {
|
||||
|
||||
@@ -269,6 +269,7 @@ public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
|
||||
if (delegate != this) {
|
||||
if (delegate instanceof ContinuousQueryListener) {
|
||||
((ContinuousQueryListener) delegate).onEvent(event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +284,6 @@ public class ContinuousQueryListenerAdapter implements ContinuousQueryListener {
|
||||
+ "override the 'getListenerMethodName' method.");
|
||||
}
|
||||
|
||||
|
||||
invokeListenerMethod(event, methodName);
|
||||
} catch (Throwable th) {
|
||||
handleListenerException(th);
|
||||
|
||||
Reference in New Issue
Block a user