IGNITE-2979: Minor usability improvement for Java-based filters in platforms.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d6a143cb Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d6a143cb Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d6a143cb Branch: refs/heads/ignite-testing-discovery Commit: d6a143cb81fc8d0bf0a193372db7b06a9dd60d27 Parents: 218c4b6 Author: vozerov-gridgain <[email protected]> Authored: Fri Apr 15 11:57:05 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Fri Apr 15 11:57:05 2016 +0300 ---------------------------------------------------------------------- .../platform/cache/query/PlatformContinuousQueryImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d6a143cb/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java index e864029..abe5b76 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/query/PlatformContinuousQueryImpl.java @@ -27,6 +27,8 @@ import javax.cache.event.CacheEntryEvent; import javax.cache.event.CacheEntryEventFilter; import javax.cache.event.CacheEntryListenerException; import org.apache.ignite.IgniteCheckedException; +import org.apache.ignite.IgniteException; +import org.apache.ignite.cache.CacheEntryEventSerializableFilter; import org.apache.ignite.cache.query.ContinuousQuery; import org.apache.ignite.cache.query.Query; import org.apache.ignite.cache.query.QueryCursor; @@ -89,6 +91,10 @@ public class PlatformContinuousQueryImpl implements PlatformContinuousQuery { this.filter = filter; javaFilter = getJavaFilter(filter, platformCtx.kernalContext()); + + if (javaFilter != null && !(javaFilter instanceof CacheEntryEventSerializableFilter)) + throw new IgniteException("Java event filter must implement " + + CacheEntryEventSerializableFilter.class.getName() + " interface: " + javaFilter.getClass().getName()); } /**
