Package common.books

Examples of common.books.Book


    }

    public void useWebClient() {
      System.out.println("Using WebClient to get the book with id 123");
      WebClient client = WebClient.create("http://localhost:" + port + "/services/bookstore/");
      Book book = client.post(new Book("HTTP"), Book.class);
      System.out.println(book.getId() + ":" + book.getName());
    }
View Full Code Here


      System.out.println("Getting the book with id 123 over JMS");
     
      getBookOverJMS();
     
      System.out.println("Adding a new book over JMS");
      addGetBookOverJMS(new Book("JMS Transport"));

      System.out.println("Adding a new book over JMS Oneway");
      addGetOnewayBookOverJMS();
     
      System.out.println("Adding a new book over HTTP Oneway, "
View Full Code Here

    }
   
    private void addOnewayOverHttpGetOverJMS() throws Exception {
       
      WebClient client = WebClient.create("http://localhost:" + port + "/services/bookstore");
      Response response = client.put(new Book("FROM HTTP TO JMS", 126L));
      if (response.getStatus() != 202) {
        new RuntimeException("This is a oneway request");
      }
     
      Context ctx = getContext();
View Full Code Here

    private void postOneWayBook(Session session, Destination destination)
      throws Exception {
      MessageProducer producer = session.createProducer(destination);
     
      Message message = JMSUtils.createAndSetPayload(
          writeBook(new Book("JMS OneWay", 125L)), session, "text");
      message.setStringProperty("org.apache.cxf.request.method", "PUT");
                 
      producer.send(message);
      producer.close();
  }
View Full Code Here

        JMSUtils.retrieveAndSetPayload(cxfMessage, jmsMessage, null);
        Reader reader = cxfMessage.getContent(Reader.class);
        if (reader == null) {
          reader = new InputStreamReader(cxfMessage.getContent(InputStream.class), "UTF-8");
        }
        Book b = readBook(reader);
        System.out.println(b.getId() + ":" + b.getName());
    }
View Full Code Here

    private ProtocolHeaders context;
   
    private Map<Long, Book> books = new HashMap<Long, Book>();

    public JMSHttpBookStore() {
        books.put(123L, new Book("JMS and HTTP Transport in CXF JAX-RS", 123L));
    }
View Full Code Here

TOP

Related Classes of common.books.Book

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.