Apidays New York 2024 - The value of a flexible API Management solution for O...
Enterprise java beans(ejb) Update 2
1. Enterprise Java Beans(EJB) With EJBs, you can develop building blocks ‘ejb components ’ – that u and someone else can assemble and reassemble into different applications. For example , you might create a customer bean that represents a customer in database. You can use that Customer bean in an accouting program, an e-commerce shopping cart and a tech support application. One beauty of EJBs is that you take code reuse to a whole new level, instead of just code it reuses whole functionality and allows you modify that way bean behaves at runtime with touching its java code. 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14. Put the Bean, the interface and the DD into ejb-jar file META-INF EJB-JAR.XML MYPACKAGE AdvcieBean.class AdviceHome.class Advice.class MYEJB.JAR ejb-jar.xml must be in a directory named META-INF 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
15. Deploy the bean into the server,using the tools provided by the server vendor 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
19. EJB uses RMI 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
20. How EJB uses RMI 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
21.
22.
23.
24.
25. How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
26. How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
27. How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49. Container callbacks invocation 06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Does not Exist Method ready Passivated setSessionContext() ejbCreate() ejbPassivate() ejbActivate() ejbRemove() or timeout Bean throw system exception timeout
50.
51.
52.
53. Use sessioncontext for 06/25/10 JavaTruths.com:A Portal for all java related stuff!!! setSessionContext() ejbCreate() Within business method Use your SessionContext for: Get a reference to your home Get a reference to home Get a reference to home Get a reference to your EJB Object Get a reference to your EJB Object Get security info about the client Get security info about the client Get a transaction reference and call methods on it(BMT Beans) For a transaction to rollback(CMT beans) Find out if the transaction has already been set to rollback(CMT beans) Get a transaction reference and call methods on it (BMT beans) Access : Your special JNDI Environment Your special JNDI Env. Your special JNDI Env. Another beans methods Another beans methods A resource manager(like a DB) A resource manager(like a DB)
60. Entity Bean Remote Home Interface 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
61.
62.
63.
64.
65.
66.
67.
68.
69.
70. CMP entity Bean is abstract? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Match every create with ejbCreate() and ejbPostCreate() Match every home method with and ejbHome<Mname> The finder methods are part of the bean class, but we won’t actually define them in our bean in case of CMP.