SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
2º Encontro
13/02/2014
Departamento de Engenharia Informática - Faculdade de Ciências e Tecnologia
Universidade de Coimbra
Objectivos
•

Promover a comunidade de Java na zona Centro
através de eventos periódicos

•

Encorajar a participação de membros

•

Aprender e divertir-se
Contactos
•

Meetup - http://www.meetup.com/Coimbra-JUG/

•

Mailing List - coimbra-jug-list@meetup.com

•

Youtube - http://www.youtube.com/user/coimbrajug
O primeiro contacto
com Java EE 7
Roberto Cortez
Freelancer

twitter:!
@radcortez!
!

mail:!
radcortez@yahoo.com!
!

blog:!
http://www.radcortez.com
Questões?
Assim que tiverem!
Novas Especificações
•

Websockets

•

Batch Applications

•

Concurrency Utilities

•

JSON Processing
Melhorias
•

Simplificação API JMS

•

Default Resources

•

JAX-RS Client API

•

Transacções externas a EJB’s

•

Mais Anotações

•

Entity Graphs
Java EE 7 JSRs
Websockets

•

Suporta cliente e servidor

•

Declarativo e Programático
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
•

Ideal para processos massivos, longos e nãointeractivos

•

Execução sequencial ou paralela

•

Processamento orientado à tarefa ou em secções.
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
•

Capacidades assíncronas para componentes Java
EE

•

Extensão da API de Java SE Concurrency

•

API segura e propaga contexto.
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

•

API para ler, gerar e transformar JSON

•

Streaming API e 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
•

Nova interface JMSContext

•

Modernização da API utilizando DI

•

AutoCloseable dos recursos

•

Simplificação no envio de mensagens
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
•

Nova API para consumir serviços REST

•

Processamento assíncrono (cliente e servidor)

•

Filtros e Interceptors
JAX-RS
String movie = ClientBuilder.newClient()!
.target("http://www.movies.com/movie")!
.request(MediaType.TEXT_PLAIN)!
.get(String.class);
JPA
•

Geração do schema da BD

•

Stored Procedures

•

Entity Graphs

•

Unsynchronized Persistence Context
JPA
<persistence-unit name="myPU" transaction-type="JTA">!
<properties>!
<property name="javax.persistence.schemageneration.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-scriptsource" value="META-INF/create.sql"/>!
<property name="javax.persistence.schema-generation.drop-scriptsource" 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
•

Suporte HTML 5

•

@FlowScoped e @ViewScoped

•

Componente para File Upload

•

Navegação de flow por convenção

•

Resource Library Contracts
Outros
•

JTA: @Transactional, @TransactionScoped

•

Servlet: Non-blocking I/O, Segurança

•

CDI: Automáticos para EJB’s e beans anotados (beans.xml
opcional), @Vetoed

•

Interceptors: @Priority, @AroundConstruct

•

EJB: Passivation opcional

•

EL: Lambdas, API isolada

•

Bean Validator: Restrições nos parâmetros dos métodos e retornos
Servidores Certificados
•

Glassfish 4.0

•

Wildfly 8.0.0

•

TMAX JEUS 8
Futuro Java EE 8
•

JCache

•

Logging

•

JSON-B

•

Security

•

Testability

•

Cloud?

•

Modularity?

•

NoSQL?
Materiais
•

Tutorial Java EE 7 - http://docs.oracle.com/javaee/
7/tutorial/doc/home.htm

•

Exemplos Java EE 7 - https://github.com/javaeesamples/javaee7-samples
Obrigado!

Weitere ähnliche Inhalte

Andere mochten auch

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
Roberto Cortez
 
Nueva web educa inflamatoria
Nueva web educa inflamatoriaNueva web educa inflamatoria
Nueva web educa inflamatoria
hinova200
 

Andere mochten auch (20)

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
 
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
 
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
 
The First Contact with Java EE 7
The First Contact with Java EE 7The First Contact with Java EE 7
The First Contact with Java EE 7
 
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
 
Oportunidades de internet y redes sociales para profesionales
Oportunidades de internet y redes sociales para profesionalesOportunidades de internet y redes sociales para profesionales
Oportunidades de internet y redes sociales para profesionales
 
El peru y la sostenibilidad
El peru y la sostenibilidadEl peru y la sostenibilidad
El peru y la sostenibilidad
 
Trabjo de fisio pa
Trabjo de fisio paTrabjo de fisio pa
Trabjo de fisio pa
 
