1 package org.bsf.smartValueObject.demo; 2 3 import org.bsf.commons.ejb.SessionAdapterBean; 4 5 import javax.ejb.CreateException ; 6 import javax.naming.InitialContext ; 7 import javax.naming.NamingException ; 8 9 32 public class SVODemoServiceBean extends SessionAdapterBean { 33 SVODemoUserHome userHome = null; 34 35 38 public SVODemoUser createUserService(){ 39 try { 40 logInfo("SVODemo : new user connected."); 41 42 return userHome.create(); 43 } catch (Exception e) { 44 handleExceptionAsSystemException(e); 45 return null; 46 } 47 } 48 49 54 public void ejbCreate() throws CreateException { 55 56 try { 58 InitialContext ic = new InitialContext (); 59 userHome = (SVODemoUserHome) 60 ic.lookup("java:comp/env/ejb/SVODemoUser"); 61 } catch( NamingException e ) { 62 handleExceptionAsSystemException( e ); 63 } 64 } 65 } 66 | Popular Tags |