类javax.jms.InvalidDestinationRuntimeException源码实例Demo

下面列出了怎么用javax.jms.InvalidDestinationRuntimeException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: activemq-artemis   文件: JmsContextTest.java
@Test
public void testInvalidDestination() {
   JMSProducer producer = context.createProducer();
   Message msg = context.createMessage();
   try {
      producer.send((Destination) null, msg);
      Assert.fail("null Destination");
   } catch (InvalidDestinationRuntimeException expected) {
      // no-op
   }
}
 
源代码2 项目: activemq-artemis   文件: JmsExceptionUtils.java
/**
 * Converts instances of sub-classes of {@link JMSException} into the corresponding sub-class of
 * {@link JMSRuntimeException}.
 *
 * @param e
 * @return
 */
public static JMSRuntimeException convertToRuntimeException(JMSException e) {
   if (e instanceof javax.jms.IllegalStateException) {
      return new IllegalStateRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof InvalidClientIDException) {
      return new InvalidClientIDRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof InvalidDestinationException) {
      return new InvalidDestinationRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof InvalidSelectorException) {
      return new InvalidSelectorRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof JMSSecurityException) {
      return new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof MessageFormatException) {
      return new MessageFormatRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof MessageNotWriteableException) {
      return new MessageNotWriteableRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof ResourceAllocationException) {
      return new ResourceAllocationRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof TransactionInProgressException) {
      return new TransactionInProgressRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   if (e instanceof TransactionRolledBackException) {
      return new TransactionRolledBackRuntimeException(e.getMessage(), e.getErrorCode(), e);
   }
   return new JMSRuntimeException(e.getMessage(), e.getErrorCode(), e);
}
 
源代码3 项目: tomee   文件: JMS2.java
public static JMSRuntimeException toRuntimeException(final JMSException e) {
    if (e instanceof javax.jms.IllegalStateException) {
        return new IllegalStateRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof InvalidClientIDException) {
        return new InvalidClientIDRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof InvalidDestinationException) {
        return new InvalidDestinationRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof InvalidSelectorException) {
        return new InvalidSelectorRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof JMSSecurityException) {
        return new JMSSecurityRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof MessageFormatException) {
        return new MessageFormatRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof MessageNotWriteableException) {
        return new MessageNotWriteableRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof ResourceAllocationException) {
        return new ResourceAllocationRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof TransactionInProgressException) {
        return new TransactionInProgressRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    if (e instanceof TransactionRolledBackException) {
        return new TransactionRolledBackRuntimeException(e.getMessage(), e.getErrorCode(), e);
    }
    return new JMSRuntimeException(e.getMessage(), e.getErrorCode(), e);
}
 
源代码4 项目: pooled-jms   文件: JMSExceptionSupportTest.java
@Test(expected = InvalidDestinationRuntimeException.class)
public void testConvertsInvalidDestinationExceptionToInvalidDestinationRuntimeException() {
    throw JMSExceptionSupport.createRuntimeException(new InvalidDestinationException("error"));
}
 
源代码5 项目: qpid-jms   文件: JmsExceptionSupportTest.java
@Test(expected = InvalidDestinationRuntimeException.class)
public void testConvertsInvalidDestinationExceptionToInvalidDestinationRuntimeException() {
    throw JmsExceptionSupport.createRuntimeException(new InvalidDestinationException("error"));
}
 
 类所在包
 类方法
 同包方法