1 18 package org.apache.activemq.transport; 19 20 import java.io.IOException ; 21 import org.apache.activemq.command.ShutdownInfo; 22 23 24 25 28 public class MutexTransport extends TransportFilter { 29 30 private final Object writeMutex = new Object (); 31 32 public MutexTransport(Transport next) { 33 super(next); 34 } 35 36 public FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException { 37 synchronized(writeMutex) { 38 return next.asyncRequest(command, null); 39 } 40 } 41 42 public void oneway(Object command) throws IOException { 43 synchronized(writeMutex){ 44 next.oneway(command); 45 } 46 } 47 48 public Object request(Object command) throws IOException { 49 synchronized(writeMutex) { 50 return next.request(command); 51 } 52 } 53 54 public Object request(Object command,int timeout) throws IOException { 55 synchronized(writeMutex){ 56 return next.request(command,timeout); 57 } 58 } 59 60 public String toString() { 61 return next.toString(); 62 } 63 64 } 65 | Popular Tags |