WEB开发网
开发学院软件开发Java CXF使用JMS作为传输协议的配置 阅读

CXF使用JMS作为传输协议的配置

 2009-09-22 00:00:00 来源:WEB开发网   
核心提示: 服务端App:publicclassServerApp{publicstaticvoidmain(String[]args){ClassPathXmlApplicationContextapplicationContext=newClassPathXmlApplicationContext(&q

服务端App:

public class ServerApp {
    
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
        "server-applicationContext.xml");
    }
    
}

客户端App:

public class ClientApp {
    /**
     * @param args
     */
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                "client-applicationContext.xml");
        CustomerService hello = (CustomerService) applicationContext
        .getBean("CustomerService");
        System.out.println(hello.getOrder(null).getName());
    }
}

Broker:

public final class EmbeddedBroker {
    private EmbeddedBroker() {
    }
    public static void main(String[] args) throws Exception {
        BrokerService broker = new BrokerService();
        broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
        broker.addConnector("tcp://localhost:61616");
        broker.start();
        System.out.println("JMS broker ready ");
        Thread.sleep(125 * 60 * 1000);
        System.out.println("JMS broker exiting");
        broker.stop();
        System.exit(0);
    }
}

上一页  1 2 3 

Tags:CXF 使用 JMS

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接