You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/09/18 02:54:20 UTC

svn commit: r576639 - /geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java

Author: jdillon
Date: Mon Sep 17 17:54:20 2007
New Revision: 576639

URL: http://svn.apache.org/viewvc?rev=576639&view=rev
Log:
Minor clean up

Modified:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java?rev=576639&r1=576638&r2=576639&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java Mon Sep 17 17:54:20 2007
@@ -63,14 +63,14 @@
         return ReflectionToStringBuilder.toString(this);
     }
 
-    public UUID getId() {
-        return id;
-    }
-    
     public MessageType getType() throws IOException {
         return type;
     }
 
+    public UUID getId() {
+        return id;
+    }
+    
     public UUID getCorrelationId() {
         return correlationId;
     }
@@ -121,35 +121,6 @@
     // MarshalAware
     //
 
-    private void writeUuid(final ByteBuffer buff, final UUID uuid) throws Exception {
-        assert buff != null;
-
-        if (uuid == null) {
-            buff.put((byte)0);
-        }
-        else {
-            buff.put((byte)1);
-
-            buff.putLong(uuid.getMostSignificantBits());
-            buff.putLong(uuid.getLeastSignificantBits());
-        }
-    }
-
-    private UUID readUuid(final ByteBuffer buff) throws Exception {
-        assert buff != null;
-
-        byte isnull = buff.get();
-
-        if (isnull == 1) { // not null
-            long msb = buff.getLong();
-            long lsb = buff.getLong();
-            return new UUID(msb, lsb);
-        }
-        else {
-            return null;
-        }
-    }
-
     public void readExternal(final ByteBuffer buff) throws Exception {
         assert buff != null;
 
@@ -196,6 +167,35 @@
         out.putInt(len);
         
         out.putString(str, len, UTF_8_CHARSET.newEncoder());
+    }
+
+    private void writeUuid(final ByteBuffer out, final UUID uuid) throws Exception {
+        assert out != null;
+
+        if (uuid == null) {
+            out.put((byte)0);
+        }
+        else {
+            out.put((byte)1);
+
+            out.putLong(uuid.getMostSignificantBits());
+            out.putLong(uuid.getLeastSignificantBits());
+        }
+    }
+
+    private UUID readUuid(final ByteBuffer in) throws Exception {
+        assert in != null;
+
+        byte isnull = in.get();
+
+        if (isnull == 1) { // not null
+            long msb = in.getLong();
+            long lsb = in.getLong();
+            return new UUID(msb, lsb);
+        }
+        else {
+            return null;
+        }
     }
 
     //