SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
Project Avatar:
Server Side JavaScript on the JVM
Lyon JUG - March 2014
!
David Delabassee
@delabassee
Software Evangelist - Oracle
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!2
The following is intended to outline our general product direction.
It is intended for information purposes only, and may not be
incorporated into any contract. It is not a commitment to deliver
any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and
timing of any features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Agenda
▪ Web Application Architecture Evolution
▪ JavaScript and Node on the JVM
▪ Project Avatar – Advanced JavaScript Services
▪ Avatar Client Framework
▪ Summary
!3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Evolution of Web Application Architecture
!4
A Java EE Perspective
Http, REST
REST, SSE, WebSockets
Presentation
!
(Servlet/JSP,

JSF)
Connectivity


(WebSocket,

REST,SSE)
EnterpriseConnectivity

andBusinessLogic
Java EE / JVM
▪ Single-page applications
▪ View/Controller in browser
▪ Model on server
View
Controller
JavaScript
Browser
ClientServer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Java EE – The Latest in Enterprise Java
!5
ENTERPRISE
EDITIONDEVELOPER
PRODUCTIVITY
MEETING 

ENTERPRISE
DEMANDS
Java EE 7
▪ Batch
▪ Concurrency
▪ Simplified JMS
▪ More annotated POJOs
▪ Less boilerplate code
▪ Cohesive integrated 

platform
▪ WebSockets
▪ JSON
▪ Servlet 3.1 NIO
▪ REST
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Node.js
▪ Server-side JavaScript based on Chrome v8 engine
▪ Created by Ryan Dahl (2009), Open Source
▪ Designed for fast, scalable network applications
▪ Event-driven, non-blocking I/O model
▪ “Melting pot community”
▪ JavaScript, Java, .NET, PHP, …
▪ Very active, with 60,000+ modules
!6
Server Side JavaScript
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Node.js Programming Model
▪ Multi-threading is hard
▪ Thousands of concurrent connections
▪ Deal with deadlocks and race conditions
▪ Blocking I/O is bad
!7
▪ Single threaded
▪ Event-loop
▪ Callback model
▪ Non-blocking I/O calls
▪ Heavily parallelized
HTTP Callback Example:
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Node.js Event Loop
!8
Single-Threaded

Event Loop
Resource-Intensive
Operations
Network
File System
Network
Compute
Register Callback
CompleteOperation
Client
Requests
(Http)
Response
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!9
REST/SSE/WebSockets
JavaScript
View
Controller
JavaScript
Browser
ClientServer
Node
Evolution of Web Application Architecture
▪ Project-based end-to-end JavaScript
▪ Rapid prototyping & API layer
▪ Leverage backend resources
▪ Aggregate & transform content
▪ Return JSON to browser
Mobile-enabling existing services
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!10
Evolution of Web Application Architecture
Mobile-enabling existing services
ClientServer
EnterpriseConnectivity

andBusinessLogic
Java EE / JVM
JavaScript
What if we could run Node

alongside Java EE in

the same JVM?
View
Controller
JavaScript
Browser
REST / SSE/ WebSockets
Node
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!11
JavaScript and
Node on the JVM
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Project Nashorn
▪ ECMAScript 5.1 compliant
▪ Bundled with JDK 8
▪ Replaces Rhino
▪ Faster (2x – 10x)
▪ More secure
▪ Java <-> JavaScript interoperability
!12
JavaScript on the JVM
http://download.java.net/jdk8/docs/technotes/guides/scripting/nashorn/index.html
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar.js
▪ Platform for server side JavaScript applications
▪ Requires Nashorn (JDK 8)
▪ 95% Node compatibility
▪ Use popular packages (Express, async, commander, etc)
▪ Uses same portability libraries as Node.js
▪ Limitation: No Chrome v8 native APIs
▪ Avatar.js Advantages
▪ Leverage JVM
▪ e.g. Java frameworks, libraries, tools…
!13
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar.js = Node + Java
!14
Leverage Java, including Threads
Java
JavaScript
java.lang.Thread
java.util.SortedSet
java.math.BigInteger
Node App
JVM Process
com.myorg.MyObj
require (‘async’)
postEvent() ▪ Node Programming Model
▪ Code in JavaScript
▪ Single event loop / thread
▪ Require (import) Node modules
▪ Invoke Java code
▪ Java types and libraries
▪ new java.lang.Thread();
▪ new com.myorg.MyObj();
▪ …
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!15
Project Avatar:

