You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/11/02 17:36:55 UTC
[12/33] ignite git commit: IGNITE-1409:
PlatformEventFilterListenerImpl is now Externalizable.
IGNITE-1409: PlatformEventFilterListenerImpl is now Externalizable.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/09339ded
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/09339ded
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/09339ded
Branch: refs/heads/ignite-1753-1282
Commit: 09339dedb3e1565522d1d114d08d17850606fc87
Parents: 85787be
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Oct 30 11:44:05 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Oct 30 11:44:05 2015 +0300
----------------------------------------------------------------------
.../events/PlatformEventFilterListenerImpl.java | 31 +++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/09339ded/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
index b2dfd1c..bbcb60f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
@@ -26,29 +26,40 @@ import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
import java.util.UUID;
/**
* Platform event filter. Delegates apply to native platform.
*/
-public class PlatformEventFilterListenerImpl implements PlatformEventFilterListener
+public class PlatformEventFilterListenerImpl implements PlatformEventFilterListener, Externalizable
{
/** */
private static final long serialVersionUID = 0L;
/** */
- private final Object pred;
+ private Object pred;
/** Event types. */
- private final int[] types;
+ private int[] types;
/** */
- protected transient long hnd;
+ private transient long hnd;
/** */
private transient PlatformContext ctx;
/**
+ * {@link Externalizable} support.
+ */
+ public PlatformEventFilterListenerImpl() {
+ // No-op.
+ }
+
+ /**
* Constructor.
*
* @param hnd Handle in the native platform.
@@ -160,4 +171,16 @@ public class PlatformEventFilterListenerImpl implements PlatformEventFilterListe
@Override public int hashCode() {
return (int)(hnd ^ (hnd >>> 32));
}
+
+ /** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeObject(pred);
+ out.writeObject(types);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ pred = in.readObject();
+ types = (int[])in.readObject();
+ }
}
\ No newline at end of file