1 22 package org.objectweb.petals.jbi.routing.mock; 23 24 import org.objectweb.petals.jbi.messaging.MessageExchangeImpl; 25 import org.objectweb.petals.jbi.transport.TransportException; 26 import org.objectweb.petals.jbi.transport.Transporter; 27 28 33 public class MockTransporter implements Transporter { 34 35 public void stop() throws Exception { 36 38 } 39 40 private boolean send; 41 42 protected boolean throwsException; 43 44 public void send(MessageExchangeImpl exchange, String containerName, 45 long timeOut) throws TransportException { 46 if (throwsException) { 47 throw new TransportException("error"); 48 } 49 send = true; 50 } 51 52 public boolean isSend() { 53 return send; 54 } 55 56 public void setSend(boolean send) { 57 this.send = send; 58 } 59 60 public boolean isThrowsException() { 61 return throwsException; 62 } 63 64 public void setThrowsException(boolean throwsException) { 65 this.throwsException = throwsException; 66 } 67 68 public void startListening() throws TransportException { 69 } 70 71 public void shutdown() throws Exception { 72 } 73 74 } 75 | Popular Tags |