Advanced JavaScript Services



Leveraging Java EE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Project Avatar
▪ Similar in spirit to Servlets, but focused on REST, WebSocket,
Server Sent Event (SSE) endpoints
▪ Use familiar Node.js event-driven programming model and modules
▪ Layers on Avatar.js Node-compatible runtime
▪ Adds integrated enterprise features
!16
A Server Side JavaScript Services Framework
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Project Avatar
▪ Multi-threading, lightweight message passing, no mutable
shared state
▪ HTTP listener / load-balancer managed by framework
▪ Model Store – Object Relational Mapping
▪ Messaging – JMS on Java EE container
!17
Leveraging the JVM and Java EE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar Architecture
!18
Server side
Server Database
Data
Notification
JDK 8 / Nashorn
Avatar Runtime
Node Modules
Avatar Modules
Server Runtime (Java EE)
Application
Services
= Java framework
= JavaScript framework
= Application code
Avatar.js
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar Services
!19
Multi-core, state sharing, data storage
Java
JVM Process
JavaScript
Services Services ServicesServices
Database
Data
Notification
shared state
JSON JSON JSON JSON
HTTP Load Balancer
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Shared State
▪ MessageBus
▪ Publish/subscribe message passing
▪ Shared State
▪ Simple map API
▪ Application-scoped instance
▪ Session-scoped instance
▪ Named
▪ Leased, with configurable timeout
▪ Provide required serialization, concurrency, and caching
!20
Lightweight inter-thread communication
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Shared State Example
!21
var avatar = require(‘org/glassfish/avatar’);!
var threads = require(‘org/glassfish/avatar/threads’);!
var app = avatar.application;!
var name = app.name;!
var bus = app.bus;!
!
// Listen for messages on the ‘alert’ topic!
bus.on(‘alert’, function(msg) {!
print(name + ‘ got ‘ + msg); !
});!
!
// Start a background thread which publishes to the ‘alert’ topic!
// Background threads do not participate in request processing!
threads.newBackgroundThread(‘background’, ‘monitor.js’).start();!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Push Service Example
!22
var avatar = require(‘org/glassfish/avatar’);!
var threads = require('org/glassfish/avatar/threads');!
var bus = avatar.application.bus;!
!
// Register a push service that forwards background messages!
avatar.registerPushService({url: 'push/message'}, function () { !
this.onOpen = function (context) {!
bus.on(’background', function(msg) {!
context.sendMessage({body: msg});!
});!
};!
});!
!
// Create and start a background thread that publishes messages!
threads.newBackgroundThread(‘background’, ‘monitor.js’).start();!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
WebSocket Service Example
!23
// Load avatar module!
var avatar = require(‘org/glassfish/avatar’); !!
// Register service instance!
avatar.registerSocketService({ url:‘websocket/chat’ },function() { !
this.data = { transcript : ‘’ };!

this.onMessage = function (peer, message) {

this.data.transcript += message;

this.data.transcript += ‘n’;

peer.getContext().sendAll(this.data);!
};!
});!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store Framework
▪ JavaScript ORM library
▪ Pure JavaScript API that
▪ Supports relational and non-relational databases
▪ Integration with other Avatar services
▪ Similar to pure Node.js libraries
▪ Sequelize, JugglingDB, db…
!24
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store API
!25
Model and Database setup
var Product = avatar.newModel({!
"name": {!
type: "string",!
primary: true!
},!
"price": "number",!
"quantity": "integer"!
});!
var store = avatar.newStore(‘mysql’, {!
host: ‘localhost’,!
port: 3306,!
database: ‘test’,!
username: ‘someUser’,!
password: ‘gu3ssIt’,!
createDb: true,!
dropTables: true!
});!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store Example
!26
Creating and Storing an Object
// Binds Product model with store!
Product.bind(store);
!
// Insert a new product into the db!
store.connect(function() {
Product.create({
name: 'Widget',!
price: 1.00,
quantity: 2
}, function(err, w1) {
console.log(JSON.stringify(w1));
store.disconnect(function() {
// Done!
});
});
});
▪ Bind Model to Store
!
▪ Connect to Store
▪ Creates Product table if required
▪ Callback adds product to table
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store Example
!27
Relationships
var Family = avatarModel.newModel('family',{!
"name": {!
type: "string",!
primary: true!
},!
"description": "string"!
});!
!
var Product = avatarModel.newModel('product',{!
"name": {!
type: "string",!
primary: true!
},!
"madeBy": "string",!
"price": "number",!
"quantity": "integer"!
});!
!
Family.hasMany(Product, {!
as: 'products',!
foreign: 'family'!
});!
!
store.bind(Family, Product);
…!
// for a given ‘f’!
f.products.create(o).then(function(p) {!
// Creating prod. (p.name) !
// in family (f.name)!
…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store API
▪ Models can have relationships with other models
▪ 1:1, 1:n, M,N
▪ Relational Data Stores
▪ Tested: Oracle DB, MySQL, Derby (Embedded, Network)
▪ Non-tested: Any other JDBC driver
▪ Non-relational Data Stores
▪ Oracle NoSQL, MongoDB (in progress)
!28
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Model-Store API
▪ Lots of possibilities and ideas
▪ Configure JPA provider using properties
▪ Generate JavaScript model from database schema
▪ User transactions
▪ 2nd level JPA cache, TopLink Grid
▪ Oracle RAC Support, …
▪ Maintain pure JavaScript API
▪ We’re looking for YOUR feedback!
!29
Opportunities to leverage JPA
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!30
Avatar Client Framework
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar Client Model
▪ View
▪ Extensible component views
▪ Pre-defined Widget Sets: jQuery UI (default), jQuery Mobile, Dijit
▪ Declarative UI components
▪ Model
▪ Models (WS, SSE, REST, local) in JavaScript
▪ Easily connects to Java and JavaScript services
▪ Model library usable as standalone JavaScript file
▪ Misc.
▪ Familiar syntax in HTML with “data-” tags
▪ Bidirectional Data binding using EL (Expression Language)
▪ CSS support
▪ AMD modules for code partitioning
!31
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Avatar Architecture - Server and Client
!32
Server
Client
REST/WebSocket/SSE
*.html
*.css
*.js
HTP
Database
Data
Notification
JDK 8 / Nashorn
Avatar Compiler
Avatar Runtime
Node Modules
Avatar Modules
Server Runtime (Java EE)
Application
Services
Application Views
= Java framework
= JavaScript framework
= Application code
Avatar.js
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Hello World
!33
<script data-model=”local” data-instance="name">!
       var NameModel = function() {!
             this.first = "John";!
             this.last = "Doe";!
             this.clear = function() { this.first = this.last = "”; }; !
};!
</script>!
View
<form>!
<label for="first">First Name</label>!
<input id="first" type="text” data-value="#{name.first}"/>!
<label for=“last">Last Name</label>!
<input id=“last" type="text” data-value="#{name.last}"/>!
Hello #{name.first} #{name.last}!
<button onclick="#{name.clear()}”>Clear</button>!
</form>!
Model
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Chat WebSocket Example
!34
<script data-model="socket">!
var ChatModel = function() {!
…!
this.sendMsg = function() {!
this.send(this.user + ":" + this.message);!
this.message = "";!
};!
};!
</script>!
!
<script data-type="ChatModel" data-instance="chat”!
data-url=“websocket/chat”>!
</script>!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!35
Project Avatar
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Summary
!36
Server-side JavaScript on the JVM
▪ Leverage the JVM
▪ Multi-threading optimizations
▪ Share state across threads, JVMs
▪ Built-in load balancing across threads
▪ Leverage Java EE services
▪ Deploy on existing Java EE infrastructure
▪ Leverage AppServer features (clustering, lifecycle management)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Status
!37
▪ Launched JavaOne 2013
▪ GlassFish 4.0 Open Source Edition
▪ Open Source
▪ 2014
▪ Add WebLogic runtime
▪ 2015
▪ Commercial support?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Next steps
!38
1) Download
https://avatar.java.net/
2) Try it out
!
3) Give us feedback
https://avatar.java.net/mailing.html
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Merci!
!39
Project Avatar
https://avatar.java.net/
!
Java EE 8 Survey
http://glassfish.org/survey
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12!40
Graphic Section Divider

