SlideShare une entreprise Scribd logo
1  sur  33
Mohamed Ali Ibrahim
Inform IBM
 Server-side component that encapsulates the
business logic of an application.
 Simplify the development of large, distributed
applications.
 Focusing on solving business problems.
 Provide transactions and security
management.
 Benefits: Scalability , data integrity and Client
variety.
 EJB Container
 Session Bean
◦ Stateless
◦ Stateful
◦ Singleton
 Message Driven Bean(JMS)
 EJB Interfaces:
◦ Local interface
◦ No interface.
◦ Remote interface.
 EJB Access
◦ Dependency injection (@EJB)
◦ JNDI lookup :
InitialContext.lookup("java:module/ExampleBean");
 Could have a timeout
 Bean instance is destroyed.
 EJB object is invalidated
 Instances are identical.
 Act as a webservice.
 life Cycle Methods(@PostConstruct, @PreDestroy)
 Share state between all methods
 Could have a timeout
 Can be removed.
 Bean instance is destroyed.
 Can be passivated.
 life Cycle Methods(@PostConstruct, @PreDestroy,
@PrePassivate,@ PostActivate )
 Shared between all clients.
 Concurrent accessed.
 Can depend on other singleton EJB.
 Bean instance is destroyed.
 Could have a timeout.
 Having Concurrency Management.
 life Cycle Methods(@Startup, @PostConstruct,
@PreDestroy)
 Stateless Bean:
 Other stateless bean, stateful bean, singleton,
all JSF managed bean, servlets.
 Stateful Bean:
 Other stateful bean, JSF session bean.
 Singleton:
 Stateless bean, stateful bean, other singleton,
all JSF managed bean, servlets.
 @Remove
 @DependsOn
 @ConcurrencyManagement
 @Lock
 @AccessTimeout(value=120000)
 @Schedule(dayOfWeek="Sun", hour="0")
 @Schedules
 @Timeout
 @Asynchronous
 Replaced in EJB 3.0 with persistence.
 Entity.
 Entity Manager.
 Persistence Unit(Persistance.xml).
 DataSource.
 Relations:OneToOne, OneToMany,
ManyToOne, ManyToMany.
 Atomic , Consistent, Isolated, Durable.
 TransactionManagementType:
◦ CONTAINER Based
◦ BEAN Based
 TransactionAttribute:
◦ Required
◦ RequiresNew
◦ Mandatory
◦ NotSupported
◦ Supports
◦ Never
 TransactionOperation:
◦ UserTransaction
 Begin()
 Commit()
 Rollback()
 setTimeOut()
TransactionAttribute Client’sTransaction BusinessMethod’sTra
nsaction
REQUIRED None T2
REQUIRED T1 T1
REQUIRES_NEW None T2
REQUIRES_NEW T1 T2
MANDATORY None Error
MANDATORY T1 T1
NEVER None None
NEVER T1 Error
SUPPORTS None None
SUPPORTS T1 T1
NOT_SUPPORTED None None
NOT_SUPPORTED T1 None
 Resource Adapter
 EISs: ERP, mainframe transaction processing ,and
database system
 Attributes
◦ Authentication-Type , description , name , lookup ,
shareable , type
 @Resource(name="customerDB") private
javax.sql.DataSource myDB;
 @Resource(name="customerDB") private void
setMyDB(javax.sql.DataSource ds) { myDB = ds; }
 @Resource(name="myMessageQueue",
type="javax.jms.ConnectionFactory") public class
SomeMessageBean {}
 Authentication , Authorization, User, User
Groups, User Roles.
 @DeclareRoles
 @RolesAllowed
 @PermitAll
 @DenyAll
 @Embeddable ,
@Embedded,@AttributeOverrides({})
 @AroundInvoke ,
@Interceptors({interceptorClass.class})
 @WebService, @WebMethod
 What Is Messaging.
 JMS API.
 Administered objects:
◦ Connection factories
◦ destinations
 Connections
 Sessions
 JMS Context
 Messages
 Message producers
 Message consumers:
◦ Listeners
◦ Selectors
 Queue Browsers
 Message header:
◦ JMSDestination
◦ JMSDeliveryMode
◦ JMSDeliveryTime
◦ JMSExpiration
◦ JMSPriority
◦ JMSMessageID
◦ JMSTimestamp
◦ JMSCorrelationID
◦ JMSReplyTo
◦ JMSType
◦ JMSRedelivered
 Message Properties
 Message body:
