SlideShare a Scribd company logo
1 of 30
Stateless Session Beans Session 3
Session Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object]
Review of Session 2-(1of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Review of Session 2-(2 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Components of an Enterprise Bean Components of an  enterprise bean  The bean class The EJB object The Remote  interface Deployment Descriptors The Home  Interface The EJB-jar file The Home object The Local Interface The LocalHome Interface
The Bean class Well-defined interface The Bean Bound Communicates to the  client through the  interface Container Works in any  container with the  help of these interfaces public interface javax. ejb. EnterpriseBean extends java.io.Serializable { } Once the above interface is implemented, the bean class is confirmed
The EJB Object Client Code EJB Container/Server 1 .Calls a method 4.Returns method    to client The container is the middleman between the client and the bean. It manifests itself  as a single network-aware object. This network-aware object is called the  EJB Object Home Object EJB Object 3. Returns the Method Enterprise Bean Instance 2. Delegates  method   to bean
The Remote Interface Remote Interfaces  derived from javax.ejb.EJBObject  Business  Methods Define Perform Functionality of  the bean javax.ejb.EJBObject public interface java.rmi.RemoteInterface extends javax.ejb.EJBObject { public abstract javax.ejb.EJBHome getEJBHome()  throws  java.rmi.RemoteException; }
Relationship between Java RMI and EJB Objects Location Transparency Remote Method Invocation Portability of Client Code Bean Java Virtual Machine Bean Java Virtual Machine EJB Object java.rmi.Remote Remote  Object JVM JVM
Methods under javax.ejb.EJBObject javax.ejb.EJBObject getEJBHome() getPrimaryKey() remove() getHandle() isIdentical()
The Home Interface Home Interface  Find EJB  Objects Create EJB  Objects Destroy EJB Objects EJB specifies certain methods that the home interface has to support. These methods are defined in the  javax.ejb.EJBHome public interface javax.ejb.EJBHome extends java.rmi.Remote  { public abstract EJBMetaData  getEJBMetaData() throws java.rmi.RemoteException; }
The Methods  in EJB Home getEJBMetaData():  It is this method that gets information about the  beans that are being worked on remove():  This method destroys an  EJB object The methods that fall under the  EJB Home are
The Home Object Client Code Home Object EJB  Object Enterprise Beans EJB Container/Server 1. Requests new EJB Object 3. Returns the objects 2. Creates new object
Deployment Descriptors Deployment  Descriptors Life cycle requirements  and Bean management Persistence Requirements Transaction Requirements Security Management Classes that form the bean Home Interface Remote Interface EJB Server
Life Cycle of a Session Bean ,[object Object],[object Object],[object Object]
Conversational and Non Conversational Beans ,[object Object],[object Object],[object Object],Client Conversation Bean
Writing a Session Bean The six methods to be followed while  writing a session bean  setSessionContext(SessionContext ctx) ejbCreate() ejbPassivate() Business methods ejbRemove() ejbActivate()
The  setSessionContext (SessionContext ctx) Container setSessionContext() Bean public class theBean implements SessionBean { private SessionContext ctx; public void setSessionContext(SessionContext ctx) { this.ctx=ctx; } . . . . . . .  } Session Context (Gateway) Associates
Business Methods ,[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]
Using JNDI to lookup Home Objects Home  Object Enterprise  beans EJB  Object Client JNDI Naming Service 1. Retrieve  Home  Object 3. Creates an EJB Object 5. Return Object reference 6. Invokes business methods EJB Container/Server 4. Create  EJB Object 2. Returns reference  to the home object 7. Delegates request to bean
Steps in accessing Home Objects The steps followed by the client code  to get a reference The setting up of the Environment Destroying the EJB Object Calling a Method Creating an Object Retrieving the home objects The Initial Context
Pooling of Stateless Session Bean Client EJB  Object Invokes EJB Server/Container Invokes Bean Bean Bean Bean
Deployment Descriptors ,[object Object],[object Object],[object Object],[object Object]
jboss.xml ,[object Object],[object Object],<jboss> <enterprise-beans> <session>   <ejb-name>Welcome</ejb-name>   <jndi-name>Welcome</jndi-name> </session> </enterprise-beans> </jboss>
Creating the jar file Welcome.class Deployment  Descriptors Welcome.jar Welcomebean.class Welcomehome.class A jar file is created to package the three java files, namely the  bean class, the home interface and the remote interface . The XML files Namely  ejb-jar.xml   and  jboss.xml  are also present in the jar file.
Deploying the bean ,[object Object],D:inbosseploy .jar file jar cvf welcome.jar Welcome.class Welcomehome.class Welcomebean.class  META-INF
Accessing from Client side Possible Clients JNDI lookup create() Ordinary JavaBean Enterprise JavaBean JSP Page Servlet Applet Enterprise JavaBean Home Object EJB  Object Business  Methods
Summary - 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary - 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary - 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in javaAcp Jamod
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4phanleson
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionKelum Senanayake
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJBPeter R. Egli
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)Fahad Golra
 
Enterprise Java Beans( E)
Enterprise  Java  Beans( E)Enterprise  Java  Beans( E)
Enterprise Java Beans( E)vikram singh
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questionsguest346cb1
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecturetayab4687
 
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 TopLinkBill Lyons
 
Ejb3.1 for the starter
Ejb3.1 for the starterEjb3.1 for the starter
Ejb3.1 for the startershohancse
 

What's hot (20)

Ejb notes
Ejb notesEjb notes
Ejb notes
 
Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
 
Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)Enterprise JavaBeans(EJB)
Enterprise JavaBeans(EJB)
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
 