Más contenido relacionado

La actualidad más candente

Monitoring and Troubleshooting Tools in Java 9
Monitoring and Troubleshooting Tools in Java 9Monitoring and Troubleshooting Tools in Java 9
Monitoring and Troubleshooting Tools in Java 9Poonam Bajaj Parhar
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsPoonam Bajaj Parhar
 
Get Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messagesGet Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messagesPoonam Bajaj Parhar
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Simon Ritter
 
Node.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankNode.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankCarsten Czarski
 
Visualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with RVisualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with RPoonam Bajaj Parhar
 
JSR107 State of the Union JavaOne 2013
JSR107  State of the Union JavaOne 2013JSR107  State of the Union JavaOne 2013
JSR107 State of the Union JavaOne 2013Hazelcast
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9Simon Ritter
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Simon Ritter
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the CloudDmitry Kornilov
 
Compile ahead of time. It's fine?
Compile ahead of time. It's fine?Compile ahead of time. It's fine?
Compile ahead of time. It's fine?Dmitry Chuyko
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerSimon Ritter
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesikmfrancis
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reza Rahman
 

La actualidad más candente (20)

Troubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VMTroubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VM
 
Monitoring and Troubleshooting Tools in Java 9
Monitoring and Troubleshooting Tools in Java 9Monitoring and Troubleshooting Tools in Java 9
Monitoring and Troubleshooting Tools in Java 9
 
Troubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java ApplicationsTroubleshooting Memory Problems in Java Applications
Troubleshooting Memory Problems in Java Applications
 
Get Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messagesGet Rid Of OutOfMemoryError messages
Get Rid Of OutOfMemoryError messages
 
Troubleshooting Tools In JDK
Troubleshooting Tools In JDKTroubleshooting Tools In JDK
Troubleshooting Tools In JDK
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
 
Node.js und die Oracle-Datenbank
Node.js und die Oracle-DatenbankNode.js und die Oracle-Datenbank
Node.js und die Oracle-Datenbank
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
 
Visualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with RVisualizing and Analyzing GC Logs with R
Visualizing and Analyzing GC Logs with R
 
JSR107 State of the Union JavaOne 2013
JSR107  State of the Union JavaOne 2013JSR107  State of the Union JavaOne 2013
JSR107 State of the Union JavaOne 2013
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
55 New Features in JDK 9
55 New Features in JDK 955 New Features in JDK 9
55 New Features in JDK 9
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?Is An Agile Standard Possible For Java?
Is An Agile Standard Possible For Java?
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the Cloud
 
Compile ahead of time. It's fine?
Compile ahead of time. It's fine?Compile ahead of time. It's fine?
Compile ahead of time. It's fine?
 
Hotspot & AOT
Hotspot & AOTHotspot & AOT
Hotspot & AOT
 
JDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java SmallerJDK 9: Big Changes To Make Java Smaller
JDK 9: Big Changes To Make Java Smaller
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 
Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!Reactive Java EE - Let Me Count the Ways!
Reactive Java EE - Let Me Count the Ways!
 

