ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkuliche...@apache.org
Subject [30/55] [abbrv] incubator-ignite git commit: IGNITE-61 - Direct marshalling
Date Sun, 08 Feb 2015 07:55:47 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageReader.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageReader.java
deleted file mode 100644
index 574378f..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageReader.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.util.direct;
-
-import org.apache.ignite.internal.util.direct.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-import org.jetbrains.annotations.*;
-
-import java.nio.*;
-
-/**
- * Portable reader implementation.
- */
-public class GridTcpCommunicationMessageReader implements MessageReader {
-    /** Stream. */
-    private final GridTcpCommunicationByteBufferStream stream;
-
-    /** Whether last field was fully read. */
-    private boolean lastRead;
-
-    /**
-     * @param msgFactory Message factory.
-     */
-    public GridTcpCommunicationMessageReader(GridTcpMessageFactory msgFactory) {
-        this.stream = new GridTcpCommunicationByteBufferStream(msgFactory);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void setBuffer(ByteBuffer buf) {
-        stream.setBuffer(buf);
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte readByte(String name) {
-        if (stream.remaining() < 1) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readByte();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShort(String name) {
-        if (stream.remaining() < 2) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readShort();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readInt(String name) {
-        if (stream.remaining() < 4) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readInt();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public long readLong(String name) {
-        if (stream.remaining() < 8) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readLong();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public float readFloat(String name) {
-        if (stream.remaining() < 4) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readFloat();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public double readDouble(String name) {
-        if (stream.remaining() < 8) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readDouble();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public char readChar(String name) {
-        if (stream.remaining() < 2) {
-            lastRead = false;
-
-            return 0;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readChar();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean readBoolean(String name) {
-        if (stream.remaining() < 1) {
-            lastRead = false;
-
-            return false;
-        }
-        else {
-            lastRead = true;
-
-            return stream.readBoolean();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public byte[] readByteArray(String name) {
-        byte[] arr = stream.readByteArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public short[] readShortArray(String name) {
-        short[] arr = stream.readShortArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public int[] readIntArray(String name) {
-        int[] arr = stream.readIntArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public long[] readLongArray(String name) {
-        long[] arr = stream.readLongArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public float[] readFloatArray(String name) {
-        float[] arr = stream.readFloatArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public double[] readDoubleArray(String name) {
-        double[] arr = stream.readDoubleArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public char[] readCharArray(String name) {
-        char[] arr = stream.readCharArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public boolean[] readBooleanArray(String name) {
-        boolean[] arr = stream.readBooleanArray();
-
-        lastRead = stream.lastFinished();
-
-        return arr;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public GridTcpCommunicationMessageAdapter readMessage(String name) {
-        GridTcpCommunicationMessageAdapter msg = stream.readMessage();
-
-        lastRead = stream.lastFinished();
-
-        return msg;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isLastRead() {
-        return lastRead;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageWriter.java b/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageWriter.java
deleted file mode 100644
index 82ad4f8..0000000
--- a/modules/core/src/main/java/org/gridgain/grid/util/direct/GridTcpCommunicationMessageWriter.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/* @java.file.header */
-
-/*  _________        _____ __________________        _____
- *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
- *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
- *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
- *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
- */
-
-package org.gridgain.grid.util.direct;
-
-import org.apache.ignite.internal.util.direct.*;
-import org.apache.ignite.plugin.extensions.communication.*;
-import org.jetbrains.annotations.*;
-
-import java.nio.*;
-
-/**
- * Portable writer implementation.
- */
-public class GridTcpCommunicationMessageWriter implements MessageWriter {
-    /** Stream. */
-    private final GridTcpCommunicationByteBufferStream stream = new GridTcpCommunicationByteBufferStream(null);
-
-    /** {@inheritDoc} */
-    @Override public void setBuffer(ByteBuffer buf) {
-        stream.setBuffer(buf);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeByte(String name, byte val) {
-        if (stream.remaining() < 1)
-            return false;
-
-        stream.writeByte(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeShort(String name, short val) {
-        if (stream.remaining() < 2)
-            return false;
-
-        stream.writeShort(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeInt(String name, int val) {
-        if (stream.remaining() < 4)
-            return false;
-
-        stream.writeInt(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeLong(String name, long val) {
-        if (stream.remaining() < 8)
-            return false;
-
-        stream.writeLong(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeFloat(String name, float val) {
-        if (stream.remaining() < 4)
-            return false;
-
-        stream.writeFloat(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeDouble(String name, double val) {
-        if (stream.remaining() < 8)
-            return false;
-
-        stream.writeDouble(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeChar(String name, char val) {
-        if (stream.remaining() < 2)
-            return false;
-
-        stream.writeChar(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeBoolean(String name, boolean val) {
-        if (stream.remaining() < 1)
-            return false;
-
-        stream.writeBoolean(val);
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeByteArray(String name, @Nullable byte[] val) {
-        if (val != null) {
-            stream.writeByteArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeShortArray(String name, @Nullable short[] val) {
-        if (val != null) {
-            stream.writeShortArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeIntArray(String name, @Nullable int[] val) {
-        if (val != null) {
-            stream.writeIntArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeLongArray(String name, @Nullable long[] val) {
-        if (val != null) {
-            stream.writeLongArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeFloatArray(String name, @Nullable float[] val) {
-        if (val != null) {
-            stream.writeFloatArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeDoubleArray(String name, @Nullable double[] val) {
-        if (val != null) {
-            stream.writeDoubleArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeCharArray(String name, @Nullable char[] val) {
-        if (val != null) {
-            stream.writeCharArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeBooleanArray(String name, @Nullable boolean[] val) {
-        if (val != null) {
-            stream.writeBooleanArray(val);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 4)
-                return false;
-
-            stream.writeInt(-1);
-
-            return true;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean writeMessage(String name, @Nullable GridTcpCommunicationMessageAdapter msg) {
-        if (msg != null) {
-            stream.writeMessage(msg);
-
-            return stream.lastFinished();
-        }
-        else {
-            if (stream.remaining() < 1)
-                return false;
-
-            stream.writeByte(Byte.MIN_VALUE);
-
-            return true;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
index 4e817a3..c9ec0e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobMasterLeaveAwareSelfTest.java
@@ -23,11 +23,11 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
@@ -732,7 +732,7 @@ public class GridJobMasterLeaveAwareSelfTest extends GridCommonAbstractTest {
         private CountDownLatch waitLatch = new CountDownLatch(1);
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             sendMessage0(node, msg);
         }
@@ -745,7 +745,7 @@ public class GridJobMasterLeaveAwareSelfTest extends GridCommonAbstractTest {
          * @param msg Message to be sent.
          * @throws org.apache.ignite.spi.IgniteSpiException If failed.
          */
-        private void sendMessage0(ClusterNode node, GridTcpCommunicationMessageAdapter msg) throws IgniteSpiException {
+        private void sendMessage0(ClusterNode node, MessageAdapter msg) throws IgniteSpiException {
             if (msg instanceof GridIoMessage) {
                 GridIoMessage msg0 = (GridIoMessage)msg;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridCommunicationSendMessageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridCommunicationSendMessageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridCommunicationSendMessageSelfTest.java
index 13762fb..ce1d765 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridCommunicationSendMessageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridCommunicationSendMessageSelfTest.java
@@ -19,7 +19,8 @@ package org.apache.ignite.internal.managers.communication;
 
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -50,7 +51,7 @@ public class GridCommunicationSendMessageSelfTest extends GridCommonAbstractTest
 
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
-            @Override public GridTcpCommunicationMessageAdapter create(byte type) {
+            @Override public MessageAdapter create(byte type) {
                 return new TestMessage();
             }
         }, DIRECT_TYPE);
@@ -141,15 +142,15 @@ public class GridCommunicationSendMessageSelfTest extends GridCommonAbstractTest
     }
 
     /** */
-    private static class TestMessage extends GridTcpCommunicationMessageAdapter {
+    private static class TestMessage extends MessageAdapter {
         /** {@inheritDoc} */
         @SuppressWarnings("CloneDoesntCallSuperClone")
-        @Override public GridTcpCommunicationMessageAdapter clone() {
+        @Override public MessageAdapter clone() {
             throw new UnsupportedOperationException();
         }
 
         /** {@inheritDoc} */
-        @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+        @Override protected void clone0(MessageAdapter _msg) {
             // No-op.
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
index cf89a1f..d125375 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/communication/GridIoManagerSelfTest.java
@@ -22,9 +22,9 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.discovery.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -183,7 +183,7 @@ public class GridIoManagerSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public void send(ClusterNode node, GridTopic topic, GridTcpCommunicationMessageAdapter msg,
+        @Override public void send(ClusterNode node, GridTopic topic, MessageAdapter msg,
             GridIoPolicy plc) throws IgniteCheckedException {
             // No-op.
         }
@@ -218,15 +218,15 @@ public class GridIoManagerSelfTest extends GridCommonAbstractTest {
     }
 
     /** */
-    private static class Message extends GridTcpCommunicationMessageAdapter implements Serializable {
+    private static class Message extends MessageAdapter implements Serializable {
         /** {@inheritDoc} */
         @SuppressWarnings("CloneDoesntCallSuperClone")
-        @Override public GridTcpCommunicationMessageAdapter clone() {
+        @Override public MessageAdapter clone() {
             throw new UnsupportedOperationException();
         }
 
         /** {@inheritDoc} */
-        @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+        @Override protected void clone0(MessageAdapter _msg) {
             // No-op.
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentMessageCountSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentMessageCountSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentMessageCountSelfTest.java
index 7be98ab..acd6bf3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentMessageCountSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentMessageCountSelfTest.java
@@ -22,7 +22,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -168,7 +168,7 @@ public class GridDeploymentMessageCountSelfTest extends GridCommonAbstractTest {
         private AtomicInteger msgCnt = new AtomicInteger();
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             if (isDeploymentMessage((GridIoMessage)msg))
                 msgCnt.incrementAndGet();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
index 0b23669..a13982a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java
@@ -22,7 +22,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -191,7 +191,7 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest
         private Map<Class<?>, AtomicInteger> cntMap = new HashMap<>();
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             AtomicInteger cntr = cntMap.get(((GridIoMessage)msg).message().getClass());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
index d37eab5..85ba6ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
@@ -24,7 +24,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -185,7 +185,7 @@ public class GridCacheReplicatedSynchronousCommitTest extends GridCommonAbstract
         }
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             Object obj = ((GridIoMessage)msg).message();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxReentryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxReentryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxReentryAbstractSelfTest.java
index 254cf5a..2442c8b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxReentryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxReentryAbstractSelfTest.java
@@ -24,7 +24,7 @@ import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.distributed.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -134,7 +134,7 @@ public abstract class IgniteTxReentryAbstractSelfTest extends GridCommonAbstract
         private AtomicInteger dhtLocks = new AtomicInteger();
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             countMsg((GridIoMessage)msg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java
index 6d62a84..55d1068 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAtomicTimeoutSelfTest.java
@@ -26,10 +26,10 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.testframework.*;
@@ -274,7 +274,7 @@ public class GridCacheAtomicTimeoutSelfTest extends GridCommonAbstractTest {
         private boolean skipDhtResponse;
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             if (!skipMessage((GridIoMessage)msg))
                 super.sendMessage(node, msg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
index 7c860e1..f693179 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxOriginatingNodeFailureAbstractSelfTest.java
@@ -25,10 +25,10 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
@@ -239,7 +239,7 @@ public abstract class IgniteTxOriginatingNodeFailureAbstractSelfTest extends Gri
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.setCommunicationSpi(new TcpCommunicationSpi() {
-            @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+            @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
                 throws IgniteSpiException {
                 if (!F.eq(ignoreMsgNodeId, node.id()) || !ignoredMessage((GridIoMessage)msg))
                     super.sendMessage(node, msg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
index e4bda25..9568789 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest.java
@@ -26,10 +26,10 @@ import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
@@ -418,7 +418,7 @@ public abstract class IgniteTxPessimisticOriginatingNodeFailureAbstractSelfTest
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.setCommunicationSpi(new TcpCommunicationSpi() {
-            @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+            @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
                 throws IgniteSpiException {
                 if (getSpiContext().localNode().id().equals(failingNodeId)) {
                     if (ignoredMessage((GridIoMessage)msg) && ignoreMsgNodeIds != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
index 5398701..e621847 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadMessageCountTest.java
@@ -24,8 +24,8 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -141,7 +141,7 @@ public class GridCacheDhtPreloadMessageCountTest extends GridCommonAbstractTest
         private Collection<GridDhtPartitionsSingleMessage> sentMsgs = new ConcurrentLinkedQueue<>();
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             recordMessage((GridIoMessage)msg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 1e83921..9fc882e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -24,8 +24,8 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -296,7 +296,7 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
      */
     private static class DelayCommunicationSpi extends TcpCommunicationSpi {
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode node, MessageAdapter msg)
             throws IgniteSpiException {
             try {
                 if (delayMessage((GridIoMessage)msg))

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
index cfd1b87..5d8545f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
@@ -24,7 +24,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.clock.*;
 import org.apache.ignite.internal.transactions.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -224,7 +224,7 @@ public class GridCacheReplicatedInvalidateSelfTest extends GridCommonAbstractTes
         }
 
         /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode destNode, GridTcpCommunicationMessageAdapter msg)
+        @Override public void sendMessage(ClusterNode destNode, MessageAdapter msg)
             throws IgniteSpiException {
             Object msg0 = ((GridIoMessage)msg).message();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
index 78b1aca..94b8a87 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridIoManagerBenchmark0.java
@@ -22,10 +22,10 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.*;
@@ -123,7 +123,7 @@ public class GridIoManagerBenchmark0 extends GridCommonAbstractTest {
             new GridMessageListener() {
                 @Override public void onMessage(UUID nodeId, Object msg) {
                     try {
-                        rcv.send(sndNode, topic, (GridTcpCommunicationMessageAdapter)msg, PUBLIC_POOL);
+                        rcv.send(sndNode, topic, (MessageAdapter)msg, PUBLIC_POOL);
                     }
                     catch (IgniteCheckedException e) {
                         error("Failed to send message.", e);
@@ -217,7 +217,7 @@ public class GridIoManagerBenchmark0 extends GridCommonAbstractTest {
             new GridMessageListener() {
                 @Override public void onMessage(UUID nodeId, Object msg) {
                     try {
-                        rcv.send(sndNode, topic, (GridTcpCommunicationMessageAdapter)msg, PUBLIC_POOL);
+                        rcv.send(sndNode, topic, (MessageAdapter)msg, PUBLIC_POOL);
                     }
                     catch (IgniteCheckedException e) {
                         error("Failed to send message.", e);
@@ -317,7 +317,7 @@ public class GridIoManagerBenchmark0 extends GridCommonAbstractTest {
             new GridMessageListener() {
                 @Override public void onMessage(UUID nodeId, Object msg) {
                     try {
-                        rcv.send(sndNode, topic, (GridTcpCommunicationMessageAdapter)msg, PUBLIC_POOL);
+                        rcv.send(sndNode, topic, (MessageAdapter)msg, PUBLIC_POOL);
                     }
                     catch (IgniteCheckedException e) {
                         error("Failed to send message.", e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridTestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridTestMessage.java b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridTestMessage.java
index 0392643..1c63e60 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridTestMessage.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/communication/GridTestMessage.java
@@ -17,9 +17,9 @@
 
 package org.apache.ignite.loadtests.communication;
 
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 
 import java.io.*;
 import java.nio.*;
@@ -27,7 +27,7 @@ import java.nio.*;
 /**
  *
  */
-class GridTestMessage extends GridTcpCommunicationMessageAdapter implements Externalizable {
+class GridTestMessage extends MessageAdapter implements Externalizable {
     /** */
     private IgniteUuid id;
 
@@ -109,12 +109,12 @@ class GridTestMessage extends GridTcpCommunicationMessageAdapter implements Exte
 
     /** {@inheritDoc} */
     @SuppressWarnings("CloneDoesntCallSuperClone")
-    @Override public GridTcpCommunicationMessageAdapter clone() {
+    @Override public MessageAdapter clone() {
         throw new UnsupportedOperationException();
     }
 
     /** {@inheritDoc} */
-    @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+    @Override protected void clone0(MessageAdapter _msg) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
index 1eb9f47..1aabf89 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridAbstractCommunicationSelfTest.java
@@ -19,10 +19,11 @@ package org.apache.ignite.spi.communication;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
 import org.apache.ignite.testframework.junits.spi.*;
@@ -49,7 +50,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
     private static final Map<UUID, Set<UUID>> msgDestMap = new HashMap<>();
 
     /** */
-    protected static final Map<UUID, CommunicationSpi<GridTcpCommunicationMessageAdapter>> spis = new HashMap<>();
+    protected static final Map<UUID, CommunicationSpi<MessageAdapter>> spis = new HashMap<>();
 
     /** */
     protected static final Collection<ClusterNode> nodes = new ArrayList<>();
@@ -62,7 +63,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
      */
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
-            @Override public GridTcpCommunicationMessageAdapter create(byte type) {
+            @Override public MessageAdapter create(byte type) {
                 return new GridTestMessage();
             }
         }, GridTestMessage.DIRECT_TYPE);
@@ -70,7 +71,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
 
     /** */
     @SuppressWarnings({"deprecation"})
-    private class MessageListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private class MessageListener implements CommunicationListener<MessageAdapter> {
         /** */
         private final UUID locNodeId;
 
@@ -84,7 +85,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
         }
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             info("Received message [locNodeId=" + locNodeId + ", nodeId=" + nodeId +
                 ", msg=" + msg + ']');
 
@@ -138,7 +139,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
 
         msgDestMap.clear();
 
-        for (Entry<UUID, CommunicationSpi<GridTcpCommunicationMessageAdapter>> entry : spis.entrySet()) {
+        for (Entry<UUID, CommunicationSpi<MessageAdapter>> entry : spis.entrySet()) {
             for (ClusterNode node : nodes) {
                 synchronized (mux) {
                     if (!msgDestMap.containsKey(entry.getKey()))
@@ -180,10 +181,10 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
         msgDestMap.clear();
 
         // Send message from each SPI to all SPI's, including itself.
-        for (Entry<UUID, CommunicationSpi<GridTcpCommunicationMessageAdapter>> entry : spis.entrySet()) {
+        for (Entry<UUID, CommunicationSpi<MessageAdapter>> entry : spis.entrySet()) {
             UUID sndId = entry.getKey();
 
-            CommunicationSpi<GridTcpCommunicationMessageAdapter> commSpi = entry.getValue();
+            CommunicationSpi<MessageAdapter> commSpi = entry.getValue();
 
             for (ClusterNode node : nodes) {
                 synchronized (mux) {
@@ -222,7 +223,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
      * @param idx Node index.
      * @return Spi.
      */
-    protected abstract CommunicationSpi<GridTcpCommunicationMessageAdapter> getSpi(int idx);
+    protected abstract CommunicationSpi<MessageAdapter> getSpi(int idx);
 
     /**
      * @return Spi count.
@@ -277,7 +278,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
         Map<ClusterNode, GridSpiTestContext> ctxs = new HashMap<>();
 
         for (int i = 0; i < getSpiCount(); i++) {
-            CommunicationSpi<GridTcpCommunicationMessageAdapter> spi = getSpi(i);
+            CommunicationSpi<MessageAdapter> spi = getSpi(i);
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
@@ -324,7 +325,7 @@ public abstract class GridAbstractCommunicationSelfTest<T extends CommunicationS
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis.values()) {
+        for (CommunicationSpi<MessageAdapter> spi : spis.values()) {
             spi.onContextDestroyed();
 
             spi.setListener(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
index f36fa58..e1244a0 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/GridTestMessage.java
@@ -17,8 +17,8 @@
 
 package org.apache.ignite.spi.communication;
 
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 
 import java.nio.*;
 import java.util.*;
@@ -26,7 +26,7 @@ import java.util.*;
 /**
  * Test message for communication SPI tests.
  */
-public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
+public class GridTestMessage extends MessageAdapter {
     /** */
     public static final byte DIRECT_TYPE = (byte)200;
 
@@ -95,7 +95,7 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
 
     /** {@inheritDoc} */
     @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"})
-    @Override public GridTcpCommunicationMessageAdapter clone() {
+    @Override public MessageAdapter clone() {
         GridTestMessage msg = new GridTestMessage();
 
         clone0(msg);
@@ -104,7 +104,7 @@ public class GridTestMessage extends GridTcpCommunicationMessageAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
+    @Override protected void clone0(MessageAdapter _msg) {
         GridTestMessage _clone = (GridTestMessage)_msg;
 
         _clone.srcNodeId = srcNodeId;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java
index f0ee2fe..27c98c9 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridCacheDhtLockBackupSelfTest.java
@@ -22,11 +22,11 @@ import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.marshaller.*;
 import org.apache.ignite.marshaller.jdk.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -259,7 +259,7 @@ public class GridCacheDhtLockBackupSelfTest extends GridCommonAbstractTest {
          * @param obj Message being  sent.
          * @param srcNodeId Sender node id.
          */
-        private void checkAwaitMessageType(GridTcpCommunicationMessageAdapter obj, UUID srcNodeId) {
+        private void checkAwaitMessageType(MessageAdapter obj, UUID srcNodeId) {
             try {
                 GridIoMessage plainMsg = (GridIoMessage)obj;
 
@@ -277,7 +277,7 @@ public class GridCacheDhtLockBackupSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override protected void notifyListener(UUID sndId, GridTcpCommunicationMessageAdapter msg,
+        @Override protected void notifyListener(UUID sndId, MessageAdapter msg,
             IgniteRunnable msgC) {
             checkAwaitMessageType(msg, sndId);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
index 4892db0..39bfe37 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiConcurrentConnectSelfTest.java
@@ -20,11 +20,12 @@ package org.apache.ignite.spi.communication.tcp;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -52,7 +53,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
     private static final Collection<IgniteTestResources> spiRsrcs = new ArrayList<>();
 
     /** */
-    protected static final List<CommunicationSpi<GridTcpCommunicationMessageAdapter>> spis = new ArrayList<>();
+    protected static final List<CommunicationSpi<MessageAdapter>> spis = new ArrayList<>();
 
     /** */
     protected static final List<ClusterNode> nodes = new ArrayList<>();
@@ -66,7 +67,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
             @Override
-            public GridTcpCommunicationMessageAdapter create(byte type) {
+            public MessageAdapter create(byte type) {
                 return new GridTestMessage();
             }
         }, GridTestMessage.DIRECT_TYPE);
@@ -82,7 +83,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
     /**
      *
      */
-    private static class MessageListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private static class MessageListener implements CommunicationListener<MessageAdapter> {
         /** */
         private final CountDownLatch latch;
 
@@ -100,7 +101,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
         }
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             msgC.run();
 
             assertTrue(msg instanceof GridTestMessage);
@@ -229,7 +230,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
 
                             Thread.currentThread().setName("Test thread [idx=" + idx0 + ", grid=" + (idx0 % 2) + ']');
 
-                            CommunicationSpi<GridTcpCommunicationMessageAdapter> spi = spis.get(idx0 % 2);
+                            CommunicationSpi<MessageAdapter> spi = spis.get(idx0 % 2);
 
                             ClusterNode srcNode = nodes.get(idx0 % 2);
 
@@ -315,7 +316,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
         Map<ClusterNode, GridSpiTestContext> ctxs = new HashMap<>();
 
         for (int i = 0; i < SPI_CNT; i++) {
-            CommunicationSpi<GridTcpCommunicationMessageAdapter> spi = createSpi();
+            CommunicationSpi<MessageAdapter> spi = createSpi();
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
@@ -392,7 +393,7 @@ public class GridTcpCommunicationSpiConcurrentConnectSelfTest<T extends Communic
      * @throws Exception If failed.
      */
     private void stopSpis() throws Exception {
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis) {
+        for (CommunicationSpi<MessageAdapter> spi : spis) {
             spi.onContextDestroyed();
 
             spi.setListener(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
index 0e974b0..1c68264 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiLanTest.java
@@ -20,9 +20,9 @@ package org.apache.ignite.spi.communication.tcp;
 import mx4j.tools.adaptor.http.*;
 import org.apache.ignite.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.config.*;
@@ -79,7 +79,7 @@ public class GridTcpCommunicationSpiLanTest extends GridSpiAbstractTest<TcpCommu
      * Accumulating listener.
      */
     @SuppressWarnings({"deprecation"})
-    private class MessageListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private class MessageListener implements CommunicationListener<MessageAdapter> {
         /** Node id of local node. */
         private final UUID locNodeId;
 
@@ -100,7 +100,7 @@ public class GridTcpCommunicationSpiLanTest extends GridSpiAbstractTest<TcpCommu
         }
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             msgC.run();
 
             if (msg instanceof GridTestMessage) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
index c4c3ece..5ae3d2b 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiMultithreadedSelfTest.java
@@ -20,12 +20,13 @@ package org.apache.ignite.spi.communication.tcp;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -60,7 +61,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
     private static final Collection<IgniteTestResources> spiRsrcs = new ArrayList<>();
 
     /** SPIs */
-    private static final Map<UUID, CommunicationSpi<GridTcpCommunicationMessageAdapter>> spis =
+    private static final Map<UUID, CommunicationSpi<MessageAdapter>> spis =
         new ConcurrentHashMap<>();
 
     /** Listeners. */
@@ -74,7 +75,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
 
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
-            @Override public GridTcpCommunicationMessageAdapter create(byte type) {
+            @Override public MessageAdapter create(byte type) {
                 return new GridTestMessage();
             }
         }, GridTestMessage.DIRECT_TYPE);
@@ -93,7 +94,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
      * Accumulating listener.
      */
     @SuppressWarnings({"deprecation"})
-    private static class MessageListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private static class MessageListener implements CommunicationListener<MessageAdapter> {
         /** Node id of local node. */
         private final UUID locNodeId;
 
@@ -113,7 +114,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
         }
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             msgC.run();
 
             if (msg instanceof GridTestMessage) {
@@ -283,7 +284,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
 
                         try {
                             for (ClusterNode node : nodes) {
-                                GridTcpCommunicationMessageAdapter msg =
+                                MessageAdapter msg =
                                     new GridTestMessage(from.id(), msgId.getAndIncrement(), 0);
 
                                 spis.get(from.id()).sendMessage(node, msg);
@@ -331,7 +332,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
         fut2.get();
 
         // Wait when all messages are acknowledged to do not break next tests' logic.
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis.values()) {
+        for (CommunicationSpi<MessageAdapter> spi : spis.values()) {
             GridNioServer srv = U.field(spi, "nioSrvr");
 
             Collection<? extends GridNioSession> sessions = GridTestUtils.getFieldValue(srv, "sessions");
@@ -376,7 +377,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
 
                     ClusterNode to = nodes.get(1);
 
-                    CommunicationSpi<GridTcpCommunicationMessageAdapter> spi = spis.get(from.id());
+                    CommunicationSpi<MessageAdapter> spi = spis.get(from.id());
 
                     while (cntr.getAndIncrement() < msgCnt) {
                         GridTestMessage msg = new GridTestMessage(from.id(), msgId.getAndIncrement(), 0);
@@ -414,7 +415,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
     /**
      * @return Spi.
      */
-    private CommunicationSpi<GridTcpCommunicationMessageAdapter> newCommunicationSpi() {
+    private CommunicationSpi<MessageAdapter> newCommunicationSpi() {
         TcpCommunicationSpi spi = new TcpCommunicationSpi();
 
         if (!useShmem)
@@ -445,7 +446,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
         Map<ClusterNode, GridSpiTestContext> ctxs = new HashMap<>();
 
         for (int i = 0; i < getSpiCount(); i++) {
-            CommunicationSpi<GridTcpCommunicationMessageAdapter> spi = newCommunicationSpi();
+            CommunicationSpi<MessageAdapter> spi = newCommunicationSpi();
 
             GridTestUtils.setFieldValue(spi, "gridName", "grid-" + i);
 
@@ -520,7 +521,7 @@ public abstract class GridTcpCommunicationSpiMultithreadedSelfTest extends GridS
 
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis.values()) {
+        for (CommunicationSpi<MessageAdapter> spi : spis.values()) {
             spi.onContextDestroyed();
 
             spi.setListener(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
index 641805d..78e1b81 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoveryAckSelfTest.java
@@ -19,11 +19,12 @@ package org.apache.ignite.spi.communication.tcp;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.*;
@@ -57,7 +58,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
             @Override
-            public GridTcpCommunicationMessageAdapter create(byte type) {
+            public MessageAdapter create(byte type) {
                 return new GridTestMessage();
             }
         }, GridTestMessage.DIRECT_TYPE);
@@ -72,7 +73,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
 
     /** */
     @SuppressWarnings({"deprecation"})
-    private class TestListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private class TestListener implements CommunicationListener<MessageAdapter> {
         /** */
         private ConcurrentHashSet<Long> msgIds = new ConcurrentHashSet<>();
 
@@ -80,7 +81,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
         private AtomicInteger rcvCnt = new AtomicInteger();
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             info("Test listener received message: " + msg);
 
             assertTrue("Unexpected message: " + msg, msg instanceof GridTestMessage);
@@ -416,7 +417,7 @@ public class GridTcpCommunicationSpiRecoveryAckSelfTest<T extends CommunicationS
      * @throws Exception If failed.
      */
     private void stopSpis() throws Exception {
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis) {
+        for (CommunicationSpi<MessageAdapter> spi : spis) {
             spi.onContextDestroyed();
 
             spi.setListener(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
index cdd6ef6..c2c1676 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/GridTcpCommunicationSpiRecoverySelfTest.java
@@ -20,11 +20,12 @@ package org.apache.ignite.spi.communication.tcp;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.direct.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.*;
 import org.apache.ignite.testframework.*;
@@ -65,7 +66,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
      */
     static {
         GridTcpCommunicationMessageFactory.registerCustom(new GridTcpCommunicationMessageProducer() {
-            @Override public GridTcpCommunicationMessageAdapter create(byte type) {
+            @Override public MessageAdapter create(byte type) {
                 return new GridTestMessage();
             }
         }, GridTestMessage.DIRECT_TYPE);
@@ -80,7 +81,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
 
     /** */
     @SuppressWarnings({"deprecation"})
-    private class TestListener implements CommunicationListener<GridTcpCommunicationMessageAdapter> {
+    private class TestListener implements CommunicationListener<MessageAdapter> {
         /** */
         private boolean block;
 
@@ -94,7 +95,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
         private AtomicInteger rcvCnt = new AtomicInteger();
 
         /** {@inheritDoc} */
-        @Override public void onMessage(UUID nodeId, GridTcpCommunicationMessageAdapter msg, IgniteRunnable msgC) {
+        @Override public void onMessage(UUID nodeId, MessageAdapter msg, IgniteRunnable msgC) {
             // info("Test listener received message: " + msg);
 
             assertTrue("Unexpected message: " + msg, msg instanceof GridTestMessage);
@@ -703,7 +704,7 @@ public class GridTcpCommunicationSpiRecoverySelfTest<T extends CommunicationSpi>
      * @throws Exception If failed.
      */
     private void stopSpis() throws Exception {
-        for (CommunicationSpi<GridTcpCommunicationMessageAdapter> spi : spis) {
+        for (CommunicationSpi<MessageAdapter> spi : spis) {
             spi.onContextDestroyed();
 
             spi.setListener(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
index 137adf2..48d9e2d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
@@ -21,15 +21,15 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.direct.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.managers.eventstorage.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.plugin.security.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.swapspace.*;
-import org.gridgain.grid.util.direct.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
@@ -519,10 +519,10 @@ public class GridSpiTestContext implements IgniteSpiContext {
     /** {@inheritDoc} */
     @Override public GridTcpMessageFactory messageFactory() {
         return new GridTcpMessageFactory() {
-            @Override public GridTcpCommunicationMessageAdapter create(byte type) {
-                GridTcpCommunicationMessageAdapter msg = GridTcpCommunicationMessageFactory.create(type);
+            @Override public MessageAdapter create(byte type) {
+                MessageAdapter msg = GridTcpCommunicationMessageFactory.create(type);
 
-                msg.setReader(new GridTcpCommunicationMessageReader(null));
+                msg.setReader(new DirectMessageReader(null));
 
                 return msg;
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/415902ea/modules/indexing/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java
index a2b7ddf..e9bc33e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/spi/communication/tcp/GridOrderedMessageCancelSelfTest.java
@@ -24,9 +24,9 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.cache.query.*;
-import org.apache.ignite.internal.util.direct.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -165,7 +165,7 @@ public class GridOrderedMessageCancelSelfTest extends GridCommonAbstractTest {
      */
     private static class CommunicationSpi extends TcpCommunicationSpi {
         /** {@inheritDoc} */
-        @Override protected void notifyListener(UUID sndId, GridTcpCommunicationMessageAdapter msg,
+        @Override protected void notifyListener(UUID sndId, MessageAdapter msg,
             IgniteRunnable msgC) {
             try {
                 GridIoMessage ioMsg = (GridIoMessage)msg;


Mime
View raw message