SlideShare a Scribd company logo
1 of 29
Download to read offline
The First Contact
with Java EE 7
Questions?
Ask them right away!
New Specifications
• Websockets
• Batch Applications
• Concurrency Utilities
• JSON Processing
Improvements
• Simplified JMS API
• Default Resources
• JAX-RS Client API
• EJB’s External Transactions
• More Annotations
• Entity Graphs
Java EE 7 JSRs
Websockets
• Supports Client and Server
• Declarative and Programmatic
Websockets Chat Server
@ServerEndpoint("/chatWebSocket")
public class ChatWebSocket {
private static final Set<Session> sessions = Collections.synchronizedSet(new HashSet<Session>());
@OnOpen
public void onOpen(Session session) {sessions.add(session);}
@OnMessage
public void onMessage(String message) {
for (Session session : sessions) { session.getAsyncRemote().sendText(message);}
}
@OnClose
public void onClose(Session session) {sessions.remove(session);}
}
Batch Applications
• For long, non-interactive processes
• Either sequential or parallel (partitions)
• Task or Chunk oriented processing
Batch Applications
Batch Applications - job.xml
<job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
<step id="myStep" >
<chunk item-count="3">
<reader ref="myItemReader"/>
<processor ref="myItemProcessor"/>
<writer ref="myItemWriter"/>
</chunk>
</step>
</job>
Concurrency Utilities
• Asynchronous capabilities to the Java EE world
• Java SE Concurrency API extension
• Safe and propagates context
Concurrency Utilities
public class TestServlet extends HttpServlet {
@Resource(name = "concurrent/MyExecutorService")
ManagedExecutorService executor;
Future future = executor.submit(new MyTask());
class MyTask implements Runnable {
public void run() {
// do something
}
}
}
JSON Processing
• Read, generate and transform JSON
• Streaming API and Object Model API
JSON Processing
JsonArray jsonArray = Json.createArrayBuilder()
.add(Json.createObjectBuilder()
.add("name", “Jack"))
.add("age", "30"))
.add(Json.createObjectBuilder()
.add("name", “Mary"))
.add("age", "45"))
.build();
[ {“name”:”Jack”, “age”:”30”},
{“name”:”Mary”, “age”:”45”} ]
JMS
• New interface JMSContext
• Modern API with Dependency Injection
• Resources AutoCloseable
• Simplified how to send messages
JMS
@Resource(lookup = "java:global/jms/demoConnectionFactory")
ConnectionFactory connectionFactory;
@Resource(lookup = "java:global/jms/demoQueue")
Queue demoQueue;
public void sendMessage(String payload) {
try {
Connection connection = connectionFactory.createConnection();
try {
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer = session.createProducer(demoQueue);
TextMessage textMessage = session.createTextMessage(payload);
messageProducer.send(textMessage);
} finally {
connection.close();
}
} catch (JMSException ex) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex);
}
}
JMS
@Inject
private JMSContext context;
@Resource(mappedName = "jms/inboundQueue")
private Queue inboundQueue;
public void sendMessage (String payload) {
context.createProducer()
.setPriority(1)
.setTimeToLive(1000)
.setDeliveryMode(NON_PERSISTENT)
.send(inboundQueue, payload);
}
JAX-RS
• New API to consume REST services
• Asynchronous processing (client and server)
• Filters and Interceptors
JAX-RS
String movie = ClientBuilder.newClient()
.target("http://www.movies.com/movie")
.request(MediaType.TEXT_PLAIN)
.get(String.class);
JPA
• Schema generation
• Stored Procedures
• Entity Graphs
• Unsynchronized Persistence Context
JPA
<persistence-unit name="myPU" transaction-type="JTA">
<properties>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.create-source" value="script"/>
<property name="javax.persistence.schema-generation.drop-source" value="script"/>
<property name="javax.persistence.schema-generation.create-script-source" value="META-INF/
create.sql"/>
<property name="javax.persistence.schema-generation.drop-script-source" value="META-INF/
drop.sql"/>
<property name="javax.persistence.sql-load-script-source" value="META-INF/load.sql"/>
</properties>
</persistence-unit>
JPA
@Entity
@NamedStoredProcedureQuery(name="top10MoviesProcedure",
procedureName = "top10Movies")
public class Movie {}
StoredProcedureQuery query = entityManager.createNamedStoredProcedureQuery(
"top10MoviesProcedure");
query.registerStoredProcedureParameter(1, String.class, ParameterMode.INOUT);
query.setParameter(1, "top10");
query.registerStoredProcedureParameter(2, Integer.class, ParameterMode.IN);
query.setParameter(2, 100);
query.execute();
query.getOutputParameterValue(1);
JSF
• HTML 5 support
• @FlowScoped and @ViewScoped
• File Upload component
• Flow Navigation by Convention
• Resource Library Contracts
Others
• JTA: @Transactional, @TransactionScoped
• Servlet: Non-blocking I/O, Security
• CDI: Automatic for EJB’s and annotated beans (beans.xml
opcional), @Vetoed
• Interceptors: @Priority, @AroundConstruct
• EJB: Passivation opcional
• EL: Lambdas, isolated API
• Bean Validator: Restrictions in parameters and return types
Certified Servers
• Glassfish 4.0
• Wildfly 8.0.0
• TMAX JEUS 8
Java EE 8
• Alignment with Java 8
• JCache
• JSON-B
• MVC
• HTTP 2.0 Support
• Cloud Support
Materials
• Tutorial Java EE 7 - http://docs.oracle.com/javaee/7/
tutorial/doc/home.htm
• Samples Java EE 7 - https://github.com/javaee-
samples/javaee7-samples
• Batch Sample - WoW Auctions - https://github.com/
radcortez/wow-auctions
• WebSocket Sample - Chat Server - https://
github.com/radcortez/cbrjug-websockets-chat
Thank you!