◦ TextMessage
◦ MapMessage
◦ BytesMessage
◦ StreamMessage
◦ ObjectMessage
◦ Message
1. The client receives the message.
2. The client processes the message.
3. The message is acknowledged:
1. Automatic
2. Client
3. DUPS_OK_ACKNOWLEDGE
 Un-Durable subscriptions
 Durable subscriptions
◦ ensure that a pub/sub application receives all sent
messages
Consumer Type Acknowledgment
Type
Behavior
Synchronous Client Client acknowledges message
after processing is complete
Asynchronous Client Client acknowledges message
after processing is complete
Synchronous Auto Acknowledgment happens
immediately after receive call;
message cannot be redelivered if
any subsequent processing steps
fail
Asynchronous Auto Message is automatically
acknowledged when onMessage
method returns
Un-durable
Durabile
 @MessageDriven
 @ActivationConfigProperty
 @JMSConnectionFactory
 @JMSDestinationDefinition
 @JMSConnectionFactoryDefinition

Contenu connexe

Tendances

clojure Fountain jdbc
clojure Fountain jdbcclojure Fountain jdbc
clojure Fountain jdbc
André Mayer
 

Tendances (20)

Spring survey
Spring surveySpring survey
Spring survey
 
google gwt
google gwtgoogle gwt
google gwt
 
2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | React2018 02-22 React, Redux & Building Applications that Scale | React
2018 02-22 React, Redux & Building Applications that Scale | React
 
Web Basics
Web BasicsWeb Basics
Web Basics
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architecture
 
Spring online training
Spring online trainingSpring online training
Spring online training
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Struts
StrutsStruts
Struts
 
Lecture 1. java database connectivity
Lecture 1. java database connectivityLecture 1. java database connectivity
Lecture 1. java database connectivity
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)
 
Offline db
Offline dbOffline db
Offline db
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
Introduction to react js
Introduction to react jsIntroduction to react js
Introduction to react js
 
clojure Fountain jdbc
clojure Fountain jdbcclojure Fountain jdbc
clojure Fountain jdbc
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
 
Jdbc
Jdbc   Jdbc
Jdbc
 
WJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSWJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJS
 
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
 

Similaire à EJB 3.0 course Sildes and matrial

SaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloudSaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloud
uEngine Solutions
 
Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9
phanleson
 

Similaire à EJB 3.0 course Sildes and matrial (20)

Java ee 8 + security overview
Java ee 8 + security overviewJava ee 8 + security overview
Java ee 8 + security overview
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
 
Enterprise java beans
Enterprise java beansEnterprise java beans
Enterprise java beans
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
 
Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
Unit Testing DFC
Unit Testing DFCUnit Testing DFC
Unit Testing DFC
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
SaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloudSaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloud
 
TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4
 
Unit Testing Documentum Foundation Classes Code
Unit Testing Documentum Foundation Classes CodeUnit Testing Documentum Foundation Classes Code
Unit Testing Documentum Foundation Classes Code
 
Caste a vote online
Caste a vote onlineCaste a vote online
Caste a vote online
 
Virtual classroom
Virtual classroomVirtual classroom
Virtual classroom
 
ConFoo 2015 - Supporting Multi-tenancy Applications with Java EE
ConFoo 2015 - Supporting Multi-tenancy Applications with Java EEConFoo 2015 - Supporting Multi-tenancy Applications with Java EE
ConFoo 2015 - Supporting Multi-tenancy Applications with Java EE
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Session 9 Tp9
Session 9 Tp9Session 9 Tp9
Session 9 Tp9
 
Struts course material
Struts course materialStruts course material
Struts course material
 

Dernier

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (20)

Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

