[jboss-cvs] JBoss Messaging SVN: r3448 - in branches/Branch_JBMESSAGING-544: src/main/org/jboss/messaging/core/remoting/codec and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 7 10:05:27 EST 2007
Author: jmesnil
Date: 2007-12-07 10:05:26 -0500 (Fri, 07 Dec 2007)
New Revision: 3448
Removed:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Constants.java
Modified:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/codec/AbstractPacketCodec.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/wireformat/AbstractPacket.java
branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/core/remoting/ReversePacketHandler.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-544 Replace client-server transport with NIO based transport
* code clean up
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java 2007-12-07 14:24:09 UTC (rev 3447)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java 2007-12-07 15:05:26 UTC (rev 3448)
@@ -48,6 +48,8 @@
public Client(NIOConnector connector)
{
+ assert connector != null;
+
this.connector = connector;
}
Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Constants.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Constants.java 2007-12-07 14:24:09 UTC (rev 3447)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Constants.java 2007-12-07 15:05:26 UTC (rev 3448)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.messaging.core.remoting;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>.
- *
- * @version <tt>$Revision$</tt>
- */
-public class Constants
-{
- // Constants -----------------------------------------------------
-
- public static final int CONNECTION_TIMEOUT = 20 * 1000;
-
- public static final byte NO_VERSION_SET = (byte)-1;
-
- public static final long NO_CORRELATION_ID = -1L;
-
- public static final String NO_ID_SET = "NO_ID_SET";
-
- public static final String PACKET_TYPE_HEADER = "PACKET_TYPE";
-
- public static final String TARGET_ID_HEADER = "TARGET_ID";
-
- public static final String CALLBACK_ID_HEADER = "CALLBACK_ID";
-
- public static final String CORRELATION_ID_HEADER = "CORRELATION_ID";
-
- public static final String PACKET_HTTP_PARAMETER = "packet";
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/codec/AbstractPacketCodec.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/codec/AbstractPacketCodec.java 2007-12-07 14:24:09 UTC (rev 3447)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/codec/AbstractPacketCodec.java 2007-12-07 15:05:26 UTC (rev 3448)
@@ -8,6 +8,7 @@
import static org.jboss.jms.destination.JBossDestination.readDestination;
import static org.jboss.jms.destination.JBossDestination.writeDestination;
+import static org.jboss.messaging.core.remoting.wireformat.AbstractPacket.NO_VERSION_SET;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -19,7 +20,6 @@
import org.jboss.logging.Logger;
import org.jboss.messaging.core.contract.Message;
import org.jboss.messaging.core.impl.message.MessageFactory;
-import org.jboss.messaging.core.remoting.Constants;
import org.jboss.messaging.core.remoting.wireformat.AbstractPacket;
import org.jboss.messaging.core.remoting.wireformat.PacketType;
@@ -42,10 +42,6 @@
private PacketType type;
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
protected AbstractPacketCodec(PacketType type)
{
assert type != null;
@@ -62,7 +58,7 @@
assert buf != null;
byte version = packet.getVersion();
- if (version == Constants.NO_VERSION_SET)
+ if (version == NO_VERSION_SET)
{
throw new IllegalStateException("packet must be versioned: " + packet);
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/wireformat/AbstractPacket.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/wireformat/AbstractPacket.java 2007-12-07 14:24:09 UTC (rev 3447)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/wireformat/AbstractPacket.java 2007-12-07 15:05:26 UTC (rev 3448)
@@ -7,9 +7,6 @@
package org.jboss.messaging.core.remoting.wireformat;
import static org.jboss.messaging.core.remoting.Assert.assertValidID;
-import static org.jboss.messaging.core.remoting.Constants.NO_CORRELATION_ID;
-import static org.jboss.messaging.core.remoting.Constants.NO_ID_SET;
-import static org.jboss.messaging.core.remoting.Constants.NO_VERSION_SET;
/**
* @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>.
@@ -20,6 +17,12 @@
{
// Constants -----------------------------------------------------
+ public static final String NO_ID_SET = "NO_ID_SET";
+
+ public static final long NO_CORRELATION_ID = -1L;
+
+ public static final byte NO_VERSION_SET = (byte)-1;
+
// Attributes ----------------------------------------------------
private byte version = NO_VERSION_SET;
Modified: branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/core/remoting/ReversePacketHandler.java
===================================================================
--- branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/core/remoting/ReversePacketHandler.java 2007-12-07 14:24:09 UTC (rev 3447)
+++ branches/Branch_JBMESSAGING-544/tests/src/org/jboss/test/messaging/core/remoting/ReversePacketHandler.java 2007-12-07 15:05:26 UTC (rev 3448)
@@ -8,8 +8,7 @@
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static junit.framework.Assert.fail;
-import static org.jboss.messaging.core.remoting.Constants.NO_CORRELATION_ID;
-import static org.jboss.messaging.core.remoting.Constants.NO_ID_SET;
+import static org.jboss.messaging.core.remoting.wireformat.AbstractPacket.NO_ID_SET;
import static org.jboss.test.messaging.core.remoting.TestSupport.reverse;
import java.util.concurrent.TimeUnit;
@@ -73,12 +72,11 @@
}
}
- TextPacket request = (TextPacket) packet;
- if (!NO_ID_SET.equals(request.getCallbackID())
- || request.getCorrelationID() != NO_CORRELATION_ID)
+ TextPacket message = (TextPacket) packet;
+ if (message.isRequest() || message.getCallbackID() != NO_ID_SET)
{
- TextPacket response = new TextPacket(reverse(request.getText()));
- response.normalize(request);
+ TextPacket response = new TextPacket(reverse(message.getText()));
+ response.normalize(message);
sender.send(response);
}
}
More information about the jboss-cvs-commits
mailing list