SlideShare a Scribd company logo
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!!!
Enterprise Java Beans: What really EJBs gives you ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How does it all works? ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Type of Beans ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Session Bean can be stateless or stateful  ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
FIVE THING YOU DO TO BUILD A BEAN ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Write the Bean Class ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
AdviceGuy Bean ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
BEAN CLASS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],You need this package These four methos are from SessionBean interface, so you have to put them here,for now worry about what these are for! You must have an ejbCreate() method. Its an ejb rule we’ll learn about later. But it doesn’t come from SessionBean interface. You must implemet one of three bean type interfaces: 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Write two interfaces for the Bean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],It must extend either the EJBObject or EJBLocalObject. This is the actual business method. It MUST  correspond to a method in the bean class. 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Write two interfaces for the Bean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],It must extend either the EJBObject or EJBLocalObject. This is the actual business method. It MUST  correspond to a method in the bean class. 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Home Interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],The create() method must return your component interface type!! The home must extend either the EJBHome interface or EJBLocalHome  06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Create an XML DD  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Specify home interface name Remote interface 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
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!!!
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!!!
How to call a bean from Client Side? ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
The Client Code(AdviceClient.java) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Finally we get to the actual business methods. Lookup the AdviseBean using the JNDI name we gave during deployment. Initialcontext is our entrypoint into JNDI directory 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
EJB ARCHITECTURE 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
EJB uses RMI 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How EJB uses RMI 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
EJB uses RMI ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
*** ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
*** ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Tricky Questions  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How EJB really Works? 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
The Bean Home ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Architectural Overview: Session Beans ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Architectural Overview: Entity Bean ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Architectural Overview: Session Beans ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Stateless session beans are more scalable ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Tricky Questions ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
JNDI ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Rules for the home interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
EJBHome interface ,[object Object],[object Object],[object Object],[object Object],[object Object],Get reflection like information about the bean. You can use to get more specific class information about the bean. 06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Serialize the home so that you can get the home again later, without having to go through JNDI.
EJBHome interface ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! When u are done with session bean,you can tell the home by calling remove() and passing the EJB object’s handle. Tell the home to remove an entity bean. You can’t call remove(Object primarykey) method on session bean it will throw RemoveException.
Rules for the component interface ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
EJBObject methods ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Get the primary key of an entity bean This doesn’t apply to session bean and throws RemoteException.
EJBObject methods ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Get the bean’s home object. Save a reference to the EJBObject so that you can get back to your original EJB object. Tell the bean you are done with it. Container removes the resources held by the session bean. Compare the EJB object references to see if they reference the same bean.
The Handle ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
isIdentical? ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Session Bean life cycle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Container Callbacks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
ejbCreate method? ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
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
Bean’s Context ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! get EJBHome() getEJBLocalHome() getEJBObject() getEJBLocalObject() getCallerPrincipal() isCallerInRole(String s) setRollbackOnly(bollean b ) getRollbackOnly() getUserTransaction()
How to use setSessionContext(Sessioncontext sc) ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How to use ejbCreate()? ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
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)
Removing a stateful bean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity Beans ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! The entity bean’s state includes the fields that map to columns in the customer database table. Plain old java getters and setters for persistent fields.the result of these setters will ultimately lead to database update .
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!! Three container callbacks from EntityBean, that were also in SessionBean.but they have completely diff meaning here… These are three new container callbacks from the EntityBean interface.
Entity Bean Remote Component interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Remote Component Interface 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity Bean Remote Home Interface 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity Bean Remote Home interface ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity bean create() and remove() ,[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity bean synchronization ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Entity bean synchronization ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Who does the work of synchronization? ,[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Container Managed Persistence ,[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
Bean managed Persistence ,[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
How actual bean is accessed? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
ejbPassivate()? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
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.
What to put in a bean class? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
06/25/10 JavaTruths.com:A Portal for all java related stuff!!!

More Related Content

What's hot

Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
ihamo
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
Skillwise Group
 
Spring
SpringSpring
Spring
s4al_com
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
s4al_com
 
Jsp
JspJsp
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
Brian Cavalier
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
ealio
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
Armen Arzumanyan
 
Jsp
JspJsp
EJB Part-1
EJB Part-1EJB Part-1
EJB Part-1
Som Prakash Rai
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
Peter R. Egli
 
Spring IOC and DAO
Spring IOC and DAOSpring IOC and DAO
Spring IOC and DAO
AnushaNaidu
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
Virtual Nuggets
 
Yii - Next level PHP Framework von Florian Facker
Yii - Next level PHP Framework von Florian FackerYii - Next level PHP Framework von Florian Facker
Yii - Next level PHP Framework von Florian Facker
Mayflower GmbH
 
EJB 2
EJB 2EJB 2
Core java introduction
Core java introduction Core java introduction
Core java introduction
Som Prakash Rai
 
Os Leonard
Os LeonardOs Leonard
Os Leonard
oscon2007
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 

What's hot (18)

Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
 
Spring
SpringSpring
Spring
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
 
Jsp
JspJsp
Jsp
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Spring talk111204
Spring talk111204Spring talk111204
Spring talk111204
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 
Jsp
JspJsp
Jsp
 
EJB Part-1
EJB Part-1EJB Part-1
EJB Part-1
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
Spring IOC and DAO
Spring IOC and DAOSpring IOC and DAO
Spring IOC and DAO
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
 
Yii - Next level PHP Framework von Florian Facker
Yii - Next level PHP Framework von Florian FackerYii - Next level PHP Framework von Florian Facker
Yii - Next level PHP Framework von Florian Facker
 
EJB 2
EJB 2EJB 2
EJB 2
 
Core java introduction
Core java introduction Core java introduction
Core java introduction
 
Os Leonard
Os LeonardOs Leonard
Os Leonard
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 

Similar to Enterprise java beans(ejb) Update 2

Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
vikram singh
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
Bill Lyons
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
achraf_ing
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
odedns
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
University of Catania
 
Spring training
Spring trainingSpring training
Spring training
TechFerry
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
Alassane Diallo
 
Jsf tutorial
Jsf tutorialJsf tutorial
Jsf tutorial
Edress Oryakhail
 
Spring boot
Spring bootSpring boot
Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16
Zainab Khallouf
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
nsandonato
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
phanleson
 
Ejb intro
Ejb introEjb intro
Ejb intro
vantinhkhuc
 
Abstract #236765 advanced essbase java api tips and tricks
Abstract #236765 advanced essbase java api tips and tricksAbstract #236765 advanced essbase java api tips and tricks
Abstract #236765 advanced essbase java api tips and tricks
timtow
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
gicappa
 
Ejb notes
Ejb notesEjb notes
Ejb notes
Mumbai Academisc
 
Ejb intro
Ejb introEjb intro
Ejb intro
MANOJ KUMAR
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
Montreal JUG
 

Similar to Enterprise java beans(ejb) Update 2 (20)

Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Ejb - september 2006
Ejb  - september 2006Ejb  - september 2006
Ejb - september 2006
 
JEE Course - EJB
JEE Course - EJBJEE Course - EJB
JEE Course - EJB
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
 
Spring training
Spring trainingSpring training
Spring training
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
 
Jsf tutorial
Jsf tutorialJsf tutorial
Jsf tutorial
 
Spring boot
Spring bootSpring boot
Spring boot
 
Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16Lec5 ecom fall16_modified7_november16
Lec5 ecom fall16_modified7_november16
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Abstract #236765 advanced essbase java api tips and tricks
Abstract #236765 advanced essbase java api tips and tricksAbstract #236765 advanced essbase java api tips and tricks
Abstract #236765 advanced essbase java api tips and tricks
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Ejb notes
Ejb notesEjb notes
Ejb notes
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
 

More from vikram singh

Agile
AgileAgile
Web tech importants
Web tech importantsWeb tech importants
Web tech importants
vikram singh
 
2 4 Tree
2 4 Tree2 4 Tree
2 4 Tree
vikram singh
 
23 Tree Best Part
23 Tree   Best Part23 Tree   Best Part
23 Tree Best Part
vikram singh
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
vikram singh
 
Bean Intro
Bean IntroBean Intro
Bean Intro
vikram singh
 
jdbc
jdbcjdbc
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
vikram singh
 
Xml
XmlXml
Dtd
DtdDtd
Xml Schema
Xml SchemaXml Schema
Xml Schema
vikram singh
 
JSP
JSPJSP
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servlet
vikram singh
 
Servlet Part 2
Servlet Part 2Servlet Part 2
Servlet Part 2
vikram singh
 
Tutorial Solution
Tutorial SolutionTutorial Solution
Tutorial Solution
vikram singh
 
Java Script Language Tutorial
Java Script Language TutorialJava Script Language Tutorial
Java Script Language Tutorial
vikram singh
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
vikram singh
 
Sample Report Format
Sample Report FormatSample Report Format
Sample Report Format
vikram singh
 
Javascript
JavascriptJavascript
Javascript
vikram singh
 
Javascript
JavascriptJavascript
Javascript
vikram singh
 

More from vikram singh (20)

Agile
AgileAgile
Agile
 
Web tech importants
Web tech importantsWeb tech importants
Web tech importants
 
2 4 Tree
2 4 Tree2 4 Tree
2 4 Tree
 
23 Tree Best Part
23 Tree   Best Part23 Tree   Best Part
23 Tree Best Part
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 
jdbc
jdbcjdbc
jdbc
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
Xml
XmlXml
Xml
 
Dtd
DtdDtd
Dtd
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 
JSP
JSPJSP
JSP
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servlet
 
Servlet Part 2
Servlet Part 2Servlet Part 2
Servlet Part 2
 
Tutorial Solution
Tutorial SolutionTutorial Solution
Tutorial Solution
 
Java Script Language Tutorial
Java Script Language TutorialJava Script Language Tutorial
Java Script Language Tutorial
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
Sample Report Format
Sample Report FormatSample Report Format
Sample Report Format
 
Javascript
JavascriptJavascript
Javascript
 
Javascript
JavascriptJavascript
Javascript
 

Recently uploaded

The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

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!!!
  • 16.
  • 17.
  • 18. EJB ARCHITECTURE 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)
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59. Remote Component Interface 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!
  • 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.
  • 71.
  • 72. 06/25/10 JavaTruths.com:A Portal for all java related stuff!!!

Editor's Notes

  1. 06/25/10
  2. 06/25/10