EJB 3.0 course Sildes and matrial

  • 2.
  • 3.  Server-side component that encapsulates the business logic of an application.  Simplify the development of large, distributed applications.  Focusing on solving business problems.  Provide transactions and security management.  Benefits: Scalability , data integrity and Client variety.  EJB Container
  • 4.  Session Bean ◦ Stateless ◦ Stateful ◦ Singleton  Message Driven Bean(JMS)
  • 5.  EJB Interfaces: ◦ Local interface ◦ No interface. ◦ Remote interface.  EJB Access ◦ Dependency injection (@EJB) ◦ JNDI lookup : InitialContext.lookup("java:module/ExampleBean");
  • 6.
  • 7.  Could have a timeout  Bean instance is destroyed.  EJB object is invalidated  Instances are identical.  Act as a webservice.  life Cycle Methods(@PostConstruct, @PreDestroy)
  • 8.
  • 9.  Share state between all methods  Could have a timeout  Can be removed.  Bean instance is destroyed.  Can be passivated.  life Cycle Methods(@PostConstruct, @PreDestroy, @PrePassivate,@ PostActivate )
  • 10.
  • 11.  Shared between all clients.  Concurrent accessed.  Can depend on other singleton EJB.  Bean instance is destroyed.  Could have a timeout.  Having Concurrency Management.  life Cycle Methods(@Startup, @PostConstruct, @PreDestroy)
  • 12.  Stateless Bean:  Other stateless bean, stateful bean, singleton, all JSF managed bean, servlets.  Stateful Bean:  Other stateful bean, JSF session bean.  Singleton:  Stateless bean, stateful bean, other singleton, all JSF managed bean, servlets.
  • 13.  @Remove  @DependsOn  @ConcurrencyManagement  @Lock  @AccessTimeout(value=120000)  @Schedule(dayOfWeek="Sun", hour="0")  @Schedules  @Timeout  @Asynchronous
  • 14.  Replaced in EJB 3.0 with persistence.  Entity.  Entity Manager.  Persistence Unit(Persistance.xml).  DataSource.  Relations:OneToOne, OneToMany, ManyToOne, ManyToMany.
  • 15.  Atomic , Consistent, Isolated, Durable.  TransactionManagementType: ◦ CONTAINER Based ◦ BEAN Based  TransactionAttribute: ◦ Required ◦ RequiresNew ◦ Mandatory ◦ NotSupported ◦ Supports ◦ Never  TransactionOperation: ◦ UserTransaction  Begin()  Commit()  Rollback()  setTimeOut()
  • 16.
  • 17.
  • 18. TransactionAttribute Client’sTransaction BusinessMethod’sTra nsaction REQUIRED None T2 REQUIRED T1 T1 REQUIRES_NEW None T2 REQUIRES_NEW T1 T2 MANDATORY None Error MANDATORY T1 T1 NEVER None None NEVER T1 Error SUPPORTS None None SUPPORTS T1 T1 NOT_SUPPORTED None None NOT_SUPPORTED T1 None
  • 19.  Resource Adapter  EISs: ERP, mainframe transaction processing ,and database system  Attributes ◦ Authentication-Type , description , name , lookup , shareable , type
  • 20.  @Resource(name="customerDB") private javax.sql.DataSource myDB;  @Resource(name="customerDB") private void setMyDB(javax.sql.DataSource ds) { myDB = ds; }  @Resource(name="myMessageQueue", type="javax.jms.ConnectionFactory") public class SomeMessageBean {}
  • 21.  Authentication , Authorization, User, User Groups, User Roles.  @DeclareRoles  @RolesAllowed  @PermitAll  @DenyAll
  • 22.  @Embeddable , @Embedded,@AttributeOverrides({})  @AroundInvoke , @Interceptors({interceptorClass.class})  @WebService, @WebMethod
  • 23.  What Is Messaging.  JMS API.
  • 24.  Administered objects: ◦ Connection factories ◦ destinations  Connections  Sessions  JMS Context  Messages  Message producers  Message consumers: ◦ Listeners ◦ Selectors  Queue Browsers
  • 25.
  • 26.  Message header: ◦ JMSDestination ◦ JMSDeliveryMode ◦ JMSDeliveryTime ◦ JMSExpiration ◦ JMSPriority ◦ JMSMessageID ◦ JMSTimestamp ◦ JMSCorrelationID ◦ JMSReplyTo ◦ JMSType ◦ JMSRedelivered  Message Properties  Message body: ◦ TextMessage ◦ MapMessage ◦ BytesMessage ◦ StreamMessage ◦ ObjectMessage ◦ Message
  • 27.
  • 28.
  • 29. 1. The client receives the message. 2. The client processes the message. 3. The message is acknowledged: 1. Automatic 2. Client 3. DUPS_OK_ACKNOWLEDGE  Un-Durable subscriptions  Durable subscriptions ◦ ensure that a pub/sub application receives all sent messages
  • 30. Consumer Type Acknowledgment Type Behavior Synchronous Client Client acknowledges message after processing is complete Asynchronous Client Client acknowledges message after processing is complete Synchronous Auto Acknowledgment happens immediately after receive call; message cannot be redelivered if any subsequent processing steps fail Asynchronous Auto Message is automatically acknowledged when onMessage method returns
  • 32.
  • 33.  @MessageDriven  @ActivationConfigProperty  @JMSConnectionFactory  @JMSDestinationDefinition  @JMSConnectionFactoryDefinition