1 22 package org.jboss.test.jbossmq.support; 23 24 import javax.jms.JMSException ; 25 26 import org.jboss.mq.ConnectionToken; 27 import org.jboss.mq.SpyMessage; 28 import org.jboss.mq.server.JMSServerInterceptorSupport; 29 30 36 public class MockServerFailureInterceptor extends JMSServerInterceptorSupport 37 { 38 public boolean raiseReceiveError = false; 39 40 public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait) throws JMSException  41 { 42 if (raiseReceiveError) 43 throw new JMSException ("Error in receive as required."); 44 return super.receive(dc, subscriberId, wait); 45 } 46 } 47 | Popular Tags |