Marek Potociar
JAX-RS specification lead
Oracle, Cloud Application Foundation
Also does Jersey
What to expect in JAX-RS in Java EE 8.
JAX-RS:
JAX-RS specification lead
Oracle, Cloud Application Foundation
Also does Jersey
- Improvement over servlets for web services.
- Started 2008.
- JAX-RS 2.0 released in Java EE 7
- Performance
- Better integration in container
- Hypermedia improvements
Ajax long polling - not standard but is technique. Manual reconnect.
Server-sent events - standard api and format. Html5 compliant. Seamless reconnect.
Websocket- new http protocol. Decouples request and response.
- Streaming async. Events
- Same infrastructure
- Fits ajax and html5
Async http request / response cycle: Client connects, invokes resource, async response. On invoke, can respond, pass response stream info.
New Outboundevent (uses builder api)
Broadcaster.broadcast(event)
- Servlet 3.1 leveraged.
- Register callback in which you respond to data.
- Must be backward compatible.
- Customer logs in and gets destination suggestions, weather, etc. Orchestrated.
- Can be resource intensive. To solve, get cust details, async get concurrent destinations, weather, etc.
- Hard to read and maintain, callback hell
- Best is Reactive client composing dataflows. E.g Rxjava, java 8, guava.
- JAX-RS has no security. Planned for Java EE 8. Oauth 2 used a lot now.
- Looking for decoupled declarative annotation based. @denyAll at controller level and @rolesAllowed on methods.
- Controversial. Different flavors in mvc
- Separate spec.
- Write mvc in view response. Spring mvc popular, action oriented with templates.
- New framework will build on JAX-RS, probably facelets. @template(name=page.jsp) on resource method.
- Object mapping.
- Still jsr
- Java EE context and injection alignment.
- Will take time, JAX-RS older than CDI.
- Runs outside Java EE container.
- Want to run on small devices.
- CDIi making changes, eg modular, portable.
No comments:
Post a Comment