1 22 package org.jboss.ejb3.test.regression.scopedclassloader; 23 24 import javax.naming.InitialContext ; 25 import javax.ejb.Stateless ; 26 27 33 @Stateless 34 public class ClientBean implements ClientRemote 35 { 36 public void doit() throws Exception 37 { 38 StatelessRemote remote = (StatelessRemote)new InitialContext ().lookup("scopedclassloader-ejb/StatelessBean/remote"); 39 ValueObject vo = remote.doit(); 40 System.out.println(vo.getValue()); 41 Customer cust = new Customer(); 42 cust.setName("Bill"); 43 int id = remote.createCustomer(cust); 44 cust = remote.findCustomer(id); 45 if (!cust.getName().equals("Bill")) throw new RuntimeException ("Failed to persist"); 46 47 try 48 { 49 remote.throwException(); 50 } 51 catch (ScopedException ignored) {} 52 53 } 54 55 } 56 | Popular Tags |