[infinispan-commits] Infinispan SVN: r1812 - trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Tue May 18 12:15:09 EDT 2010
Author: mircea.markus
Date: 2010-05-18 12:15:08 -0400 (Tue, 18 May 2010)
New Revision: 1812
Added:
trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotRodClientDecoder.java
Removed:
trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotrodClientDecoder.java
Log:
renamed on server
Copied: trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotRodClientDecoder.java (from rev 1811, trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotrodClientDecoder.java)
===================================================================
--- trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotRodClientDecoder.java (rev 0)
+++ trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotRodClientDecoder.java 2010-05-18 16:15:08 UTC (rev 1812)
@@ -0,0 +1,64 @@
+package org.infinispan.client.hotrod.impl.transport.netty;
+
+import org.infinispan.client.hotrod.exceptions.TransportException;
+import org.infinispan.client.hotrod.impl.transport.VHelper;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.handler.codec.frame.FrameDecoder;
+
+/**
+ * @author Mircea.Markus at jboss.com
+ * @since 4.1
+ */
+public class HotrodClientDecoder extends FrameDecoder {
+
+ private final ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
+ private final InputStreamAdapter isa = new InputStreamAdapter(buffer);
+
+ @Override
+ protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
+ synchronized (this.buffer) {
+ this.buffer.writeBytes(buffer);
+ if (this.buffer.readableBytes() > 0) {
+ this.buffer.notify();
+ }
+ }
+ return null;
+ }
+
+ public long readVLong() {
+ return VHelper.readVLong(isa);
+ }
+
+ public int readVInt() {
+ return VHelper.readVInt(isa);
+ }
+
+ public void fillBuffer(byte[] bufferToFill) {
+ synchronized (buffer) {
+ if (buffer.readableBytes() < bufferToFill.length) {
+ try {
+ buffer.wait();
+ } catch (InterruptedException e) {
+ throw new TransportException(e);
+ }
+ }
+ buffer.readBytes(bufferToFill);
+ }
+ }
+
+ public short readByte() {
+ synchronized (buffer) {
+ if (!buffer.readable()) {
+ try {
+ buffer.wait();
+ } catch (InterruptedException e) {
+ throw new TransportException(e);
+ }
+ }
+ return buffer.readUnsignedByte();
+ }
+ }
+}
Deleted: trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotrodClientDecoder.java
===================================================================
--- trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotrodClientDecoder.java 2010-05-18 16:09:58 UTC (rev 1811)
+++ trunk/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/netty/HotrodClientDecoder.java 2010-05-18 16:15:08 UTC (rev 1812)
@@ -1,64 +0,0 @@
-package org.infinispan.client.hotrod.impl.transport.netty;
-
-import org.infinispan.client.hotrod.exceptions.TransportException;
-import org.infinispan.client.hotrod.impl.transport.VHelper;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBuffers;
-import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.handler.codec.frame.FrameDecoder;
-
-/**
- * @author Mircea.Markus at jboss.com
- * @since 4.1
- */
-public class HotrodClientDecoder extends FrameDecoder {
-
- private final ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
- private final InputStreamAdapter isa = new InputStreamAdapter(buffer);
-
- @Override
- protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
- synchronized (this.buffer) {
- this.buffer.writeBytes(buffer);
- if (this.buffer.readableBytes() > 0) {
- this.buffer.notify();
- }
- }
- return null;
- }
-
- public long readVLong() {
- return VHelper.readVLong(isa);
- }
-
- public int readVInt() {
- return VHelper.readVInt(isa);
- }
-
- public void fillBuffer(byte[] bufferToFill) {
- synchronized (buffer) {
- if (buffer.readableBytes() < bufferToFill.length) {
- try {
- buffer.wait();
- } catch (InterruptedException e) {
- throw new TransportException(e);
- }
- }
- buffer.readBytes(bufferToFill);
- }
- }
-
- public short readByte() {
- synchronized (buffer) {
- if (!buffer.readable()) {
- try {
- buffer.wait();
- } catch (InterruptedException e) {
- throw new TransportException(e);
- }
- }
- return buffer.readUnsignedByte();
- }
- }
-}
More information about the infinispan-commits
mailing list