queuetest.java
来自「《精通Spring》源代码」· Java 代码 · 共 39 行
JAVA
39 行
/*
* Created on 2004-11-6
*
* http://www.open-v.com 提供代码的维护工作
*/
package com.openv.spring;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.jms.JMSException;
import javax.jms.Queue;
/**
* QueueTest客户应用
*
* @author luoshifei
*/
public class QueueTest {
protected static final Log log = LogFactory.getLog(QueueTest.class);
public static void main(String[] args) {
ApplicationContext ac = new ClassPathXmlApplicationContext(
"appcontext.xml");
Queue queue = (Queue) ac.getBean("queueFactory");
try {
log.info("消息队列名称:" + queue.getQueueName());
} catch (JMSException ex) {
log.error("消息异常", ex);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?