Nueva web educa inflamatoria
Nueva web educa inflamatoriaNueva web educa inflamatoria
Nueva web educa inflamatoria
 
BOPV Parlamento Vasco manifiesta su solidaridad con Pavlo Ibar
BOPV Parlamento Vasco manifiesta su solidaridad con Pavlo IbarBOPV Parlamento Vasco manifiesta su solidaridad con Pavlo Ibar
BOPV Parlamento Vasco manifiesta su solidaridad con Pavlo Ibar
 
Member Services Update, by Vivek Nigam [APNIC 38]
Member Services Update, by Vivek Nigam [APNIC 38]Member Services Update, by Vivek Nigam [APNIC 38]
Member Services Update, by Vivek Nigam [APNIC 38]
 
Dios te Dice
Dios te DiceDios te Dice
Dios te Dice
 
OpenTerms Syntax Issue 02
OpenTerms Syntax Issue 02OpenTerms Syntax Issue 02
OpenTerms Syntax Issue 02
 
3
33
3
 
Christmas 2013
Christmas 2013Christmas 2013
Christmas 2013
 
Biografía de Andrés Barrero Rodríguez
Biografía de Andrés Barrero RodríguezBiografía de Andrés Barrero Rodríguez
Biografía de Andrés Barrero Rodríguez
 
Pirelli F1 Shop: from Social Community to Social Commerce
Pirelli F1 Shop: from Social Community to Social CommercePirelli F1 Shop: from Social Community to Social Commerce
Pirelli F1 Shop: from Social Community to Social Commerce
 
2010 Presentacion Adaptamos Larga Con Fotos
2010 Presentacion Adaptamos Larga Con Fotos2010 Presentacion Adaptamos Larga Con Fotos
2010 Presentacion Adaptamos Larga Con Fotos
 
Sistema de crm de codigo abierto sugarcrm
Sistema de crm de codigo abierto sugarcrm Sistema de crm de codigo abierto sugarcrm
Sistema de crm de codigo abierto sugarcrm
 

Ähnlich wie Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7

AngularJS - a radically different way of building Single Page Apps
AngularJS - a radically different way of building Single Page AppsAngularJS - a radically different way of building Single Page Apps
AngularJS - a radically different way of building Single Page Apps
jivkopetiov
 
Mongo db washington dc 2014
Mongo db washington dc 2014Mongo db washington dc 2014
Mongo db washington dc 2014
ikanow
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
Ran Mizrahi
 

Ähnlich wie Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7 (20)

AngularJS - a radically different way of building Single Page Apps
AngularJS - a radically different way of building Single Page AppsAngularJS - a radically different way of building Single Page Apps
AngularJS - a radically different way of building Single Page Apps
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
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?
 
Mongo db washington dc 2014
Mongo db washington dc 2014Mongo db washington dc 2014
Mongo db washington dc 2014
 
Pushing the Boundaries of Sencha and HTML5′s WebRTC
Pushing the Boundaries of Sencha and HTML5′s WebRTCPushing the Boundaries of Sencha and HTML5′s WebRTC
Pushing the Boundaries of Sencha and HTML5′s WebRTC
 
Ria with dojo
Ria with dojoRia with dojo
Ria with dojo
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins Cambridge
 
Gwt.Create Keynote San Francisco
Gwt.Create Keynote San FranciscoGwt.Create Keynote San Francisco
Gwt.Create Keynote San Francisco
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Gwtcreatekeynote
GwtcreatekeynoteGwtcreatekeynote
Gwtcreatekeynote
 
API-Entwicklung bei XING
API-Entwicklung bei XINGAPI-Entwicklung bei XING
API-Entwicklung bei XING
 
Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)Intro to node.js - Ran Mizrahi (27/8/2014)
Intro to node.js - Ran Mizrahi (27/8/2014)
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with Javascript
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx France 2016
 
Real time event dashboards
Real time event dashboardsReal time event dashboards
Real time event dashboards
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
 
Evolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.jsEvolution of a cloud start up: From C# to Node.js
Evolution of a cloud start up: From C# to Node.js
 
FIFA fails, Guy Kawasaki and real estate in SF - find out about all three by ...
FIFA fails, Guy Kawasaki and real estate in SF - find out about all three by ...FIFA fails, Guy Kawasaki and real estate in SF - find out about all three by ...
FIFA fails, Guy Kawasaki and real estate in SF - find out about all three by ...
 

Mehr von Roberto Cortez

Mehr von 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
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7