Similar a Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!

Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014David Delabassee
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeJAXLondon2014
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsPavel Bucek
 
10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScriptGeertjan Wielenga
 
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)David Delabassee
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Bruno Borges
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouDavid Delabassee
 
Surviving Life in the JavaScript Ecosystem
Surviving Life in the JavaScript EcosystemSurviving Life in the JavaScript Ecosystem
Surviving Life in the JavaScript EcosystemGeertjan Wielenga
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8jclingan
 
Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Bruno Borges
 
Oracle JET: Enterprise-Ready JavaScript Toolkit
Oracle JET: Enterprise-Ready JavaScript ToolkitOracle JET: Enterprise-Ready JavaScript Toolkit
Oracle JET: Enterprise-Ready JavaScript ToolkitGeertjan Wielenga
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudBruno Borges
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
 

Similar a Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur! (20)

Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
Server Side JavaScript on the JVM - Project Avatar - QCon London March 2014
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David DelabasseeServer Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
 
WebSockets in Enterprise Applications
WebSockets in Enterprise ApplicationsWebSockets in Enterprise Applications
WebSockets in Enterprise Applications
 
Imworld.ro
Imworld.roImworld.ro
Imworld.ro
 
10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript
 
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
 
Slovenian Oracle User Group
Slovenian Oracle User GroupSlovenian Oracle User Group
Slovenian Oracle User Group
 
JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...
JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...
JavaCro'15 - Everything a Java EE Developer needs to know about the JavaScrip...
 
Session at Oredev 2016.
Session at Oredev 2016.Session at Oredev 2016.
Session at Oredev 2016.
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško VukmanovićJavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
JavaCro'14 - WebLogic-GlassFish-JaaS Strategy and Roadmap – Duško Vukmanović
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
 
Surviving Life in the JavaScript Ecosystem
Surviving Life in the JavaScript EcosystemSurviving Life in the JavaScript Ecosystem
Surviving Life in the JavaScript Ecosystem
 
Java 8
Java 8Java 8
Java 8
 
What's new in Java 8
What's new in Java 8What's new in Java 8
What's new in Java 8
 
Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?Servidores de Aplicação: por que ainda precisamos deles?
Servidores de Aplicação: por que ainda precisamos deles?
 
Oracle JET overview
Oracle JET overviewOracle JET overview
Oracle JET overview
 
Oracle JET: Enterprise-Ready JavaScript Toolkit
Oracle JET: Enterprise-Ready JavaScript ToolkitOracle JET: Enterprise-Ready JavaScript Toolkit
Oracle JET: Enterprise-Ready JavaScript Toolkit
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 

Más de David Delabassee

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best PracticesDavid Delabassee
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsDavid Delabassee
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffDavid Delabassee
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016David Delabassee
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progressDavid Delabassee
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)David Delabassee
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontDavid Delabassee
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8David Delabassee
 
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.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0David Delabassee
 

Más de David Delabassee (20)

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed Banff
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
 
REST in an Async World
REST in an Async WorldREST in an Async World
REST in an Async World
 
JAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 Reloaded
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
 
HTTP/2 comes to Java
HTTP/2 comes to JavaHTTP/2 comes to Java
HTTP/2 comes to Java
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progress
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8
 
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.0Java 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
 

