EJB Clients EJB Clients
Unit – III Middleware Technologies g
Roy Antony Arnold G Lecturer P i l E i i C ll Panimalar Engineering College Chennai, Tamilnadu, India
Topics Topics
EJB Bean as a Client to Another Bean EJB Bean as a Client to Another Bean Serializing a Handle Transactions in Clients Transactions in Clients Authentication in Clients G tti M t D t Getting Meta Data Servlet Client Applet Client CORBA Client
An EJB Bean as a Client to Another Bean
- EJB Client Bean
import ….; public class ClientBean implements SessionBean { SessionContext ctx; { SessionContext ctx; public void ejbCreate() { } public void run() { try { Properties p = new Properties(); p put(Context INITIAL CONTEXT FACTORY “weblogic jndi TengahInitialContextFactory”); p.put(Context.INITIAL_CONTEXT_FACTORY, weblogic.jndi.TengahInitialContextFactory ); InitialContext ic = new InitialContext(p); OrderHome oh = (OrderHome) ic.lookup(“OrderHome”); Order o1 = oh.create(1, “1”, 1); Order o2 = oh create(1 “2” 1); Order o2 oh.create(1, 2 , 1);
- 1.remove();
- 2.remove();
catch(NamingException e) { } catch (CreateExeception e) {} catch(RemoveException e) {} catch (RemoteException e) {} catch(RemoveException e) {} catch (RemoteException e) {} } public void setSessionContext (SessionContext ctx) { this.ctx = ctx; } public void ejbRemove() {} public void ejbActivate() {} public void ejbPassivate{} }
Environment Properties Environment Properties
To define an environment property two To define an environment property, two
- ptions available