[jboss-cvs] JBossAS SVN: r105444 - projects/cluster/ha-server-core/trunk/src/main/java/org/jboss/ha/core/jgroups/blocks/mux.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 31 22:59:26 EDT 2010
Author: bstansberry at jboss.com
Date: 2010-05-31 22:59:25 -0400 (Mon, 31 May 2010)
New Revision: 105444
Added:
projects/cluster/ha-server-core/trunk/src/main/java/org/jboss/ha/core/jgroups/blocks/mux/MuxRequestCorrelator.java
Log:
Work around missing method override in std JG class
Added: projects/cluster/ha-server-core/trunk/src/main/java/org/jboss/ha/core/jgroups/blocks/mux/MuxRequestCorrelator.java
===================================================================
--- projects/cluster/ha-server-core/trunk/src/main/java/org/jboss/ha/core/jgroups/blocks/mux/MuxRequestCorrelator.java (rev 0)
+++ projects/cluster/ha-server-core/trunk/src/main/java/org/jboss/ha/core/jgroups/blocks/mux/MuxRequestCorrelator.java 2010-06-01 02:59:25 UTC (rev 105444)
@@ -0,0 +1,50 @@
+package org.jboss.ha.core.jgroups.blocks.mux;
+
+import java.util.Collection;
+
+import org.jgroups.Address;
+import org.jgroups.Message;
+import org.jgroups.blocks.RequestCorrelator;
+import org.jgroups.blocks.RequestHandler;
+import org.jgroups.blocks.RspCollector;
+import org.jgroups.blocks.RequestOptions;
+import org.jgroups.blocks.mux.MuxHeader;
+import org.jgroups.conf.ClassConfigurator;
+
+/**
+ * A request correlator that adds a mux header to incoming and outgoing messages.
+ * @author Bela Ban
+ * @author Paul Ferraro
+ * @version $Id: MuxRequestCorrelator.java,v 1.3 2010/04/21 10:54:07 belaban Exp $
+ */
+public class MuxRequestCorrelator extends RequestCorrelator {
+
+ protected final static short MUX_ID = ClassConfigurator.getProtocolId(org.jgroups.blocks.mux.MuxRequestCorrelator.class);
+ private final org.jgroups.Header header;
+
+ public MuxRequestCorrelator(short id, Object transport, RequestHandler handler, Address localAddr) {
+ super(ClassConfigurator.getProtocolId(RequestCorrelator.class), transport, handler, localAddr);
+ this.header = new MuxHeader(id);
+ }
+
+ @Override
+ public void sendUnicastRequest(long id, Address target, Message msg, RspCollector coll) throws Exception
+ {
+ msg.putHeader(MUX_ID, header);
+ super.sendUnicastRequest(id, target, msg, coll);
+ }
+
+
+
+ @Override
+ public void sendRequest(long requestId, Collection<Address> dest_mbrs, Message msg, RspCollector coll, RequestOptions options) throws Exception {
+ msg.putHeader(MUX_ID, header);
+ super.sendRequest(requestId, dest_mbrs, msg, coll, options);
+ }
+
+ @Override
+ protected void prepareResponse(Message rsp) {
+ rsp.putHeader(MUX_ID, header);
+ super.prepareResponse(rsp);
+ }
+}
More information about the jboss-cvs-commits
mailing list