Último

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Último (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

Java EE 7 et ensuite pourquoi pas JavaScript sur le serveur!

  • 1. Project Avatar: Server Side JavaScript on the JVM Lyon JUG - March 2014 ! David Delabassee @delabassee Software Evangelist - Oracle
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!2 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Agenda ▪ Web Application Architecture Evolution ▪ JavaScript and Node on the JVM ▪ Project Avatar – Advanced JavaScript Services ▪ Avatar Client Framework ▪ Summary !3
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Evolution of Web Application Architecture !4 A Java EE Perspective Http, REST REST, SSE, WebSockets Presentation ! (Servlet/JSP,
 JSF) Connectivity 
 (WebSocket,
 REST,SSE) EnterpriseConnectivity
 andBusinessLogic Java EE / JVM ▪ Single-page applications ▪ View/Controller in browser ▪ Model on server View Controller JavaScript Browser ClientServer
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Java EE – The Latest in Enterprise Java !5 ENTERPRISE EDITIONDEVELOPER PRODUCTIVITY MEETING 
 ENTERPRISE DEMANDS Java EE 7 ▪ Batch ▪ Concurrency ▪ Simplified JMS ▪ More annotated POJOs ▪ Less boilerplate code ▪ Cohesive integrated 
 platform ▪ WebSockets ▪ JSON ▪ Servlet 3.1 NIO ▪ REST
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Node.js ▪ Server-side JavaScript based on Chrome v8 engine ▪ Created by Ryan Dahl (2009), Open Source ▪ Designed for fast, scalable network applications ▪ Event-driven, non-blocking I/O model ▪ “Melting pot community” ▪ JavaScript, Java, .NET, PHP, … ▪ Very active, with 60,000+ modules !6 Server Side JavaScript
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Node.js Programming Model ▪ Multi-threading is hard ▪ Thousands of concurrent connections ▪ Deal with deadlocks and race conditions ▪ Blocking I/O is bad !7 ▪ Single threaded ▪ Event-loop ▪ Callback model ▪ Non-blocking I/O calls ▪ Heavily parallelized HTTP Callback Example:
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Node.js Event Loop !8 Single-Threaded
 Event Loop Resource-Intensive Operations Network File System Network Compute Register Callback CompleteOperation Client Requests (Http) Response
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!9 REST/SSE/WebSockets JavaScript View Controller JavaScript Browser ClientServer Node Evolution of Web Application Architecture ▪ Project-based end-to-end JavaScript ▪ Rapid prototyping & API layer ▪ Leverage backend resources ▪ Aggregate & transform content ▪ Return JSON to browser Mobile-enabling existing services
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!10 Evolution of Web Application Architecture Mobile-enabling existing services ClientServer EnterpriseConnectivity
 andBusinessLogic Java EE / JVM JavaScript What if we could run Node
 alongside Java EE in
 the same JVM? View Controller JavaScript Browser REST / SSE/ WebSockets Node
  • 11. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!11 JavaScript and Node on the JVM
  • 12. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Project Nashorn ▪ ECMAScript 5.1 compliant ▪ Bundled with JDK 8 ▪ Replaces Rhino ▪ Faster (2x – 10x) ▪ More secure ▪ Java <-> JavaScript interoperability !12 JavaScript on the JVM http://download.java.net/jdk8/docs/technotes/guides/scripting/nashorn/index.html
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar.js ▪ Platform for server side JavaScript applications ▪ Requires Nashorn (JDK 8) ▪ 95% Node compatibility ▪ Use popular packages (Express, async, commander, etc) ▪ Uses same portability libraries as Node.js ▪ Limitation: No Chrome v8 native APIs ▪ Avatar.js Advantages ▪ Leverage JVM ▪ e.g. Java frameworks, libraries, tools… !13
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar.js = Node + Java !14 Leverage Java, including Threads Java JavaScript java.lang.Thread java.util.SortedSet java.math.BigInteger Node App JVM Process com.myorg.MyObj require (‘async’) postEvent() ▪ Node Programming Model ▪ Code in JavaScript ▪ Single event loop / thread ▪ Require (import) Node modules ▪ Invoke Java code ▪ Java types and libraries ▪ new java.lang.Thread(); ▪ new com.myorg.MyObj(); ▪ …
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!15 Project Avatar:
 Advanced JavaScript Services
 
 Leveraging Java EE
  • 16. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Project Avatar ▪ Similar in spirit to Servlets, but focused on REST, WebSocket, Server Sent Event (SSE) endpoints ▪ Use familiar Node.js event-driven programming model and modules ▪ Layers on Avatar.js Node-compatible runtime ▪ Adds integrated enterprise features !16 A Server Side JavaScript Services Framework
  • 17. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Project Avatar ▪ Multi-threading, lightweight message passing, no mutable shared state ▪ HTTP listener / load-balancer managed by framework ▪ Model Store – Object Relational Mapping ▪ Messaging – JMS on Java EE container !17 Leveraging the JVM and Java EE
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar Architecture !18 Server side Server Database Data Notification JDK 8 / Nashorn Avatar Runtime Node Modules Avatar Modules Server Runtime (Java EE) Application Services = Java framework = JavaScript framework = Application code Avatar.js
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar Services !19 Multi-core, state sharing, data storage Java JVM Process JavaScript Services Services ServicesServices Database Data Notification shared state JSON JSON JSON JSON HTTP Load Balancer
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Shared State ▪ MessageBus ▪ Publish/subscribe message passing ▪ Shared State ▪ Simple map API ▪ Application-scoped instance ▪ Session-scoped instance ▪ Named ▪ Leased, with configurable timeout ▪ Provide required serialization, concurrency, and caching !20 Lightweight inter-thread communication
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Shared State Example !21 var avatar = require(‘org/glassfish/avatar’);! var threads = require(‘org/glassfish/avatar/threads’);! var app = avatar.application;! var name = app.name;! var bus = app.bus;! ! // Listen for messages on the ‘alert’ topic! bus.on(‘alert’, function(msg) {! print(name + ‘ got ‘ + msg); ! });! ! // Start a background thread which publishes to the ‘alert’ topic! // Background threads do not participate in request processing! threads.newBackgroundThread(‘background’, ‘monitor.js’).start();!
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Push Service Example !22 var avatar = require(‘org/glassfish/avatar’);! var threads = require('org/glassfish/avatar/threads');! var bus = avatar.application.bus;! ! // Register a push service that forwards background messages! avatar.registerPushService({url: 'push/message'}, function () { ! this.onOpen = function (context) {! bus.on(’background', function(msg) {! context.sendMessage({body: msg});! });! };! });! ! // Create and start a background thread that publishes messages! threads.newBackgroundThread(‘background’, ‘monitor.js’).start();!
  • 23. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. WebSocket Service Example !23 // Load avatar module! var avatar = require(‘org/glassfish/avatar’); !! // Register service instance! avatar.registerSocketService({ url:‘websocket/chat’ },function() { ! this.data = { transcript : ‘’ };!
 this.onMessage = function (peer, message) {
 this.data.transcript += message;
 this.data.transcript += ‘n’;
 peer.getContext().sendAll(this.data);! };! });!
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store Framework ▪ JavaScript ORM library ▪ Pure JavaScript API that ▪ Supports relational and non-relational databases ▪ Integration with other Avatar services ▪ Similar to pure Node.js libraries ▪ Sequelize, JugglingDB, db… !24
  • 25. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store API !25 Model and Database setup var Product = avatar.newModel({! "name": {! type: "string",! primary: true! },! "price": "number",! "quantity": "integer"! });! var store = avatar.newStore(‘mysql’, {! host: ‘localhost’,! port: 3306,! database: ‘test’,! username: ‘someUser’,! password: ‘gu3ssIt’,! createDb: true,! dropTables: true! });!
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store Example !26 Creating and Storing an Object // Binds Product model with store! Product.bind(store); ! // Insert a new product into the db! store.connect(function() { Product.create({ name: 'Widget',! price: 1.00, quantity: 2 }, function(err, w1) { console.log(JSON.stringify(w1)); store.disconnect(function() { // Done! }); }); }); ▪ Bind Model to Store ! ▪ Connect to Store ▪ Creates Product table if required ▪ Callback adds product to table
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store Example !27 Relationships var Family = avatarModel.newModel('family',{! "name": {! type: "string",! primary: true! },! "description": "string"! });! ! var Product = avatarModel.newModel('product',{! "name": {! type: "string",! primary: true! },! "madeBy": "string",! "price": "number",! "quantity": "integer"! });! ! Family.hasMany(Product, {! as: 'products',! foreign: 'family'! });! ! store.bind(Family, Product); …! // for a given ‘f’! f.products.create(o).then(function(p) {! // Creating prod. (p.name) ! // in family (f.name)! …
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store API ▪ Models can have relationships with other models ▪ 1:1, 1:n, M,N ▪ Relational Data Stores ▪ Tested: Oracle DB, MySQL, Derby (Embedded, Network) ▪ Non-tested: Any other JDBC driver ▪ Non-relational Data Stores ▪ Oracle NoSQL, MongoDB (in progress) !28
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Model-Store API ▪ Lots of possibilities and ideas ▪ Configure JPA provider using properties ▪ Generate JavaScript model from database schema ▪ User transactions ▪ 2nd level JPA cache, TopLink Grid ▪ Oracle RAC Support, … ▪ Maintain pure JavaScript API ▪ We’re looking for YOUR feedback! !29 Opportunities to leverage JPA
  • 30. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!30 Avatar Client Framework
  • 31. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar Client Model ▪ View ▪ Extensible component views ▪ Pre-defined Widget Sets: jQuery UI (default), jQuery Mobile, Dijit ▪ Declarative UI components ▪ Model ▪ Models (WS, SSE, REST, local) in JavaScript ▪ Easily connects to Java and JavaScript services ▪ Model library usable as standalone JavaScript file ▪ Misc. ▪ Familiar syntax in HTML with “data-” tags ▪ Bidirectional Data binding using EL (Expression Language) ▪ CSS support ▪ AMD modules for code partitioning !31
  • 32. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Avatar Architecture - Server and Client !32 Server Client REST/WebSocket/SSE *.html *.css *.js HTP Database Data Notification JDK 8 / Nashorn Avatar Compiler Avatar Runtime Node Modules Avatar Modules Server Runtime (Java EE) Application Services Application Views = Java framework = JavaScript framework = Application code Avatar.js
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Hello World !33 <script data-model=”local” data-instance="name">!        var NameModel = function() {!              this.first = "John";!              this.last = "Doe";!              this.clear = function() { this.first = this.last = "”; }; ! };! </script>! View <form>! <label for="first">First Name</label>! <input id="first" type="text” data-value="#{name.first}"/>! <label for=“last">Last Name</label>! <input id=“last" type="text” data-value="#{name.last}"/>! Hello #{name.first} #{name.last}! <button onclick="#{name.clear()}”>Clear</button>! </form>! Model
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Chat WebSocket Example !34 <script data-model="socket">! var ChatModel = function() {! …! this.sendMsg = function() {! this.send(this.user + ":" + this.message);! this.message = "";! };! };! </script>! ! <script data-type="ChatModel" data-instance="chat”! data-url=“websocket/chat”>! </script>!
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.!35 Project Avatar
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Summary !36 Server-side JavaScript on the JVM ▪ Leverage the JVM ▪ Multi-threading optimizations ▪ Share state across threads, JVMs ▪ Built-in load balancing across threads ▪ Leverage Java EE services ▪ Deploy on existing Java EE infrastructure ▪ Leverage AppServer features (clustering, lifecycle management)
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Status !37 ▪ Launched JavaOne 2013 ▪ GlassFish 4.0 Open Source Edition ▪ Open Source ▪ 2014 ▪ Add WebLogic runtime ▪ 2015 ▪ Commercial support?
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Next steps !38 1) Download https://avatar.java.net/ 2) Try it out ! 3) Give us feedback https://avatar.java.net/mailing.html
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2014, Oracle and/or its affiliates. All rights reserved. Merci! !39 Project Avatar https://avatar.java.net/ ! Java EE 8 Survey http://glassfish.org/survey
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved.Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12!40 Graphic Section Divider