public class BookStoreClientMain {
public static void main (String[] args) throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("client.xml");
BookStoreClient client = new BookStoreClient();
BookStore bookStoreJmsClient = context.getBean("bookStoreJmsClient", BookStore.class);
client.useBookStore(bookStoreJmsClient);
final int defaultHttpPort = 9002;
String systemHttpPort = System.getProperty("http.port");
int httpPort = systemHttpPort == null ? 9002 : Integer.valueOf(systemHttpPort);
String address = "http://localhost:" + httpPort + "/bookstore";
System.out.println("Invoking HTTP service at " + address);
BookStore bookStoreHttp =
JAXRSClientFactory.create(address, BookStore.class);
client.useBookStore(bookStoreHttp);
context.close();
// TODO Implement with HTTP over Camel transport using direct component