More Related Content

What's hot

Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce Developers
 
Lecture 3: Servlets - Session Management
Lecture 3:  Servlets - Session ManagementLecture 3:  Servlets - Session Management
Lecture 3: Servlets - Session ManagementFahad Golra
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring SessionDavid Gómez García
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsCarol McDonald
 
#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)Ghadeer AlHasan
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actionsAren Zomorodian
 
Rapid API development examples for Impress Application Server / Node.js (jsfw...
Rapid API development examples for Impress Application Server / Node.js (jsfw...Rapid API development examples for Impress Application Server / Node.js (jsfw...
Rapid API development examples for Impress Application Server / Node.js (jsfw...Timur Shemsedinov
 
Java - Servlet - Mazenet Solution
Java - Servlet - Mazenet SolutionJava - Servlet - Mazenet Solution
Java - Servlet - Mazenet SolutionMazenetsolution
 
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R AugeHTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Augemfrancis
 
For each In MULE
For each In MULEFor each In MULE
For each In MULERaj Mevada
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​FDConf
 
Java Microservices with DropWizard
Java Microservices with DropWizardJava Microservices with DropWizard
Java Microservices with DropWizardBruno Buger
 
Java Servlet
Java ServletJava Servlet
Java ServletYoga Raja
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods pptkamal kotecha
 

What's hot (20)

Salesforce1 Platform for programmers
Salesforce1 Platform for programmersSalesforce1 Platform for programmers
Salesforce1 Platform for programmers
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
Spring4 whats up doc?
Spring4 whats up doc?Spring4 whats up doc?
Spring4 whats up doc?
 
Lecture 3: Servlets - Session Management
Lecture 3:  Servlets - Session ManagementLecture 3:  Servlets - Session Management
Lecture 3: Servlets - Session Management
 
Managing user's data with Spring Session
Managing user's data with Spring SessionManaging user's data with Spring Session
Managing user's data with Spring Session
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Simple Jdbc With Spring 2.5
Simple Jdbc With Spring 2.5Simple Jdbc With Spring 2.5
Simple Jdbc With Spring 2.5
 
Rapid API development examples for Impress Application Server / Node.js (jsfw...
Rapid API development examples for Impress Application Server / Node.js (jsfw...Rapid API development examples for Impress Application Server / Node.js (jsfw...
Rapid API development examples for Impress Application Server / Node.js (jsfw...
 
Java - Servlet - Mazenet Solution
Java - Servlet - Mazenet SolutionJava - Servlet - Mazenet Solution
Java - Servlet - Mazenet Solution
 
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R AugeHTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
 
For each In MULE
For each In MULEFor each In MULE
For each In MULE
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​«От экспериментов с инфраструктурой до внедрения в продакшен»​
«От экспериментов с инфраструктурой до внедрения в продакшен»​
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Java Microservices with DropWizard
Java Microservices with DropWizardJava Microservices with DropWizard
Java Microservices with DropWizard
 
Servlets intro
Servlets introServlets intro
Servlets intro
 
Java Servlet
Java ServletJava Servlet
Java Servlet
 
Microservices/dropwizard
Microservices/dropwizardMicroservices/dropwizard
Microservices/dropwizard
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 

Viewers also liked

Java EE 7 meets Java 8
Java EE 7 meets Java 8Java EE 7 meets Java 8
Java EE 7 meets Java 8Roberto Cortez
 
Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8Roberto Cortez
 
Development Horror Stories
Development Horror StoriesDevelopment Horror Stories
Development Horror StoriesRoberto Cortez
 
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java FreelancerGeecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java FreelancerRoberto Cortez
 
Maven - Taming the Beast
Maven - Taming the BeastMaven - Taming the Beast
Maven - Taming the BeastRoberto Cortez
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Roberto Cortez
 
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7Roberto Cortez
 
Java EE 7 Batch processing in the Real World
Java EE 7 Batch processing in the Real WorldJava EE 7 Batch processing in the Real World
Java EE 7 Batch processing in the Real WorldRoberto Cortez
 
The 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy CodeThe 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy CodeRoberto Cortez
 

Viewers also liked (10)

Java EE 7 meets Java 8
Java EE 7 meets Java 8Java EE 7 meets Java 8
Java EE 7 meets Java 8
 
Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8
 
Development Horror Stories
Development Horror StoriesDevelopment Horror Stories
Development Horror Stories
 
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java FreelancerGeecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
 
Maven - Taming the Beast
Maven - Taming the BeastMaven - Taming the Beast
Maven - Taming the Beast
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
 
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
 
Java EE 7 Batch processing in the Real World
Java EE 7 Batch processing in the Real WorldJava EE 7 Batch processing in the Real World
Java EE 7 Batch processing in the Real World
 
Just enough app server
Just enough app serverJust enough app server
Just enough app server
 
The 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy CodeThe 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy Code
 

Similar to The First Contact with Java EE 7

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
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkVijay Nair
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Alex Soto
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsYakov Fain
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajaxs_pradeep
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Request dispacther interface ppt
Request dispacther interface pptRequest dispacther interface ppt
Request dispacther interface pptTaha Malampatti
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New FeaturesShahzad Badar
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Lecture 6 Web Sockets
Lecture 6   Web SocketsLecture 6   Web Sockets
Lecture 6 Web SocketsFahad Golra
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3JavaEE Trainers
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013Jagadish Prasath
 

Similar to The First Contact with Java EE 7 (20)

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
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?
 
JEE.next()
JEE.next()JEE.next()
JEE.next()
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
cq_cxf_integration
cq_cxf_integrationcq_cxf_integration
cq_cxf_integration
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Request dispacther interface ppt
Request dispacther interface pptRequest dispacther interface ppt
Request dispacther interface ppt
 
Servlets
ServletsServlets
Servlets
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New Features
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Lecture 6 Web Sockets
Lecture 6   Web SocketsLecture 6   Web Sockets
Lecture 6 Web Sockets
 
Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013
 

More from Roberto Cortez

Chasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and DocumentationChasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and DocumentationRoberto Cortez
 
Baking a Microservice PI(e)
Baking a Microservice PI(e)Baking a Microservice PI(e)
Baking a Microservice PI(e)Roberto Cortez
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionRoberto Cortez
 
Deconstructing and Evolving REST Security
Deconstructing and Evolving REST SecurityDeconstructing and Evolving REST Security
Deconstructing and Evolving REST SecurityRoberto Cortez
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileRoberto Cortez
 
Cluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCacheCluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCacheRoberto Cortez
 

More from Roberto Cortez (6)

Chasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and DocumentationChasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and Documentation
 
Baking a Microservice PI(e)
Baking a Microservice PI(e)Baking a Microservice PI(e)
Baking a Microservice PI(e)
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices Solution
 
Deconstructing and Evolving REST Security
Deconstructing and Evolving REST SecurityDeconstructing and Evolving REST Security
Deconstructing and Evolving REST Security
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With Microprofile
 
Cluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCacheCluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCache
 

Recently uploaded

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
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 ApplicationsAlberto González Trastoy
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
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 CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
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
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
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
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

The First Contact with Java EE 7

  • 3.
  • 4. New Specifications • Websockets • Batch Applications • Concurrency Utilities • JSON Processing
  • 5. Improvements • Simplified JMS API • Default Resources • JAX-RS Client API • EJB’s External Transactions • More Annotations • Entity Graphs
  • 6. Java EE 7 JSRs
  • 7. Websockets • Supports Client and Server • Declarative and Programmatic
  • 8. Websockets Chat Server @ServerEndpoint("/chatWebSocket") public class ChatWebSocket { private static final Set<Session> sessions = Collections.synchronizedSet(new HashSet<Session>()); @OnOpen public void onOpen(Session session) {sessions.add(session);} @OnMessage public void onMessage(String message) { for (Session session : sessions) { session.getAsyncRemote().sendText(message);} } @OnClose public void onClose(Session session) {sessions.remove(session);} }
  • 9. Batch Applications • For long, non-interactive processes • Either sequential or parallel (partitions) • Task or Chunk oriented processing
  • 11. Batch Applications - job.xml <job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0"> <step id="myStep" > <chunk item-count="3"> <reader ref="myItemReader"/> <processor ref="myItemProcessor"/> <writer ref="myItemWriter"/> </chunk> </step> </job>
  • 12. Concurrency Utilities • Asynchronous capabilities to the Java EE world • Java SE Concurrency API extension • Safe and propagates context
  • 13. Concurrency Utilities public class TestServlet extends HttpServlet { @Resource(name = "concurrent/MyExecutorService") ManagedExecutorService executor; Future future = executor.submit(new MyTask()); class MyTask implements Runnable { public void run() { // do something } } }
  • 14. JSON Processing • Read, generate and transform JSON • Streaming API and Object Model API
  • 15. JSON Processing JsonArray jsonArray = Json.createArrayBuilder() .add(Json.createObjectBuilder() .add("name", “Jack")) .add("age", "30")) .add(Json.createObjectBuilder() .add("name", “Mary")) .add("age", "45")) .build(); [ {“name”:”Jack”, “age”:”30”}, {“name”:”Mary”, “age”:”45”} ]
  • 16. JMS • New interface JMSContext • Modern API with Dependency Injection • Resources AutoCloseable • Simplified how to send messages
  • 17. JMS @Resource(lookup = "java:global/jms/demoConnectionFactory") ConnectionFactory connectionFactory; @Resource(lookup = "java:global/jms/demoQueue") Queue demoQueue; public void sendMessage(String payload) { try { Connection connection = connectionFactory.createConnection(); try { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer messageProducer = session.createProducer(demoQueue); TextMessage textMessage = session.createTextMessage(payload); messageProducer.send(textMessage); } finally { connection.close(); } } catch (JMSException ex) { Logger.getLogger(getClass().getName()).log(Level.SEVERE, null, ex); } }
  • 18. JMS @Inject private JMSContext context; @Resource(mappedName = "jms/inboundQueue") private Queue inboundQueue; public void sendMessage (String payload) { context.createProducer() .setPriority(1) .setTimeToLive(1000) .setDeliveryMode(NON_PERSISTENT) .send(inboundQueue, payload); }
  • 19. JAX-RS • New API to consume REST services • Asynchronous processing (client and server) • Filters and Interceptors
  • 20. JAX-RS String movie = ClientBuilder.newClient() .target("http://www.movies.com/movie") .request(MediaType.TEXT_PLAIN) .get(String.class);
  • 21. JPA • Schema generation • Stored Procedures • Entity Graphs • Unsynchronized Persistence Context
  • 22. JPA <persistence-unit name="myPU" transaction-type="JTA"> <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> <property name="javax.persistence.schema-generation.create-source" value="script"/> <property name="javax.persistence.schema-generation.drop-source" value="script"/> <property name="javax.persistence.schema-generation.create-script-source" value="META-INF/ create.sql"/> <property name="javax.persistence.schema-generation.drop-script-source" value="META-INF/ drop.sql"/> <property name="javax.persistence.sql-load-script-source" value="META-INF/load.sql"/> </properties> </persistence-unit>
  • 23. JPA @Entity @NamedStoredProcedureQuery(name="top10MoviesProcedure", procedureName = "top10Movies") public class Movie {} StoredProcedureQuery query = entityManager.createNamedStoredProcedureQuery( "top10MoviesProcedure"); query.registerStoredProcedureParameter(1, String.class, ParameterMode.INOUT); query.setParameter(1, "top10"); query.registerStoredProcedureParameter(2, Integer.class, ParameterMode.IN); query.setParameter(2, 100); query.execute(); query.getOutputParameterValue(1);
  • 24. JSF • HTML 5 support • @FlowScoped and @ViewScoped • File Upload component • Flow Navigation by Convention • Resource Library Contracts
  • 25. Others • JTA: @Transactional, @TransactionScoped • Servlet: Non-blocking I/O, Security • CDI: Automatic for EJB’s and annotated beans (beans.xml opcional), @Vetoed • Interceptors: @Priority, @AroundConstruct • EJB: Passivation opcional • EL: Lambdas, isolated API • Bean Validator: Restrictions in parameters and return types
  • 26. Certified Servers • Glassfish 4.0 • Wildfly 8.0.0 • TMAX JEUS 8
  • 27. Java EE 8 • Alignment with Java 8 • JCache • JSON-B • MVC • HTTP 2.0 Support • Cloud Support
  • 28. Materials • Tutorial Java EE 7 - http://docs.oracle.com/javaee/7/ tutorial/doc/home.htm • Samples Java EE 7 - https://github.com/javaee- samples/javaee7-samples • Batch Sample - WoW Auctions - https://github.com/ radcortez/wow-auctions • WebSocket Sample - Chat Server - https:// github.com/radcortez/cbrjug-websockets-chat