[jboss-cvs] JBoss Messaging SVN: r3172 - in trunk/src/main/org/jboss/jms: server/endpoint/advised and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 4 14:28:56 EDT 2007
Author: timfox
Date: 2007-10-04 14:28:56 -0400 (Thu, 04 Oct 2007)
New Revision: 3172
Modified:
trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
trunk/src/main/org/jboss/jms/server/endpoint/advised/SessionAdvised.java
trunk/src/main/org/jboss/jms/wireformat/SessionSendRequest.java
Log:
Speed up oneway
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-10-04 17:56:25 UTC (rev 3171)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-10-04 18:28:56 UTC (rev 3172)
@@ -448,7 +448,7 @@
RequestSupport req = new SessionSendRequest(id, version, m, checkForDuplicates, seq);
- if (seq != -1)
+ if (seq == -1)
{
doInvoke(client, req);
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/advised/SessionAdvised.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/advised/SessionAdvised.java 2007-10-04 17:56:25 UTC (rev 3171)
+++ trunk/src/main/org/jboss/jms/server/endpoint/advised/SessionAdvised.java 2007-10-04 18:28:56 UTC (rev 3172)
@@ -34,6 +34,7 @@
import org.jboss.jms.destination.JBossQueue;
import org.jboss.jms.destination.JBossTopic;
import org.jboss.jms.message.JBossMessage;
+import org.jboss.jms.server.endpoint.ServerSessionEndpoint;
/**
* The server-side advised instance corresponding to a Session. It is bound to the AOP
@@ -80,6 +81,11 @@
endpoint.send(msg, checkForDuplicates);
}
+ public void send(JBossMessage msg, boolean checkForDuplicates, long seq) throws JMSException
+ {
+ ((ServerSessionEndpoint)endpoint).send(msg, checkForDuplicates, seq);
+ }
+
public ConsumerDelegate createConsumerDelegate(JBossDestination destination, String selector,
boolean noLocal, String subscriptionName,
boolean connectionConsumer, boolean autoFlowControl) throws JMSException
Modified: trunk/src/main/org/jboss/jms/wireformat/SessionSendRequest.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/SessionSendRequest.java 2007-10-04 17:56:25 UTC (rev 3171)
+++ trunk/src/main/org/jboss/jms/wireformat/SessionSendRequest.java 2007-10-04 18:28:56 UTC (rev 3172)
@@ -25,10 +25,12 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
-import org.jboss.jms.delegate.SessionEndpoint;
import org.jboss.jms.message.JBossMessage;
-import org.jboss.jms.server.endpoint.ServerSessionEndpoint;
+import org.jboss.jms.server.ServerPeer;
+import org.jboss.jms.server.endpoint.advised.SessionAdvised;
import org.jboss.messaging.core.impl.message.MessageFactory;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.invocation.OnewayInvocation;
/**
*
@@ -80,15 +82,15 @@
public ResponseSupport serverInvoke() throws Exception
{
- SessionEndpoint endpoint =
- (SessionEndpoint)Dispatcher.instance.getTarget(objectId);
+ SessionAdvised advised =
+ (SessionAdvised)Dispatcher.instance.getTarget(objectId);
- if (endpoint == null)
+ if (advised == null)
{
throw new IllegalStateException("Cannot find object in dispatcher with id " + objectId);
}
- ((ServerSessionEndpoint)endpoint).send(msg, checkForDuplicates, sequence);
+ advised.send(msg, checkForDuplicates, sequence);
return null;
}
@@ -107,6 +109,24 @@
os.flush();
}
+
+ public Object getPayload()
+ {
+ if (sequence != -1)
+ {
+ OnewayInvocation oi = new OnewayInvocation(this);
+
+ InvocationRequest request =
+ new InvocationRequest(null, ServerPeer.REMOTING_JMS_SUBSYSTEM,
+ oi, ONE_WAY_METADATA, null, null);
+
+ return request;
+ }
+ else
+ {
+ return super.getPayload();
+ }
+ }
}
More information about the jboss-cvs-commits
mailing list