SlideShare ist ein Scribd-Unternehmen logo
1 von 99
Carol McDonald Java EE 6: The Next Generation Enterprise Application Platform
Topics ,[object Object]
Bean validation
DI (JSR-330) and CDI (JSR-299)
JPA 2.0
Servlet 3.0
EJB 3.1
JSF 2.0
JAX-RS 1.1
JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
Java EE 6 Themes
A brief history May 1998 Project JPE Dec 1999 10 specs J2EE 1.2 Enterprise Application Servlet JSP EJB JMS RMI/IIOP Sept 2001 13 specs J2EE 1.3 Robust Scalable CMP JCA Nov 2003 20 specs J2EE 1.4 Web Services WS Management Deployment May 2006 23 specs Java EE 5 Ease of development Annotations EJB 3 JPA 1.0 WS-* JSF Q4 2009 28 specs Java EE 6 Right-sizing EJB 3.1 JPA 2.0 Servlet 3.0 JSF 2.0 JAX-RS 1.1 JCDI 1.0 @Inject Bean Validat° Web Profile Managed Bean
[object Object]
Use only what you need
Web profile, EJB Lite ,[object Object],[object Object],[object Object],[object Object]
Dependency Injection (DI) Major Themes of Java EE 6
Profiles
Web Profile ,[object Object]
For web development
Separate specification ,[object Object],[object Object],[object Object]
Portal.... JSF 2.0 Servlet 3.0 JSP 2.2 EL 2.2 JSTL 1.2 EJB Lite 3.1 Managed Beans 1.0 Interceptors 1.1 JTA 1.1 JPA 2.0 Bean Validation  1.0 DI 1.0 CDI 1.0
Pruning ,[object Object]
JAX-RPC
JAX-R
JSR 88 (Java EE Application Deployment)
EJB Lite ,[object Object]
Injection
Transaction
Interceptors
Security ,[object Object],[object Object]
EJB Web Service Endpoint
RMI/IIOP Interoperability
Remote interface
EJB 2.x
Timer service
CMP / BMP
New Specs  Updated Specs ,[object Object]
CDI 1.0
Managed Beans 1.0
Bean Validation 1.0
JAX-RS 1.1 ,[object Object]
JPA 2.0
Servlet 3.0
JSF 2.0
Interceptors 1.1
Connectors 1.6
JAX-WS 2.2
JSR-109 1.3
JSP 2.2 / EL 2.2
JSR-250 1.1
Managed Bean 1.0 & Interceptors 1.1
Managed Bean 1.0: What is it? ,[object Object]
Life-cycle management (@PostConstruct, @PreDestroy)
Interceptor (@Interceptors, @AroundInvoke)
Managed Beans 1.0: Example @ManagedBean public class MyPojo { @Resource  // Resource injection private Datasource ds; @PostConstruct  // Life-cycle private void init() { .... } public void myMethod() {...} }
Managed Bean vs. EJB and REST ,[object Object]
An EJB is a Managed Bean with : ,[object Object]
Security
Thread safety ,[object Object],[object Object]
Interceptors 1.1: What is it? ,[object Object]
Was part of the EJB 3.0 spec
Now a separate spec shipped with EJB 3.1
Can be uses in EJBs...
… as well as ManagedBeans
@AroundInvoke
Managed Beans 1.0: Example @ManagedBean @Interceptors(LoggingInterceptor.class) public class MyPojo { public void myMethod() {...} } public class LoggingInterceptor { @AroundInvoke public Object logMethod(InvContext ic) {...} }
Demo : Managed Bean & Interceptor ,[object Object]
Inject the managed bean through  @Resource  (works only under a container environment)
Use an interceptor for logging
Use “appclient” container (from GlassFish) to run it
Dependency Injection for Java (DI) 1.0 (JSR 330) & Context and  Dependency Injection (CDI) 1.0 (JSR 299)
[object Object]
Java EE 5 has resource injection ,[object Object],[object Object]
DI 1.0 introduces  @Inject  annotation (and others) for application level injection
Spec. leads are Bob Lee (from Google) and Rod Johnson (from SpringSource) DI 1.0 (JSR 330): What  & Why?
[object Object]
@Inject  : Identifies injectable constructors, methods, and fields
@Named  : String-based qualifier (for EL)
@Qualifier  : Identifies qualifier
@Scope  : Identifies scope annotations
@Singleton  : Instantiates once DI 1.0 (JSR 330)
[object Object]
Uses annotations defined in DI 1.0 (JSR-330) @Inject ShoppingCart cart;  ,[object Object]
Every object managed by CDI has a well-defined scope ,[object Object],CDI 1.0 (JSR-299)
[object Object]
e.g. @Inject  @LoggedIn   User  user;
Qualifier is used to narrow down a particular class when more than one candidate for injection exists ,[object Object],[object Object]
public class ShoppingCart { … } CDI 1.0 (JSR-299)
ItemController Bean and Dependency Injection import service.CatalogService; @Controller @Scope("session") public class ItemController { @Inject private CatalogService catalogService ; . . . Inject Bean Creates ItemController bean  no need to put in  .xml CatalogService injected by type
Demo: How to Check Out “ glassfish-samples” www.javapassion.com/handsonlabs/javaee6_examples/#Exercise_1
Demo: DI & CDI “ webbeans-guess” (Available from  “ glassfish-samples” project)
JPA 2.0
JPA 2.0 Features ,[object Object]
Richer JPQL
Pessimistic Locking
Criteria API
Cache API
Many more
JPA 2.0: Richer Mapping ,[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationPeter Lehto
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6Gal Marder
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutesglassfish
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Arun Gupta
 
Spring training
Spring trainingSpring training
Spring trainingshah_d_p
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questionsDhiraj Champawat
 
Utilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityUtilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityMasoud Kalali
 
Dependency Injection in Spring in 10min
Dependency Injection in Spring in 10minDependency Injection in Spring in 10min
Dependency Injection in Spring in 10minCorneil du Plessis
 
Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5IndicThreads
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Murat Yener
 

Was ist angesagt? (20)

Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integration
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
 
Spring Core
Spring CoreSpring Core
Spring Core
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
Java ee7 1hour
Java ee7 1hourJava ee7 1hour
Java ee7 1hour
 
Spring training
Spring trainingSpring training
Spring training
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
 
Spring Basics
Spring BasicsSpring Basics
Spring Basics
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Spring 3 to 4
Spring 3 to 4Spring 3 to 4
Spring 3 to 4
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
 
Utilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE SecurityUtilize the Full Power of GlassFish Server and Java EE Security
Utilize the Full Power of GlassFish Server and Java EE Security
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Dependency Injection in Spring in 10min
Dependency Injection in Spring in 10minDependency Injection in Spring in 10min
Dependency Injection in Spring in 10min
 
Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Java Programming - 08 java threading
Java Programming - 08 java threadingJava Programming - 08 java threading
Java Programming - 08 java threading
 
JEE5 New Features
JEE5 New FeaturesJEE5 New Features
JEE5 New Features
 

Ähnlich wie Java EE 6: Right-sizing, Extensibility, Ease of development

The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platformLorraine JUG
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopArun Gupta
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Peter Pilgrim
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Arun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
OpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConOpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConos890
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012Arun Gupta
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?gedoplan
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Arun Gupta
 
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity & HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUGArun Gupta
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 

Ähnlich wie Java EE 6: Right-sizing, Extensibility, Ease of development (20)

JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011JBoss AS7 OSDC 2011
JBoss AS7 OSDC 2011
 
The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platform
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 Workshop
 
Spring Basics
Spring BasicsSpring Basics
Spring Basics
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
OpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheConOpenWebBeans and DeltaSpike at ApacheCon
OpenWebBeans and DeltaSpike at ApacheCon
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
 
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity & HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity & HTML5 at San Francisco JUG
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 

Mehr von Carol McDonald

Introduction to machine learning with GPUs
Introduction to machine learning with GPUsIntroduction to machine learning with GPUs
Introduction to machine learning with GPUsCarol McDonald
 
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...Carol McDonald
 
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DBAnalyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DBCarol McDonald
 
Analysis of Popular Uber Locations using Apache APIs: Spark Machine Learning...
Analysis of Popular Uber Locations using Apache APIs:  Spark Machine Learning...Analysis of Popular Uber Locations using Apache APIs:  Spark Machine Learning...
Analysis of Popular Uber Locations using Apache APIs: Spark Machine Learning...Carol McDonald
 
Predicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningPredicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningCarol McDonald
 
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DBStructured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DBCarol McDonald
 
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...Carol McDonald
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...Carol McDonald
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...Carol McDonald
 
How Big Data is Reducing Costs and Improving Outcomes in Health Care
How Big Data is Reducing Costs and Improving Outcomes in Health CareHow Big Data is Reducing Costs and Improving Outcomes in Health Care
How Big Data is Reducing Costs and Improving Outcomes in Health CareCarol McDonald
 
Demystifying AI, Machine Learning and Deep Learning
Demystifying AI, Machine Learning and Deep LearningDemystifying AI, Machine Learning and Deep Learning
Demystifying AI, Machine Learning and Deep LearningCarol McDonald
 
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...Carol McDonald
 
Streaming patterns revolutionary architectures
Streaming patterns revolutionary architectures Streaming patterns revolutionary architectures
Streaming patterns revolutionary architectures Carol McDonald
 
Spark machine learning predicting customer churn
Spark machine learning predicting customer churnSpark machine learning predicting customer churn
Spark machine learning predicting customer churnCarol McDonald
 
Fast Cars, Big Data How Streaming can help Formula 1
Fast Cars, Big Data How Streaming can help Formula 1Fast Cars, Big Data How Streaming can help Formula 1
Fast Cars, Big Data How Streaming can help Formula 1Carol McDonald
 
Applying Machine Learning to Live Patient Data
Applying Machine Learning to  Live Patient DataApplying Machine Learning to  Live Patient Data
Applying Machine Learning to Live Patient DataCarol McDonald
 
Streaming Patterns Revolutionary Architectures with the Kafka API
Streaming Patterns Revolutionary Architectures with the Kafka APIStreaming Patterns Revolutionary Architectures with the Kafka API
Streaming Patterns Revolutionary Architectures with the Kafka APICarol McDonald
 
Apache Spark Machine Learning Decision Trees
Apache Spark Machine Learning Decision TreesApache Spark Machine Learning Decision Trees
Apache Spark Machine Learning Decision TreesCarol McDonald
 
Advanced Threat Detection on Streaming Data
Advanced Threat Detection on Streaming DataAdvanced Threat Detection on Streaming Data
Advanced Threat Detection on Streaming DataCarol McDonald
 

Mehr von Carol McDonald (20)

Introduction to machine learning with GPUs
Introduction to machine learning with GPUsIntroduction to machine learning with GPUs
Introduction to machine learning with GPUs
 
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...
Streaming healthcare Data pipeline using Apache APIs: Kafka and Spark with Ma...
 
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DBAnalyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
Analyzing Flight Delays with Apache Spark, DataFrames, GraphFrames, and MapR-DB
 
Analysis of Popular Uber Locations using Apache APIs: Spark Machine Learning...
Analysis of Popular Uber Locations using Apache APIs:  Spark Machine Learning...Analysis of Popular Uber Locations using Apache APIs:  Spark Machine Learning...
Analysis of Popular Uber Locations using Apache APIs: Spark Machine Learning...
 
Predicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine LearningPredicting Flight Delays with Spark Machine Learning
Predicting Flight Delays with Spark Machine Learning
 
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DBStructured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
Structured Streaming Data Pipeline Using Kafka, Spark, and MapR-DB
 
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real- T...
 
How Big Data is Reducing Costs and Improving Outcomes in Health Care
How Big Data is Reducing Costs and Improving Outcomes in Health CareHow Big Data is Reducing Costs and Improving Outcomes in Health Care
How Big Data is Reducing Costs and Improving Outcomes in Health Care
 
Demystifying AI, Machine Learning and Deep Learning
Demystifying AI, Machine Learning and Deep LearningDemystifying AI, Machine Learning and Deep Learning
Demystifying AI, Machine Learning and Deep Learning
 
Spark graphx
Spark graphxSpark graphx
Spark graphx
 
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
 
Streaming patterns revolutionary architectures
Streaming patterns revolutionary architectures Streaming patterns revolutionary architectures
Streaming patterns revolutionary architectures
 
Spark machine learning predicting customer churn
Spark machine learning predicting customer churnSpark machine learning predicting customer churn
Spark machine learning predicting customer churn
 
Fast Cars, Big Data How Streaming can help Formula 1
Fast Cars, Big Data How Streaming can help Formula 1Fast Cars, Big Data How Streaming can help Formula 1
Fast Cars, Big Data How Streaming can help Formula 1
 
Applying Machine Learning to Live Patient Data
Applying Machine Learning to  Live Patient DataApplying Machine Learning to  Live Patient Data
Applying Machine Learning to Live Patient Data
 
Streaming Patterns Revolutionary Architectures with the Kafka API
Streaming Patterns Revolutionary Architectures with the Kafka APIStreaming Patterns Revolutionary Architectures with the Kafka API
Streaming Patterns Revolutionary Architectures with the Kafka API
 
Apache Spark Machine Learning Decision Trees
Apache Spark Machine Learning Decision TreesApache Spark Machine Learning Decision Trees
Apache Spark Machine Learning Decision Trees
 
Advanced Threat Detection on Streaming Data
Advanced Threat Detection on Streaming DataAdvanced Threat Detection on Streaming Data
Advanced Threat Detection on Streaming Data
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
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
 

Java EE 6: Right-sizing, Extensibility, Ease of development

  • 1. Carol McDonald Java EE 6: The Next Generation Enterprise Application Platform
  • 2.
  • 4. DI (JSR-330) and CDI (JSR-299)
  • 10. JAVA EE 6 FINAL RELEASE DECEMBER 10, 2009
  • 11. Java EE 6 Themes
  • 12. A brief history May 1998 Project JPE Dec 1999 10 specs J2EE 1.2 Enterprise Application Servlet JSP EJB JMS RMI/IIOP Sept 2001 13 specs J2EE 1.3 Robust Scalable CMP JCA Nov 2003 20 specs J2EE 1.4 Web Services WS Management Deployment May 2006 23 specs Java EE 5 Ease of development Annotations EJB 3 JPA 1.0 WS-* JSF Q4 2009 28 specs Java EE 6 Right-sizing EJB 3.1 JPA 2.0 Servlet 3.0 JSF 2.0 JAX-RS 1.1 JCDI 1.0 @Inject Bean Validat° Web Profile Managed Bean
  • 13.
  • 14. Use only what you need
  • 15.
  • 16. Dependency Injection (DI) Major Themes of Java EE 6
  • 18.
  • 20.
  • 21. Portal.... JSF 2.0 Servlet 3.0 JSP 2.2 EL 2.2 JSTL 1.2 EJB Lite 3.1 Managed Beans 1.0 Interceptors 1.1 JTA 1.1 JPA 2.0 Bean Validation 1.0 DI 1.0 CDI 1.0
  • 22.
  • 24. JAX-R
  • 25. JSR 88 (Java EE Application Deployment)
  • 26.
  • 30.
  • 31. EJB Web Service Endpoint
  • 37.
  • 41.
  • 49. JSP 2.2 / EL 2.2
  • 51. Managed Bean 1.0 & Interceptors 1.1
  • 52.
  • 55. Managed Beans 1.0: Example @ManagedBean public class MyPojo { @Resource // Resource injection private Datasource ds; @PostConstruct // Life-cycle private void init() { .... } public void myMethod() {...} }
  • 56.
  • 57.
  • 59.
  • 60.
  • 61. Was part of the EJB 3.0 spec
  • 62. Now a separate spec shipped with EJB 3.1
  • 63. Can be uses in EJBs...
  • 64. … as well as ManagedBeans
  • 66. Managed Beans 1.0: Example @ManagedBean @Interceptors(LoggingInterceptor.class) public class MyPojo { public void myMethod() {...} } public class LoggingInterceptor { @AroundInvoke public Object logMethod(InvContext ic) {...} }
  • 67.
  • 68. Inject the managed bean through @Resource (works only under a container environment)
  • 69. Use an interceptor for logging
  • 70. Use “appclient” container (from GlassFish) to run it
  • 71. Dependency Injection for Java (DI) 1.0 (JSR 330) & Context and Dependency Injection (CDI) 1.0 (JSR 299)
  • 72.
  • 73.
  • 74. DI 1.0 introduces @Inject annotation (and others) for application level injection
  • 75. Spec. leads are Bob Lee (from Google) and Rod Johnson (from SpringSource) DI 1.0 (JSR 330): What & Why?
  • 76.
  • 77. @Inject : Identifies injectable constructors, methods, and fields
  • 78. @Named : String-based qualifier (for EL)
  • 79. @Qualifier : Identifies qualifier
  • 80. @Scope : Identifies scope annotations
  • 81. @Singleton : Instantiates once DI 1.0 (JSR 330)
  • 82.
  • 83.
  • 84.
  • 85.
  • 86. e.g. @Inject @LoggedIn User user;
  • 87.
  • 88. public class ShoppingCart { … } CDI 1.0 (JSR-299)
  • 89. ItemController Bean and Dependency Injection import service.CatalogService; @Controller @Scope("session") public class ItemController { @Inject private CatalogService catalogService ; . . . Inject Bean Creates ItemController bean no need to put in .xml CatalogService injected by type
  • 90. Demo: How to Check Out “ glassfish-samples” www.javapassion.com/handsonlabs/javaee6_examples/#Exercise_1
  • 91. Demo: DI & CDI “ webbeans-guess” (Available from “ glassfish-samples” project)
  • 93.
  • 99.
  • 100. Embeddables containing collection of embeddables and basic types
  • 101. PK can be derived entities
  • 102. More support for Maps...
  • 103. JPA 2.0: Collection of basic types @Entity Public class Item { @ElementCollection private Set<String> tags; } @Entity Public class Item { @ElementCollection @CollectionTable(name=&quot;TAGS&quot;) private Set<String> tags; } Mapped by default in ITEM_TAGS Mapped in TAGS
  • 104.
  • 105. Allow joins in subquery FROM clause
  • 106.
  • 107. CASE (for case expressions)
  • 108.
  • 109. Example: JPQL CASE Expression @Entity public class Employee { @Id Integer empId; String name; Float salary; Integer rating; // ... } UPDATE Employee e SET e.salary = CASE WHEN e.rating = 1 THEN e.salary * 1.05 WHEN e.rating = 2 THEN e.salary * 1.02 ELSE e.salary * 0.95 END
  • 110.
  • 114.
  • 115. JPA 2.0 adds pessimistic locking
  • 116.
  • 118. read then lock and refresh public enum LockModeType { OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC, PESSIMISTIC_FORCE_INCREMENT, NONE }
  • 119. Example Scenario public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
  • 120. Pessimistic Locking: Example 1 // // Read then lock // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ em.lock(acct, PESSIMISTIC); acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
  • 121. Pessimistic Locking: Example 2 // // Read and lock // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId, PESSIMISTIC ); // … Do some work to compute charge double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
  • 122. Pessimistic Locking: Example 3 // // Read then lock and refresh // public void applyCharges () { em.getTransaction().begin(); Account acct = em.find (Account.class, acctId); // … Do some work to compute charge em.refresh(acct, PESSIMISTIC); double balance = acct.getBalance(); if (charge > 0){ acct.setBalance(balance – charge); } em.getTransaction().commit(); } source: Mike Keith
  • 123.
  • 124.
  • 125.
  • 126. Criteria API operates on the metamodel
  • 127. JPA 2.0: Criteria API Example #1 // Retrieve all orders whose lineitems is empty. // Using Criteria API CriteriaBuilder qb = em.getEntityManagerFactory().getCriteriaBuilder(); CriteriaQuery<Order> cq = qb.createQuery(Order.class); Root<Order> order = cq.from(Order.class); cq.where(qb.isEmpty(order.get(Order_.lineitems))).select(order); // Using JPQL SELECT o FROM Order o WHERE o.lineItems IS EMPTY
  • 128. JPA 2.0: Criteria API Example #2 // Using Criteria API CriteriaBuilder qb = em.getEntityManagerFactory().getCriteriaBuilder(); CriteriaQuery<Customer> q = qb.createQuery(Customer.class); Root<Customer> customer = q.from(Customer.class); Join<Customer,Order> order = customer.join(Customer_.orders, JoinType.LEFT); q.where(qb.equal(customer.get(Customer_.status), 1)) .select(customer); // Using JPQL SELECT c FROM Customer c LEFT JOIN c.orders o WHERE c.status = 1
  • 129.
  • 130.
  • 132.
  • 133. Demo : Book Entity
  • 135.
  • 136. // web.xml is not needed anymore @WebServlet(urlPatterns=“/foo”, name=”MyServlet”, asyncSupported=true ) public class SimpleSample extends HttpServlet{ public void doGet( HttpServletRequest req, HttpServletResponse res){ // Some code } } Ease of Use: Use of Annotation
  • 137. public class TestServletContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletConext = sce.getServletContext(); // Servlets/Filters can be added during runtime ServletRegistration.Dynamic dynamic = servletContext. addServlet ( &quot;DynamicServlet&quot;, &quot;com.mycom.MyServlet&quot;); dynamic. addMapping (&quot;/dynamicServlet&quot;); dynamic. setAsyncSupported (true); Dynamic Registration of Servlets/Filters
  • 138. Demo: Servlet 3.0 Featuers: Annotation, Dynamic Registration (Available from “ glassfish-samples” project)
  • 139.
  • 140. A framework is provided as a self-contained jar file
  • 141. All you have to do use the framework is to place the self-contained jar file under /WEB-INF/lib directory
  • 142.
  • 143.
  • 144.
  • 145.
  • 146.
  • 147.
  • 148. Pluggability - web-fragment.xml <web-fragment> <servlet> <servlet-name>MyFramework</servlet-name> <servlet-class>com.mycom.MyFrameworkServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>MyFramework</servlet-name> <url-pattern>/MyFramework</url-pattern> </servlet-mapping> ... </web-fragment>
  • 149. Demo: Servlet 3.0 Featuers: Pluggability “ absolute-ordering-web-fragments” (Available from “ glassfish-samples” project)
  • 150.
  • 151. Waiting for Comet events (eg Published message in Comet-based Chat application)
  • 152.
  • 153. Asynch. Servlet: Blocked vs. Asynch. Waiting for Web Services Blocking Asynchronous Thread blocked WS request In parallel
  • 154. import javax.servlet.*; Queue<AsyncContext> usersQueue; BlockingQueue<String> messageQueue; @WebServlet(urlPatterns = {&quot;/chat&quot;}, asyncSupported = true ) public class ChatServlet extends HttpServlet { doGet(...) { AsyncContext ac = req.startAsync(); ac.setTimeout(10 * 60 * 1000); ac.addListener(new AsyncListener() { public void onComplete(AsyncEvent event) { usersQueue.remove(ac); } // deal with more events ... }); usersQueue.add(ac); } ... ChatServlet (1/2)
  • 155. doPost (...) { // also deal with system (login) messages String message = req.getParameter(&quot;message&quot;); messageQueue.put (message); } init (...) { while (true) { String message = messageQueue.take(); for ( AsyncContext ac : usersQueue) { PrintWriter acWriter = ac.getResponse().getWriter(); acWriter.println(message); } } } } ChatServlet (2/2)
  • 156. Demo: Servlet 3.0 Featuers: Comet using Asynch. API (Available from “ glassfish-samples” project)
  • 157. Demo : Add a Servlet
  • 159.
  • 165. EJB Lite EJB 3.1
  • 166.
  • 167. Demo: EJB 3.1: Simplified Packaging
  • 168.
  • 169. EJB 3.1: Asynchronous calls @Stateless public class OrderBean { public void createOrder() { Order order = persistOrder(); sendEmail(order) ; } public Order persistOrder() {...} @Asynchronous public Future<Long> sendEmail(Order order){ ...} }
  • 170. EJB 3.1: Timer Service @Stateless public class WakeUpBean { @Schedule(dayOfWeek=&quot;Mon-Fri&quot;, hour=&quot;9&quot;) void wakeUp() { ... } }
  • 171. Demo : Add an EJB stateless
  • 172.
  • 175.
  • 176. EJB 3.1: Singleton @Singleton public class CachingBean { private Map cache; @PostConstruct void init() { cache = ...; } public Map getCache() { return cache; } public void addToCache(Object key, Object val) { cache.put(key, val); } }
  • 177. Demo : Add a Singleton EJB
  • 178.
  • 179.
  • 181. Just a jar file in your classpath Java SE Transaction manager Security system Messaging engine EJB 3.1 Embedded container
  • 182. EJB 3.1: Embeddable Container ... public static void main(String[] args){ EJBContainer container = EJBContainer.createEJBContainer(); Context context = container.getContext(); Hello h = (Hello) context .lookup(&quot;java:global/classes/HelloEJB&quot;); h .sayHello; container.close(); } ...
  • 183. Demo : EJB Container Test
  • 185.
  • 186.
  • 187.
  • 191.
  • 192.
  • 193.
  • 194.
  • 195.
  • 196. Pages are usable from HTML editors
  • 199. Demo : Add a JSF page
  • 200.
  • 202.
  • 203.
  • 204.
  • 205. Demo : Composite Component
  • 206.
  • 207.
  • 208. Demo : JSF with Ajax
  • 210.
  • 211.
  • 212.
  • 213. Integration with JPA 2.0 & JSF 2.0
  • 214. Bean Validation 1.0: Example public class Address { @NotNull @Size(max=30, message=&quot;longer than {max} characters&quot;) private String street1; ... @NotNull @Valid private Country country; } public class Country { @NotNull @Size(max=30) private String name; ... }
  • 215. Demo : Validation Item/ItemBean
  • 217.
  • 219.
  • 221. JAX-RS 1.1: EJB Support @Path(&quot;/users/{userId}&quot;) @Stateless public class UserResource { @PersistenceContext EntityManage em; @GET @Produces(&quot;text/xml&quot;) public String getUser( @PathParam(&quot;userId&quot; ) String id){ User u = em.find(User.class, id) ... } }
  • 222. Demo : Add REST service to EJB
  • 224.
  • 225. Java EE 6 leverages proven best practice ideas
  • 226.
  • 227.
  • 228. Many demos are from “glassfish-sample” project
  • 229. THANK YOU! Carol McDonald

Hinweis der Redaktion

  1. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  2. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  3. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  4. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  5. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  6. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  7. Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  8. Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  9. Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  10. Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  11. getItems() method wraps a List of items, returned from the CatalogFacade Stateless Session EJB, in a DataModel. dataTable, supports data binding to a collection of data objects represented by a DataModel instance, which is the current value of this component itself. The data collection underlying a DataModel instance is modeled as a collection of row objects that can be accessed by a row index. The APIs provide mechanisms to position to a specified row index, and to retrieve an object that represents the data that corresponds to the current row index.
  12. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  13. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  14. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  15. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  16. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  17. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  18. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  19. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  20. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  21. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  22. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  23. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  24. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  25. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  26. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  27. Based on java.util.concurrent.Future&lt;V&gt; For : Result values System/Application exceptions thrown from target bean Cancelation requests Method signature declares return type as Future&lt;V&gt; e.g. public Future&lt;int&gt; compute(Task t) Method implementation returns javax.ejb.AsyncResult&lt;V&gt; Concrete helper class for passing result value to container javax.ejb.AsyncResult&lt;V&gt; implements Future&lt;V&gt; Constructor takes result value as argument
  28. Goal is to remove an artificial packaging restriction NOT to create a new flavor of EJB component EJB component behavior is independent of packaging One exception : module-level vs. component-level environment Full EJB container functionality available No new restrictions placed on .war Deploy stand-alone OR in an .ear
  29. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  30. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  31. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  32. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  33. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  34. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  35. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  36. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  37. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  38. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  39. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  40. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  41. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  42. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  43. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.
  44. This is a single one-slider on Java EE 5 trying to capture the essence of the improvements from a developer perspective. Ease of development doesn&apos;t mean we remove anything, simply add a level of abstraction, use sensible default, and keep the number for files and artifacts to a minimum. Deployment descriptors are still present if you or your company needs them. JSF is not new (v1.2) but it&apos;s now part of the platform. Every application server from now on has a JSF implementation.