CXF使用JMS作为传输协议的配置
2009-09-22 00:00:00 来源:WEB开发网服务端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);
}
}
更多精彩
赞助商链接