Introduction to EJB
Introduction to EJBIntroduction to EJB
Introduction to EJB
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 
Enterprise Java Beans - EJB
Enterprise Java Beans - EJBEnterprise Java Beans - EJB
Enterprise Java Beans - EJB
 
Java bean
Java beanJava bean
Java bean
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 
Enterprise Java Beans( E)
Enterprise  Java  Beans( E)Enterprise  Java  Beans( E)
Enterprise Java Beans( E)
 
EJB3 Basics
EJB3 BasicsEJB3 Basics
EJB3 Basics
 
EJB Interview Questions
EJB Interview QuestionsEJB Interview Questions
EJB Interview Questions
 
Java EE EJB Applications
Java EE EJB ApplicationsJava EE EJB Applications
Java EE EJB Applications
 
Aravind vinnakota ejb_architecture
Aravind vinnakota ejb_architectureAravind vinnakota ejb_architecture
Aravind vinnakota ejb_architecture
 
Deployment
DeploymentDeployment
Deployment
 
EJB 3.0 and J2EE
EJB 3.0 and J2EEEJB 3.0 and J2EE
EJB 3.0 and J2EE
 
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
 
Ejb3.1 for the starter
Ejb3.1 for the starterEjb3.1 for the starter
Ejb3.1 for the starter
 
Enterprise java beans
Enterprise java beansEnterprise java beans
Enterprise java beans
 
enterprise java bean
enterprise java beanenterprise java bean
enterprise java bean
 

Similar to Session 3 Tp3

Session 6 Tp6
Session 6 Tp6Session 6 Tp6
Session 6 Tp6phanleson
 
1-introduction to ejb
1-introduction to ejb1-introduction to ejb
1-introduction to ejbashishkirpan
 
Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5phanleson
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptrani marri
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical OverviewSvetlin Nakov
 
Session 7 Tp7
Session 7 Tp7Session 7 Tp7
Session 7 Tp7phanleson
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)vikram singh
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2vikram singh
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise Group
 
Session 2 Tp2
Session 2 Tp2Session 2 Tp2
Session 2 Tp2phanleson
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)vikram singh
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsVirtual Nuggets
 
Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2vikram singh
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2vikram singh
 
CommercialSystemsBahman.ppt
CommercialSystemsBahman.pptCommercialSystemsBahman.ppt
CommercialSystemsBahman.pptKalsoomTahir2
 

Similar to Session 3 Tp3 (20)

Session 6 Tp6
Session 6 Tp6Session 6 Tp6
Session 6 Tp6
 
1-introduction to ejb
1-introduction to ejb1-introduction to ejb
1-introduction to ejb
 
Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5
 
Ch4 ejb
Ch4 ejbCh4 ejb
Ch4 ejb
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
 
Session 7 Tp7
Session 7 Tp7Session 7 Tp7
Session 7 Tp7
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
 
Session 2 Tp2
Session 2 Tp2Session 2 Tp2
Session 2 Tp2
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
 
Ejb intro
Ejb introEjb intro
Ejb intro
 
Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2
 
Ejb
EjbEjb
Ejb
 
CommercialSystemsBahman.ppt
CommercialSystemsBahman.pptCommercialSystemsBahman.ppt
CommercialSystemsBahman.ppt
 

More from phanleson

Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Sparkphanleson
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewallsphanleson
 
Mobile Security - Wireless hacking
Mobile Security - Wireless hackingMobile Security - Wireless hacking
Mobile Security - Wireless hackingphanleson
 
Authentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless ProtocolsAuthentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless Protocolsphanleson
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacksphanleson
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applicationsphanleson
 
HBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designHBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designphanleson
 
HBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - OperationsHBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - Operationsphanleson
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBasephanleson
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibphanleson
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streamingphanleson
 
Learning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLLearning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLphanleson
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Clusterphanleson
 
Learning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programmingphanleson
 
Learning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your DataLearning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your Dataphanleson
 
Learning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value PairsLearning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value Pairsphanleson
 
Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Sparkphanleson
 
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about LibertagiaHướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagiaphanleson
 
Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLphanleson
 
Lecture 4 - Adding XTHML for the Web
Lecture  4 - Adding XTHML for the WebLecture  4 - Adding XTHML for the Web
Lecture 4 - Adding XTHML for the Webphanleson
 

More from phanleson (20)

Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
 
