1 22 package org.objectweb.petals.jbi.routing.mock; 23 24 import javax.jbi.JBIException; 25 26 import org.objectweb.petals.jbi.component.context.ComponentContextImpl; 27 import org.objectweb.petals.jbi.messaging.DeliveryChannelImpl; 28 import org.objectweb.petals.jbi.messaging.MessageExchangeImpl; 29 import org.objectweb.petals.jbi.routing.Router; 30 import org.objectweb.util.monolog.api.Logger; 31 32 37 public class MockDeliveryChannelImpl extends DeliveryChannelImpl { 38 39 public MockDeliveryChannelImpl(ComponentContextImpl context, Router router, 40 Logger logger) { 41 super(context, router, logger); 42 } 43 44 private boolean push; 45 46 protected boolean throwException; 47 48 public void push(MessageExchangeImpl msg) throws JBIException { 49 if (throwException) { 50 throw new JBIException("error"); 51 } 52 push = true; 53 } 54 55 public boolean isPush() { 56 return push; 57 } 58 59 public void setPush(boolean push) { 60 this.push = push; 61 } 62 63 public boolean isThrowException() { 64 return throwException; 65 } 66 67 public void setThrowException(boolean throwException) { 68 this.throwException = throwException; 69 } 70 71 } 72 | Popular Tags |