1 22 package org.jboss.test.threading.ejb; 23 24 import java.rmi.*; 25 import javax.ejb.*; 26 27 38 public class EJBThreadsBean implements EntityBean 39 { 40 org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(getClass()); 41 42 44 public String id; 46 48 50 52 53 public String ejbCreate(String id) 54 throws RemoteException, CreateException { 55 log.debug("create"+Thread.currentThread()+" id: "+id); 56 this.id = id; 57 58 return id; 59 } 60 61 public void ejbPostCreate(String id) {} 62 public void ejbRemove() throws RemoveException {log.debug("remove"+Thread.currentThread());} 63 public void ejbActivate() throws RemoteException {} 64 public void ejbPassivate() throws RemoteException {} 65 public void ejbLoad() throws RemoteException {} 66 public void ejbStore() throws RemoteException {} 67 68 public void setEntityContext(EntityContext context) throws RemoteException {} 69 public void unsetEntityContext() throws RemoteException{} 70 71 public void test() { 72 73 log.debug("test"+Thread.currentThread()); 74 75 } 76 77 public void testBusinessException() 78 throws RemoteException 79 { 80 log.debug("testBusinessExcetiopn"+Thread.currentThread()); 81 throw new RemoteException("TestBusinessException"); 82 }; 83 84 public void testRuntimeException() 85 throws RemoteException 86 { 87 log.debug("testRuntimeException"+Thread.currentThread()); 88 throw new NullPointerException (); 89 } 90 public void testTimeOut() 91 throws RemoteException 92 { 93 log.debug("testTimeout"+Thread.currentThread()); 94 synchronized (this) 95 { 96 try { 97 wait(5000); 98 } 99 catch (InterruptedException e) { 100 101 } 102 } 103 } 104 public void testNonTransactional() throws RemoteException 105 { 106 log.debug("testNonTransactional"+Thread.currentThread()); 107 } 108 } 109 | Popular Tags |