Mobile Security - Wireless hacking
Mobile Security - Wireless hackingMobile Security - Wireless hacking
Mobile Security - Wireless hacking
 
Authentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless ProtocolsAuthentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless Protocols
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacks
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
 
HBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designHBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table design
 
HBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - OperationsHBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - Operations
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBase
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
 
Learning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLLearning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQL
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
 
Learning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programming
 
Learning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your DataLearning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your Data
 
Learning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value PairsLearning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value Pairs
 
Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about LibertagiaHướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
 
Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XML
 
Lecture 4 - Adding XTHML for the Web
Lecture  4 - Adding XTHML for the WebLecture  4 - Adding XTHML for the Web
Lecture 4 - Adding XTHML for the Web
 

Recently uploaded

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Session 3 Tp3

  • 2.
  • 3.
  • 4.
  • 5. Components of an Enterprise Bean Components of an enterprise bean The bean class The EJB object The Remote interface Deployment Descriptors The Home Interface The EJB-jar file The Home object The Local Interface The LocalHome Interface
  • 6. The Bean class Well-defined interface The Bean Bound Communicates to the client through the interface Container Works in any container with the help of these interfaces public interface javax. ejb. EnterpriseBean extends java.io.Serializable { } Once the above interface is implemented, the bean class is confirmed
  • 7. The EJB Object Client Code EJB Container/Server 1 .Calls a method 4.Returns method to client The container is the middleman between the client and the bean. It manifests itself as a single network-aware object. This network-aware object is called the EJB Object Home Object EJB Object 3. Returns the Method Enterprise Bean Instance 2. Delegates method to bean
  • 8. The Remote Interface Remote Interfaces derived from javax.ejb.EJBObject Business Methods Define Perform Functionality of the bean javax.ejb.EJBObject public interface java.rmi.RemoteInterface extends javax.ejb.EJBObject { public abstract javax.ejb.EJBHome getEJBHome() throws java.rmi.RemoteException; }
  • 9. Relationship between Java RMI and EJB Objects Location Transparency Remote Method Invocation Portability of Client Code Bean Java Virtual Machine Bean Java Virtual Machine EJB Object java.rmi.Remote Remote Object JVM JVM
  • 10. Methods under javax.ejb.EJBObject javax.ejb.EJBObject getEJBHome() getPrimaryKey() remove() getHandle() isIdentical()
  • 11. The Home Interface Home Interface Find EJB Objects Create EJB Objects Destroy EJB Objects EJB specifies certain methods that the home interface has to support. These methods are defined in the javax.ejb.EJBHome public interface javax.ejb.EJBHome extends java.rmi.Remote { public abstract EJBMetaData getEJBMetaData() throws java.rmi.RemoteException; }
  • 12. The Methods in EJB Home getEJBMetaData(): It is this method that gets information about the beans that are being worked on remove(): This method destroys an EJB object The methods that fall under the EJB Home are
  • 13. The Home Object Client Code Home Object EJB Object Enterprise Beans EJB Container/Server 1. Requests new EJB Object 3. Returns the objects 2. Creates new object
  • 14. Deployment Descriptors Deployment Descriptors Life cycle requirements and Bean management Persistence Requirements Transaction Requirements Security Management Classes that form the bean Home Interface Remote Interface EJB Server
  • 15.
  • 16.
  • 17. Writing a Session Bean The six methods to be followed while writing a session bean setSessionContext(SessionContext ctx) ejbCreate() ejbPassivate() Business methods ejbRemove() ejbActivate()
  • 18. The setSessionContext (SessionContext ctx) Container setSessionContext() Bean public class theBean implements SessionBean { private SessionContext ctx; public void setSessionContext(SessionContext ctx) { this.ctx=ctx; } . . . . . . . } Session Context (Gateway) Associates
  • 19.
  • 20. Using JNDI to lookup Home Objects Home Object Enterprise beans EJB Object Client JNDI Naming Service 1. Retrieve Home Object 3. Creates an EJB Object 5. Return Object reference 6. Invokes business methods EJB Container/Server 4. Create EJB Object 2. Returns reference to the home object 7. Delegates request to bean
  • 21. Steps in accessing Home Objects The steps followed by the client code to get a reference The setting up of the Environment Destroying the EJB Object Calling a Method Creating an Object Retrieving the home objects The Initial Context
  • 22. Pooling of Stateless Session Bean Client EJB Object Invokes EJB Server/Container Invokes Bean Bean Bean Bean
  • 23.
  • 24.
  • 25. Creating the jar file Welcome.class Deployment Descriptors Welcome.jar Welcomebean.class Welcomehome.class A jar file is created to package the three java files, namely the bean class, the home interface and the remote interface . The XML files Namely ejb-jar.xml and jboss.xml are also present in the jar file.
  • 26.
  • 27. Accessing from Client side Possible Clients JNDI lookup create() Ordinary JavaBean Enterprise JavaBean JSP Page Servlet Applet Enterprise JavaBean Home Object EJB Object Business Methods
  • 28.
  • 29.
  • 30.

Editor's Notes

  1. Approach: