当前位置: 首页>>代码示例>>Java>>正文


Java MessageNotReadableException类代码示例

本文整理汇总了Java中org.springframework.jms.MessageNotReadableException的典型用法代码示例。如果您正苦于以下问题:Java MessageNotReadableException类的具体用法?Java MessageNotReadableException怎么用?Java MessageNotReadableException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageNotReadableException类属于org.springframework.jms包,在下文中一共展示了MessageNotReadableException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertMessageNotReadableException

import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
@Test
public void convertMessageNotReadableException() throws JMSException {
	willThrow(MessageNotReadableException.class).given(jmsTemplate).receive("myQueue");

	thrown.expect(MessagingException.class);
	messagingTemplate.receive("myQueue");
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:JmsMessagingTemplateTests.java

示例2: convertJmsAccessException

import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
/**
 * Convert the specified checked {@link javax.jms.JMSException JMSException} to a
 * Spring runtime {@link org.springframework.jms.JmsException JmsException} equivalent.
 * @param ex the original checked JMSException to convert
 * @return the Spring runtime JmsException wrapping the given exception
 */
public static JmsException convertJmsAccessException(JMSException ex) {
	Assert.notNull(ex, "JMSException must not be null");

	if (ex instanceof javax.jms.IllegalStateException) {
		return new org.springframework.jms.IllegalStateException((javax.jms.IllegalStateException) ex);
	}
	if (ex instanceof javax.jms.InvalidClientIDException) {
		return new InvalidClientIDException((javax.jms.InvalidClientIDException) ex);
	}
	if (ex instanceof javax.jms.InvalidDestinationException) {
		return new InvalidDestinationException((javax.jms.InvalidDestinationException) ex);
	}
	if (ex instanceof javax.jms.InvalidSelectorException) {
		return new InvalidSelectorException((javax.jms.InvalidSelectorException) ex);
	}
	if (ex instanceof javax.jms.JMSSecurityException) {
		return new JmsSecurityException((javax.jms.JMSSecurityException) ex);
	}
	if (ex instanceof javax.jms.MessageEOFException) {
		return new MessageEOFException((javax.jms.MessageEOFException) ex);
	}
	if (ex instanceof javax.jms.MessageFormatException) {
		return new MessageFormatException((javax.jms.MessageFormatException) ex);
	}
	if (ex instanceof javax.jms.MessageNotReadableException) {
		return new MessageNotReadableException((javax.jms.MessageNotReadableException) ex);
	}
	if (ex instanceof javax.jms.MessageNotWriteableException) {
		return new MessageNotWriteableException((javax.jms.MessageNotWriteableException) ex);
	}
	if (ex instanceof javax.jms.ResourceAllocationException) {
		return new ResourceAllocationException((javax.jms.ResourceAllocationException) ex);
	}
	if (ex instanceof javax.jms.TransactionInProgressException) {
		return new TransactionInProgressException((javax.jms.TransactionInProgressException) ex);
	}
	if (ex instanceof javax.jms.TransactionRolledBackException) {
		return new TransactionRolledBackException((javax.jms.TransactionRolledBackException) ex);
	}

	// fallback
	return new UncategorizedJmsException(ex);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:50,代码来源:JmsUtils.java

示例3: testMessageNotReadableException

import org.springframework.jms.MessageNotReadableException; //导入依赖的package包/类
@Test
public void testMessageNotReadableException() throws Exception {
	doTestJmsException(new javax.jms.MessageNotReadableException(""), MessageNotReadableException.class);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:JmsTemplateTests.java


注:本文中的org.springframework.jms.MessageNotReadableException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。