Package org.jboss.tutorial.cachedentity.bean

Examples of org.jboss.tutorial.cachedentity.bean.Customer


      System.out.println("Saving customer to node1 = " + args[0]);
      InitialContext ctx1 = new InitialContext(prop1);

      EntityTest tester1 = (EntityTest)ctx1.lookup("EntityTestBean/remote");
      Customer customer = tester1.createCustomer();
      customer = tester1.findByCustomerId(customer.getId());

      System.out.println("Looking for customer on node2 = " + args[1] + " (should be available in cache)");
      InitialContext ctx2 = new InitialContext(prop2);

      EntityTest tester2 = (EntityTest)ctx2.lookup("EntityTestBean/remote");

      Set<Contact> contacts = customer.getContacts();

      customer = tester2.findByCustomerId(customer.getId());
      if (customer == null)
      {
         throw new RuntimeException("Customer was not found in node2 = " + args[1]);
      }
      System.out.println("Found customer on node2 (cache). Customer details follow:");
      System.out.println("Customer: id=" + customer.getId() + "; name=" + customer.getName());

      for (Contact contact : contacts)
      {
        System.out.println("\tContact: id=" + contact.getId() + "; name=" + contact.getName());
    }
View Full Code Here

TOP

Related Classes of org.jboss.tutorial.cachedentity.bean.Customer

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.