Submit Search
Upload
JAX-RS.next
•
1 like
•
1,480 views
Michal Gajdos
Follow
CZJUG presentation about next version of JAX-RS. (January 2015)
Read less
Read more
Software
Report
Share
Report
Share
1 of 38
Download now
Download to read offline
Recommended
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed Environment
Orkhan Gasimov
UKOUG
UKOUG
Kellyn Pot'Vin-Gorman
Power of the AWR Warehouse
Power of the AWR Warehouse
Kellyn Pot'Vin-Gorman
AWR and ASH in an EM12c World
AWR and ASH in an EM12c World
Kellyn Pot'Vin-Gorman
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Kellyn Pot'Vin-Gorman
Performance in the Oracle Cloud
Performance in the Oracle Cloud
Kellyn Pot'Vin-Gorman
Optimizing the Enterprise Manager 12c
Optimizing the Enterprise Manager 12c
Kellyn Pot'Vin-Gorman
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
Kellyn Pot'Vin-Gorman
Recommended
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed Environment
Orkhan Gasimov
UKOUG
UKOUG
Kellyn Pot'Vin-Gorman
Power of the AWR Warehouse
Power of the AWR Warehouse
Kellyn Pot'Vin-Gorman
AWR and ASH in an EM12c World
AWR and ASH in an EM12c World
Kellyn Pot'Vin-Gorman
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Updated Power of the AWR Warehouse, Dallas, HQ, etc.
Kellyn Pot'Vin-Gorman
Performance in the Oracle Cloud
Performance in the Oracle Cloud
Kellyn Pot'Vin-Gorman
Optimizing the Enterprise Manager 12c
Optimizing the Enterprise Manager 12c
Kellyn Pot'Vin-Gorman
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
Kellyn Pot'Vin-Gorman
Exachk and oem12c
Exachk and oem12c
Bobby Curtis
MySQL Manchester TT - Replication Features
MySQL Manchester TT - Replication Features
Mark Swarbrick
AWR & ASH Analysis
AWR & ASH Analysis
aioughydchapter
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
mnriem
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
Marco Gralike
NoSQL no MySQL 5.7
NoSQL no MySQL 5.7
MySQL Brasil
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
Kris Rice
Openfest15 MySQL Plugin Development
Openfest15 MySQL Plugin Development
Georgi Kodinov
Hackingtomcat
Hackingtomcat
Aung Khant
Oracle Traffic Director - a vital part of your Oracle infrastructure
Oracle Traffic Director - a vital part of your Oracle infrastructure
Simon Haslam
Exachk and oem12c - IOUG C15LV
Exachk and oem12c - IOUG C15LV
Bobby Curtis
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
Revelation Technologies
OpenStack & MySQL
OpenStack & MySQL
MySQL Brasil
OUGLS 2016: How profiling works in MySQL
OUGLS 2016: How profiling works in MySQL
Georgi Kodinov
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data Modeler
Kris Rice
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Sandesh Rao
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
Mark Swarbrick
Boost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIs
Marta Rauch
Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0
Gareth Chapman
MySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt Intro
Mark Swarbrick
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Edward Burns
112815 java ee8_davidd
112815 java ee8_davidd
Takashi Ito
More Related Content
What's hot
Exachk and oem12c
Exachk and oem12c
Bobby Curtis
MySQL Manchester TT - Replication Features
MySQL Manchester TT - Replication Features
Mark Swarbrick
AWR & ASH Analysis
AWR & ASH Analysis
aioughydchapter
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
mnriem
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
Marco Gralike
NoSQL no MySQL 5.7
NoSQL no MySQL 5.7
MySQL Brasil
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
Kris Rice
Openfest15 MySQL Plugin Development
Openfest15 MySQL Plugin Development
Georgi Kodinov
Hackingtomcat
Hackingtomcat
Aung Khant
Oracle Traffic Director - a vital part of your Oracle infrastructure
Oracle Traffic Director - a vital part of your Oracle infrastructure
Simon Haslam
Exachk and oem12c - IOUG C15LV
Exachk and oem12c - IOUG C15LV
Bobby Curtis
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
Revelation Technologies
OpenStack & MySQL
OpenStack & MySQL
MySQL Brasil
OUGLS 2016: How profiling works in MySQL
OUGLS 2016: How profiling works in MySQL
Georgi Kodinov
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data Modeler
Kris Rice
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Sandesh Rao
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
Mark Swarbrick
Boost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIs
Marta Rauch
Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0
Gareth Chapman
MySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt Intro
Mark Swarbrick
What's hot
(20)
Exachk and oem12c
Exachk and oem12c
MySQL Manchester TT - Replication Features
MySQL Manchester TT - Replication Features
AWR & ASH Analysis
AWR & ASH Analysis
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
NoSQL no MySQL 5.7
NoSQL no MySQL 5.7
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
Openfest15 MySQL Plugin Development
Openfest15 MySQL Plugin Development
Hackingtomcat
Hackingtomcat
Oracle Traffic Director - a vital part of your Oracle infrastructure
Oracle Traffic Director - a vital part of your Oracle infrastructure
Exachk and oem12c - IOUG C15LV
Exachk and oem12c - IOUG C15LV
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
Deploying to Oracle SOA Suite 12c - Everything You Need To Know
OpenStack & MySQL
OpenStack & MySQL
OUGLS 2016: How profiling works in MySQL
OUGLS 2016: How profiling works in MySQL
Pimping SQL Developer and Data Modeler
Pimping SQL Developer and Data Modeler
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
MySQL Intro JSON NoSQL
MySQL Intro JSON NoSQL
Boost Your Content Strategy for REST APIs
Boost Your Content Strategy for REST APIs
Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0
MySQL Tech Tour 2015 - Alt Intro
MySQL Tech Tour 2015 - Alt Intro
Similar to JAX-RS.next
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Edward Burns
112815 java ee8_davidd
112815 java ee8_davidd
Takashi Ito
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
Bruno Borges
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
David Delabassee
WebSockets in Enterprise Applications
WebSockets in Enterprise Applications
Pavel Bucek
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
Arun Gupta
JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
Java EE7 in action
Java EE7 in action
Ankara JUG
WebSockets - Realtime em Mundo Conectado
WebSockets - Realtime em Mundo Conectado
Bruno Borges
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
David Delabassee
CON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To You
Edward Burns
REST made simple with Java
REST made simple with Java
Niklas Gustavsson
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
David Delabassee
Progress application server for openedge best practices - PUG Baltic Annual C...
Progress application server for openedge best practices - PUG Baltic Annual C...
Alen Leit
REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)
Jeff Smith
Java Servlets
Java Servlets
BG Java EE Course
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2
WSO2 AppDev platform
WSO2 AppDev platform
Sagara Gunathunga
Java EE7
Java EE7
Jay Lee
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
Masoud Kalali
Similar to JAX-RS.next
(20)
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
112815 java ee8_davidd
112815 java ee8_davidd
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
WebSockets in Enterprise Applications
WebSockets in Enterprise Applications
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013
Java EE7 in action
Java EE7 in action
WebSockets - Realtime em Mundo Conectado
WebSockets - Realtime em Mundo Conectado
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
CON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To You
REST made simple with Java
REST made simple with Java
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Progress application server for openedge best practices - PUG Baltic Annual C...
Progress application server for openedge best practices - PUG Baltic Annual C...
REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)
Java Servlets
Java Servlets
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2 AppDev platform
WSO2 AppDev platform
Java EE7
Java EE7
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
CON 2107- Think Async: Embrace and Get Addicted to the Asynchronicity of EE
Recently uploaded
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
Shrmpro
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
Papp Krisztián
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
masabamasaba
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Delhi Call girls
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
masabamasaba
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
masabamasaba
Define the academic and professional writing..pdf
Define the academic and professional writing..pdf
PearlKirahMaeRagusta1
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
masabamasaba
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
masabamasaba
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
masabamasaba
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
Presentation.STUDIO
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Delhi Call girls
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
proinshot.com
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
OnePlan Solutions
Recently uploaded
(20)
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
Define the academic and professional writing..pdf
Define the academic and professional writing..pdf
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
JAX-RS.next
1.
JAX-‐RS.next Michal Gajdos
michal.gajdos@oracle.com January, 2015 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
2.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The following is intended to outline our general product direcPon. It is intended for informaPon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcPonality, and should not be relied upon in making purchasing decisions. The development, release, and Pming of any features or funcPonality described for Oracle’s products remains at the sole discrePon of Oracle.
3.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. • Generic – Protocol-‐independent – In retrospect, most important Java EE technology • But brought HTTP to Java EE • Old-‐school Programming Model – StaPc, Interface-‐driven – Singleton-‐Scoped – Lot’s of distracPons / boilerplate • Laser-‐focused on REST Services – HTTP Centric • method matching, content negoPaPon, … – Payload format independence • decoupled from business logic • Modern Programming Model – Dynamic, POJO-‐based, AnnotaPon-‐driven – Request-‐Scoped – No distracPons / boilerplate HTTP in Java EE: From Servlet to JAX-‐RS Simplicity, ProducPvity, RESTful Design Servlet JAX-‐RS
4.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. public class MyServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) { if (!acceptsTextPlain(req)) { res.sendError(406); // Not Acceptable return; } if (!isGreetingPath(req)) { res.sendError(404); // Not Found return; } String name = req.getParameter(“name”); if (name == null) { name = “Joe”; } PrintWriter pw = res.getWriter(); pw.print(“Hi “ + name + “!”); pw.flush(); } … // TODO: acceptsTextPlain(…) & isGreetingPath(…) implementations } @Path(“greeting”) public class MyResource { @GET @Produces(“text/plain”) public String greet(@QueryParam(“name”) @DefaultValue(“Joe”) String name) { return “Hi “ + name + “!”; } } HTTP in Java EE: From Servlet to JAX-‐RS Simplicity, ProducPvity, RESTful Design Servlet JAX-‐RS
5.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. EnPty Providers Server API Contexts & InjecPon ExcepPon Mappers CDI Support EnPty Providers Server API Contexts & InjecPon ExcepPon Mappers Zero-‐XML Deployment EvoluPon of JAX-‐RS API EnPty Providers Client API Zero-‐XML Deployment ExcepPon Hierarchy Async Support Common Config CDI Support Server API Contexts & InjecPon ExcepPon Mappers Filters & Interceptors Hypermedia Support JAX-‐RS 1.0 JAX-‐RS 1.1 JAX-‐RS 2.0
6.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. • Performance – ReacPve Programming Model – Java SE 8 Streams – Non-‐blocking I/O • Java EE Alignment – CDI Alignment – DeclaraPve Security Model – MVC 1.0 & JSONB 1.0 IntegraPon • Filling the Gaps – Server-‐Sent Events – Improved Hypermedia Support • ConPnued EvoluPon – All simple problems have already been solved… • Targeted to Ship with Java EE 8 JSR-‐370 – JAX-‐RS.next
7.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Server-‐Sent Events Non-‐Blocking I/O DeclaraPve Security MVC IntegraPon CDI Alignment, JSON-‐B, … 1 2 3 4 5
8.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Server-‐Sent Events • Plain old HTTP • Seamless reconnect & redelivery • HTML 5 standard protocol Ajax Long-‐Polling • Plain old HTTP • Manual reconnect • Undefined format WebSocket • New Protocol (via HTTP upgrade) • Full-‐duplex • HTML 5 standard protocol Ajax Long-‐Polling vs. Server-‐Sent Events vs. WebSocket Time Server Client Time Server Client Time Server Client
9.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Why Server-‐Sent Events? • Streaming asynchronous events from Server to Client • Fits well Ajax Long-‐Polling Use Cases – Progress for long-‐running tasks – Stream of real-‐Pme data updates (e.g. Stock Ticker, Monitoring) – Instant server state change noPficaPons (e.g. SysAdmin Message Push) – Task processing distribuPon – … • Part of HTML5 Standard by W3C – Built-‐in support in all modern browsers – Standard event message format
10.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. : Comment lines start with a ‘:’ prefix : Events can have numeric IDs… id: 1234 : …can contain reconnect delay instructions… retry: 5000 : …can be named… event: text-‐message : …typically contain one or more lines of event payload data. data: Hello, this is a data: multi-‐line message. : Events are separated from each other by a blank line. <blank line> An SSE Event Message
11.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Typical HTTP Request / Response Flow JAX-‐RS Resource invoke() GET /resource HTTP/1.1 HTTP/1.1 200 OK <CR+LF> data data
12.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Asynchronous HTTP Request / Response Flow JAX-‐RS Resource invoke() GET /resource HTTP/1.1 resume(data) HTTP/1.1 200 OK <CR+LF> data
13.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Server-‐Sent Events Flow JAX-‐RS Resource invoke() GET /resource HTTP/1.1 write(event) write(event) … event event … [event] HTTP/1.1 200 OK <CR+LF> [event] close()
14.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Producer API – Server side OutboundEvent – single event; outgoing EventOutput – single client connecPon; outbound SseBroadcaster – connecPon aggregaPon – BroadcasterListener • broadcast noPficaPon Consumer API – Client side InboundEvent – single event; incoming EventInput – streaming connecPon; inbound EventSource – IoC connecPon; inbound – EventListener • asynchronous event processing Jersey Server-‐Sent Events API
15.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. @Path(“messages”) @Produces(APPLICATION_JSON) public class MessageBoardResource { private static SseBroadcaster broadcaster = new SseBroadcaster(); @GET @Path(“stream”) @Produces(SseFeature.SERVER_SENT_EVENTS) public EventOutput connect() { EventOutput eventOutput = new EventOutput(); broadcaster.add(eventOutput); return eventOutput; } … Server-‐side – ConnecPng to an Event Source Create Outbound ConnecPon Store Outbound ConnecPon Return Outbound ConnecPon Create Broadcaster
16.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Server-‐Sent Events Flow JAX-‐RS Resource invoke() GET /resource HTTP/1.1 HTTP/1.1 200 OK <CR+LF> [event] eventOutput
17.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. … @POST @Consumes(MediaType.APPLICATION_JSON) public String postMessage(Message message) { OutboundEvent event = new OutboundEvent.Builder() .id(getNextId()) .mediaType(MediaType.APPLICATION_JSON_TYPE) .data(Message.class, message) .build(); broadcaster.broadcast(event); // invokes eventOutput.write(event); return “Message posted!” } } Server-‐side – Dispatching Events Create Outbound Event Send Outbound Event
18.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Server-‐Sent Events Flow JAX-‐RS Resource invoke() GET /resource HTTP/1.1 HTTP/1.1 200 OK eventOutput write(event) write(event) … event event … close()
19.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. EventSource eventSource = new EventSource(target.path(“messages/stream”)) { @Override public void onEvent(InboundEvent event) { String name = event.getName(); Message message = event.readData(Message.class); display(name, message); } }; … eventSource.close(); Client-‐side Event Processing – IoC Model Create Event Source Close Event Source Implement Event Callback Process Inbound Event
20.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. EventInput events = target.path(“messages/stream”) .request().get(EventInput.class); while (!stop) { InboundEvent event = events.read(); String name = event.getName(); Message message = event.readData(Message.class); display(name, message); } events.close(); Client-‐side Event Processing – Pull Model Retrieve Event Stream Close Event Source Implement Event Loop Process Inbound Event
21.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Server-‐Sent Events Non-‐Blocking I/O DeclaraPve Security MVC IntegraPon CDI Alignment, JSON-‐B, … 1 2 3 4 5
22.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Servlet 3.1 Non-‐Blocking I/O API • Receiving data – ServletInputStream • isReady(), isFinished(), setReadListener(ReadListener) – ReadListener • onDataAvailable(), onError(Throwable), onAllDataRead() • Sending data – ServletOutputStream • isReady(), setWriteListener(WriteListener) – WriteListener • onWritePossible(), onError(Throwable)
23.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Non-‐Blocking I/O API in JAX-‐RS • Main Constraints and Goals – Backward-‐compaPbility – Alignment with Servlet 3.1 Non-‐Blocking I/O API • At least conceptually – Support for standalone JAX-‐RS deployments • no hard dependency on Servlet API • Problems to solve – Unclear impact on request/response processing chain – MulPple extension points to cover (in a backward-‐compaPble way) • Filters, Interceptors, EnPty Providers, ExcepPon Mappers, Parameter Converters • PotenPal interoperability issues in mixed models – e.g. blocking and non-‐blocking request filter in the same processing chain
24.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Server-‐Sent Events Non-‐Blocking I/O DeclaraPve Security MVC IntegraPon CDI Alignment, JSON-‐B, … 1 2 3 4 5
25.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Securing Resources in JAX-‐RS • New Security JSR planned for Java EE 8 – Focused on unificaPon, ease of use and portability improvements – JAX-‐RS EG will monitor progress of this JSR • OAuth 2.0 gaining a lot of adopPon from many big players – Google, Facebook, Twiler, … • Vision for REST Services Security Model in Java EE – Easy and Straighmorward – DeclaraPve whenever possible • Java EE Security AnnotaPons fit JAX-‐RS very well • Jersey already provides annotaPon-‐based authorizaPon
26.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. ExisPng Jersey Security Features • Leveraging standard JAX-‐RS extension points • Off-‐the-‐shelf modules & components ready to use • Client-‐side – HTTP Basic & Digest AuthenPcaPon Support • Server-‐side – DeclaraPve Role-‐base AuthorizaPon (javax.annotation.security) • @RolesAllowed, @PermitAll, @DenyAll • OAuth 1.0, 2.0 Support – Client and Server Side
27.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. @Path(“messages”) @Produces(APPLICATION_JSON) @DenyAll public class MessageBoardResource { … @GET @Path(“stream”) @Produces(SseFeature.SERVER_SENT_EVENTS) @PermitAll public EventOutput connect() { … } @POST @Consumes(MediaType.APPLICATION_JSON) @RolesAllowed(“publisher”) public String postMessage(Message message) { … } } AuthorizaPon in Jersey No access by default Only “publisher” role Public access
28.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Server-‐Sent Events Non-‐Blocking I/O DeclaraPve Security MVC IntegraPon CDI Alignment, JSON-‐B, … 1 2 3 4 5
29.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Different Tastes of MVC Frameworks UI Component-‐Oriented Browser Framework ApplicaPon Controller Renderer Views Models EL EL EL EL AcLon-‐Oriented Browser Framework ApplicaPon Dispatcher Controllers Templates AcPons
30.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. • New, dedicated JSR 371 – MVC 1.0 – Focus on acPon-‐oriented Framework – Leverage exisPng templaPng engines (JSP, Facelets) – Integrate with JAX-‐RS • Model – Context, InjecPon and Bean ValidaPon support – CDI Beans • View – Format content based on Model data – Templates (JSP, Facelets, FreeMarker, Mustache, …) • Controller – Dispatch model data to View templates – JAX-‐RS Resources • NaPve content-‐negoPaPon support MVC Model CDI Beans View Templates Controller JAX-‐RS Resources MVC and JAX-‐RS
31.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. • Jersey extension modules – org.glassfish.jersey.ext • Core Module (jersey-‐mvc) – View Templates • Producing Human-‐Readable Content • Convenient Generators for new Media Types • IntegraPon Modules – TemplaPng Engines • JSP, FreeMarker, Moustache – BeanValidaPon & Error ReporPng • MinimalisPc Public APIs – ProgrammaPc • Viewable – DeclaraPve • @Template • @ErrorTemplate Jersey MVC Support
32.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. @Path(“motorcycle/{name}”) public class MotorcycleResource { @Inject @NotNull Catalog<Motorcycle> catalog; @GET @Produces(TEXT_HTML) @Template(name=“motorcycle.jsp”) public Motorcycle getHtml(@PathParam(“name”) String name) { return catalog.getModel(name); } @Path(“parts”) public PartsListResource getParts(@PathParam(“name”) String name) { return new PartsListResource(catalog, name); } } Jersey MVC Templates Model Controller View Sub-‐controller
33.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. public class PartsListResource { private final String name; private final Catalog catalog; … @POST @Consumes(APPLICATION_JSON) public String addPartJson(Part part) { catalog.getModel(name).addPart(part); return “Part added.”; } @POST @Consumes(APPLICATION_FORM_URLENCODED) @Template(name=“confirmation.jsp”) public String addPartForm(@BeanParam PartFormBean bean) { catalog.getModel(name).addPart(bean.toPart()); return “Part added.”; } } Jersey MVC Templates (contd.) Non-‐browser Clients Browser Clients View Sub-‐Controller
34.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. Program Agenda Server-‐Sent Events Non-‐Blocking I/O DeclaraPve Security MVC IntegraPon CDI Alignment, JSON-‐B, … 1 2 3 4 5
35.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. • API with a Feel Similar to JAXB – Inspired by exisPng popular frameworks • Goals – JSON – RunPme API – Object mapping (Default | Customizable) • Non-‐Goals – JSON Schema Support – Round-‐trip – Tool-‐Pme API JSR-‐367 – Java API for JSON Binding I application/json
36.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. A Road to Java EE Context & Dependency InjecLon JAX-‐RS / CDI Alignment 2006 2007 2008 2009 2010 JSR-‐311 (JAX-‐RS) JSR-‐330 (DI) JSR-‐299 (CDI)
37.
Copyright © 2015,
Oracle and/or its affiliates. All rights reserved. JAX-‐RS / CDI Alignment • Hopeful about CDI 2.0 (JSR-‐365) – Define the behavior of CDI outside of a Java EE container • Also involves introducing a programmaPc bootstrapping API – Make CDI more modular to help other Java EE specs to beler integrate with it • Main Pain Points – Constructor selecPon – Generic producers • @PathParam(“quote”) String quote, @PathParam(“quote”) Quote quote – Bootstrapping & running outside of Java EE – Focus on what’s important (Contexts and InjecPon) • Need to reduce the footprint dramaPcally
38.
Copyright © 2014,
Oracle and/or its affiliates. All rights reserved. Q&A
Download now