SlideShare une entreprise Scribd logo
1  sur  91
Télécharger pour lire hors ligne
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE
OSS <OSS X Users Meeting>
#21 Java EE
Akihiro Nishikawa
Oracle Corporation Japan
December 12, 2017
1
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
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.
2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Program Agenda
3
Java Enterprise Edition (Java EE)
The Road to Java EE 8
Java EE 8 Contents : JSRs and MRs
Summary
1
2
3
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java Enterprise Edition
(Java EE)
4
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5
Java EE is a set of specifications
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
J2EE 1.3
CMP, JCA
J2EE 1.4
JAX-RPC
Mgmt,
Deployment
Java EE 5
Annotations,
EJB 3.0,
JPA,
JSF,
JAXB,
JAX-WS
Java EE 6
JAX-RS,
CDI,
Servlet 3.0,
Web Profile,
Pruning
Java EE 7
JAX-RS 2.0,
JSON-P,
WebSocket,
JMS 2.0,
Batch
J2EE 1.2
Servlet, JSP,
EJB, JMS
Java EE 8
Servlet 4.0,
JAX-RS 2.1,
JSON-B
JSON-P 1.1,
Security
6
Java EE Platform
2001 2003 2006 2009 20131999 2017
Robustness
Web Services
Ease of
Development
Lightweight
Productivity
& HTML5
Enterprise Java
Modernization
& Simplification
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 7
Java EE APIs - Backbone of Leading Open Source Projects
Java EE
Containers
Microservices Web
Containers
Web
Frameworks
PaaSREST
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
2017 Java SE 9
2014 Java SE 8
2011 Java SE 7
2006 Java SE 6
2004 Java SE 5
2002 J2SE1.4
2000 J2SE1.3
1998 J2SE1.2
1997 JDK1.1
8
2017 Java EE 8
2013 Java EE 7
2009 Java EE 6
2006 Java EE 5
2002 J2EE1.4
2001 J2EE1.3
1999 J2EE1.2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 9
• Java
• Java VM
• Java EE Application Server
Reference Implementation
Java
IT
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
The Road to Java EE 8
10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
J2EE 1.3
CMP, JCA
J2EE 1.4
JAX-RPC
Mgmt,
Deployment
Java EE 5
Annotations,
EJB 3.0,
JPA,
JSF,
JAXB,
JAX-WS
Java EE 6
JAX-RS,
CDI,
Servlet 3.0,
Web Profile,
Pruning
Java EE 7
JAX-RS 2.0,
JSON-P,
WebSocket,
JMS 2.0,
Batch
J2EE 1.2
Servlet, JSP,
EJB, JMS
Java EE 8
Servlet 4.0,
JAX-RS 2.1,
JSON-B
JSON-P 1.1,
Security
11
Java EE 8
2001 2003 2006 2009 20131999 2017
Robustness
Web Services
Ease of
Development
Lightweight
Productivity
& HTML5
Enterprise Java
Modernization
& Simplification
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE 8
• 2014:
...
• 2016:
...
• 2017.9.21 : Java EE 8
12
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE 8
• Java EE 8 Platform and Web Profile
• Contexts and Dependency Injection
2.0 (CDI)
• Java API for JSON Binding 1.0 (JSON-
B)
• Java Message Service 2.1 (JMS)
• Java Servlet 4.0
• Java API for RESTful Web Services
2.1 (JAX-RS)
• Model-View-Controller 1.0 (MVC)
• JavaServer Faces 2.3 (JSF)
• Java EE Management API 2.0
• Java API for JSON Processing 1.1
(JSON-P)
• Java EE Security API 1.0
• Bean Validation 2.0
13
2014 JSR
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE Community Survey
• Java EE 8
• Java EE 8
•
– Servlet REST JSON
–
– Management JMS
MVC
14
Java One 2016
Java EE 8 Java EE 8
JAX-RS 2.1 REST Services
Servlet 4.0 HTTP/2
JSON-B 1.0 JSON-B
JSON-P 1.1 JSON-P
CDI 2.0 N/A
Bean Validation
2.0
N/A
JSF 2.3 N/A
Security 1.0 N/A
Management 2.0 Management Management 2.0
JMS 2.1 JMS JMS 2.1
MVC 1.0 MVC
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE 8
• Java EE 8 Platform and Web Profile
• Contexts and Dependency Injection
2.0 (CDI)
• Java API for JSON Binding 1.0 (JSON-
B)
• Java Message Service 2.1 (JMS)
• Java Servlet 4.0
• Java API for RESTful Web Services
2.1 (JAX-RS)
• Model-View-Controller 1.0 (MVC)
• JavaServer Faces 2.3 (JSF)
• Java EE Management API 2.0
• Java API for JSON Processing 1.1
(JSON-P)
• Java EE Security API 1.0
• Bean Validation 2.0
15
2016
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE 8 Contents:
JSRs and MRs
16
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 17
Java EE 8
Web Tier
HTTP/2 CDI
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 18
Java EE 8 API Updates
Servlet 4.0
JAX-RS 2.1
Security 1.0
JSF 2.3
Bean Validation 2.0
JSON-B 1.0
CDI 2.0
JSON-P 1.1
Bean
Validation
JSR 369
JSR 370
JSR 375
JSR 372
JSR 380
JSR 367
JSR 365
JSR 374
HTTP/2 performance – server push
Reactive API, Server-sent events
CDI WebSocket Bean Validation Java SE 8
Java SE 8 (date/time, collections)
JSON <-> Java
Java SE
JSON
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 19
Maintenance Releases
For Java SE 9
(GlassFish 5.0 )
WebSocket 1.1JSR 356
Common Annotations 1.3JSR 250 JAXB 2.0JSR 222
JAX-WS 2.0Bean
ValidationJSR 224
SAAJ 1.0JSR 67JavaMail 1.6JSR 919
Interceptors 1.2 rev AJSR 318
Java Persistence 2.2JSR 338
JAF 1.2JSR 925
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-P
20
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-P 1.1
•
– RFC 7159 - The JavaScript Object Notation (JSON) Data Interchange Format
– RFC 6901 – JSON Pointer
– RFC 6902 – JSON Patch
– RFC 7396 – JSON Merge Patch
• JsonObject JsonArray
• Java SE 8 Streams API
– JSONCollectors
21
JSON-P
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-Pointer
• JSON
"/0/user/address"
• JsonPointer
– getValue()
– add()
– remove()
– replace()
– containsValue()
22
IETF RFC 6901
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 23
JsonArray contacts = ...
JsonPointer p =
Json.createPointer("/0/phones/mobile");
JsonValue v = p.getValue(contacts);
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-234-5678"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999}}
]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 24
JsonArray contacts = ...
JsonPointer p =
Json.createPointer("/0/phones/mobile");
JsonReader reader =
Json.createReader(
new StringReader("¥"650-555-1212¥""));
JsonValue jsonValue = reader.readValue();
contacts = p.replace(contacts, jsonValue);
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-555-1212"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999}}
]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-Patch
• JSON
– "add", "remove", "replace", "move", "copy", "test"
• JsonPatchBuilder
– add, copy, move, remove, replace, test
• JsonPatch
– apply()
– toJsonArray()
25
IETF RFC 6902
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 26
JsonPatchBuilder builder =
Json.createPatchBuilder();
JsonPatch patch =
builder.replace("0/phones/mobile",
"650-111-2222")
.remove("/1").build();
JsonArray result = patch.apply(contacts);
JSON
[
{
"name":"Duke",
"gender":"M",
"phones":{
"home":"650-123-4567",
"mobile":"650-111-2222"}},
{
"name":"Jane",
"gender":"F",
"phones":{
"mobile":"707-555-9999}}
]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-Merge Patch
Operation Original Patch Result
Replace {"a" : "b"} {"a" : "c"} {"a" : "c"}
{"a" : "b"} {"a" : null} {}
Add {"a" : "b"} {"b" : "c"} {"a" : "b",
"b" : "c" }
Remove {"a" : "b",
"b" : "c" }
{"a" : null} {"b" : "c"}
27
IETF RFC 7396
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
MergePatch
JsonValue source = Json.createValue("{¥"color¥":¥"blue¥"}");
JsonValue patch = Json.createValue("{¥"color¥":¥"red¥"}");
JsonMergePatch mergePatch = Json.createMergePatch(patch);
JsonValue result = mergePatch.apply(source);
// {"color":"red"}
28
Patch
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
MergePatch
JsonValue source = Json.createValue("{¥"color¥":¥"red¥"}");
JsonValue target = Json.createValue("{¥"color¥":¥"blue¥"}");
JsonMergePatch mergePatch = Json.createMergeDiff(source, target);
// {"color":"blue"}
29
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JsonCollectors
JsonArray contacts = ...
List<String> femaleNames =
contacts.getValuesAs(JsonObject.class).stream()
.filter(x -> "F".equals(x.getString("gender")))
.map(x -> (x.getString("name")))
.collect(Collectors.toList());
30
Lambda JSON Query JSON
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JsonCollectors
JsonArray contacts = ...;
JsonArray femaleNames =
contacts.getValuesAs(JsonObject.class).stream()
.filter(x -> "F".equals(x.getString("gender")))
.map(x -> (x.get("name")))
.collect(JsonCollectors.toJsonArray());
31
JsonCollectors JSON
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-B
32
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-B 1.0
• Java JSON / API
– Java à JSON
– JSON à Java
• API
– Annotation (@JsonbProperty @JsonbNillable)
– Runtime configuration builder
• JSON Binding
33
Java API for JSON Binding
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSON-B 1.0
• JsonBuilder
– JSON API
–
• Jsonb
– JSON
– fromJson: JSON Java
– toJson: Java JSON
34
Java API for JSON Binding
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 35
Car car1 = new Car();
car1.setBrand("Toyota");
car1.setModel("Prius");
car1.setStock(20);
Car car2 = new Car();
car2.setBrand("Tesla");
...
List<Car> inventory = new ArrayList<>();
inventory.add(car1);
inventory.add(car2);
Jsonb jsonb = JsonbBuilder.create();
String json = jsonb.toJson(inventory);
JSON-B 1.0
[
{
"brand" : "Toyota",
"model" : "Prius",
"stock" : 20
},
{
"brand" : "Tesla",
"model" : "Model S",
"stock" : 0
}
]
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
public class Customer {
private int id;
@JsonbProperty(“name”)
private String firstName;
private String getFirstName() {
return firstName;
}
}
@JsonbNillable
@JsonbPropertyOrder(PropertyOrderStrat
gy.REVERSE)
public class Customer {
@JsonbNumberFormat("#0")
private int id;
@JsonbProperty(“name”)
private String firstName;
private String getFirstName() {
return firstName;
}
}
36
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
•
•
•
• Null
•
•
•
• Encoding
• Adapters
…
37
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Jsonb jsonb = JsonbBuilder.create();
//Ordering, naming strategy, encoding, Locale, ...
JsonbConfig config = new JsonbConfig().withFormatting(true)
.withAdapters(new CarAdapter());
Jsonb jsonb = JsonbBuilder.newBuilder("myProvider");
Jsonb jsonb = JsonbBuilder.create(config);
38
Runtime configuration builder
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JAX-RS
39
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.1
• Reactive Client API
• Server-sent events
• Hypermedia API enhancements
• JSR
– JSON-B
– HTTP PATCH
40
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 41
// http://example.com/api/read/doe?dpt=1
WebTarget myResource = client.target("http://example.com/api/read")
.register(SomeFilter.class)
.path("{user}")
.resolveTemplate("user", "joe")
.queryParam("dpt", "1")
.header("some-header", "true");
Response response = myResource.request(...).get();
// ...
client.close();
JAX-RS 2.0 Client API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 42
Client client = ClientBuilder.newClient();
WebTarget myResource = client.target("http://example.com/api/read");
Future<String> response = myResource.request(MediaType.TEXT_PLAIN)
.async()
.get(String.class);
// ...
JAX-RS 2.0 Client API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 43
Client client = ClientBuilder.newClient();
WebTarget myResource = client.target("http://example.com/api/read");
Future<Customer> fCustomer = myResource.request(MediaType.TEXT_PLAIN)
.async()
.get(new InvocationCallback<Customer>(){
@Override
public void completed(Customer customer) {
// work on the customer
}
@Override
public void failed(Throwable throwable) {
// Oops!
}
});
JAX-RS 2.0 Client API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 44
Orchestration
JAX-RS 2.0
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 45
destination.path("recommended")
.request()
.header("Rx-User", "Async")
.async()
.get(new InvocationCallback<List<Destination>>() {
@Override
public void completed(final List<Destination> recommended) {
final CountDownLatch innerLatch =
new CountDownLatch(recommended.size());
final Map<String, Forecast> forecasts =
Collections.synchronizedMap(new HashMap<>());
...
JAX-RS 2.0 (1/4)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 46
for (final Destination dest : recommended) {
forecasts.resolveTemplate("dest", dest.getDestination())
.request()
.async()
.get(new InvocationCallback<Forecast>() {
@Override
public void completed(final Forecast forecast) {
forecasts.put(dest.getDestination(), forecast);
innerLatch.countDown();
}
...
JAX-RS 2.0 (2/4)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 47
@Override
public void failed(final Throwable throwable) {
innerLatch.countDown();
}
});
}
try {
if (!innerLatch.await(10, TimeUnit.SECONDS)) {
// timeout
}
} catch (final InterruptedException e) {
// Ooops, interrupted!
}
...
JAX-RS 2.0 (3/4)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 48
// Continue with processing…
}
@Override
public void failed(final Throwable throwable) {
// Recommendation error
}
});
// Continue...
JAX-RS 2.0 (4/4)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JAX-RS 2.1
CompletionStage<String> cs1 = ClientBuilder.newClient()
.target("http://example.com/api")
.request()
.rx()
.get(String.class);
cs1.thenAccept(System.out::println);
49
Reactive Client API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 50
CompletionStage<String> cs1 = ClientBuilder.newClient()
.target("http://example.com/service1/hello")
.request()
.rx()
.get(String.class);
CompletionStage<String> cs2 = ClientBuilder.newClient()
.target("http://example.com/service2/bonjour")
.request()
.rx()
.get(String.class);
CompletionStage<String> concat = cs1.thenCombine(cs2, String::concat);
concat.thenAccept(System.out::println);
CompletionStage API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events (SSE)
•
–
• HTTP
– "text/event-stream"
•
– ID
–
51
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Server-Sent Events (SSE)
52
Source : https://caniuse.com/
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
SSE Client API
• SseEventSource
– Web
– Consumer
–
• InboundSseEvent
–
–
53
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 54
Client client = ClientBuilder.newClient();
WebTarget target = client.target( "http://example.com/service/subscribe" );
try( SseEventSource eventSource
= SseEventSource.target( target )
.reconnectingEvery ( 5, TimeUnit.SECONDS )
.build () ) {
eventSource.register( System.out::println );
// ...
eventSource.open();
// ...
eventSource.close();
}
SSE Client API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
SSE Server API
• SseEventSink
–
– HTTP
– OutboundSseEvent
• Sse
– OutboundSseEvent SseBroadcaster
• OutboundSseEvent
– 1
• SseBroadcaster
–
55
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 56
@GET
@Path("subscribe")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void subscribe(@Context SseEventSink eventSink, @Context Sse sse) {
eventSink.send (
sse.newEventBuilder ()
.name ( "event-name" )
.data ( String.class, "Welcome!" )
.build () );
eventSink.send( sse.newEvent ( "an event" ) );
eventSink.send( sse.newEvent ( "another event" ) );
eventSink.close ();
}
SSE Server API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
CDI
57
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
• 3
– CDI Core
– CDI for Java SE
• Java SE CDI
API
– CDI for Java EE
• Observer
•
•
• Java SE 8 Stream API
Lambda
• SPI
Configurator
• Observer
• Producer Interceptor
58
CDI 2.0
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
CDI 1.1
@Inject
private Event<PaymentEvent> paymentEvent;
// event producer
paymentEvent.fire(new PaymentEvent(amt));
// event consumer A
public void aObserver(@Observes PaymentEvent p) {
// ...
}
// event consumer B
public void bObserver(@Observes PaymentEvent p) {
// ...
}
59
Immutable
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
CDI 2.0
@Inject
private Event<PaymentEvent> paymentEvent;
// event producer
paymentEvent.fire(new PaymentEvent(amt));
// event consumer A
public void aObserver(@Observes @Priority(10) PaymentEvent p) {
// ...
}
// event consumer B
public void bObserver(@Observes @Priority(20) PaymentEvent p) {
// ...
}
60
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
CDI 2.0
@Inject
private Event<PaymentEvent> paymentEvent;
// event producer
CompletionStage<PaymentEvent> stage
= paymentEvent.fireAsync(new PaymentEvent(amt));
// event consumer A
public void aObserver(@ObservesAsync PaymentEvent p) {
// ...
}
// event consumer B
public void bObserver(@ObservesAsync PaymentEvent p) {
// ...
}
61
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Event Observer
• Event
– paymentEvent.fire(new PaymentEvent(100));
– paymentEvent.fireAsync(new PaymentEvent(200));
• Event Observer Event Observer
• Observer
62
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Web Tier
Servlet, HTTP/2, and JSF
63
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
HTTP/2
•
•
• Head-of-Line Blocking
• HTTP 1.1
64
HTTP 1.x
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
HTTP/2
• 1
–
–
•
• Stream
•
•
• HTTP 1.1
65
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 66
HTTP/2 TCP 1
Stream 4
Data
Stream 1
Headers
Stream 1
Data
Stream 2
Headers
Stream 3
Headers
Stream 2
Data
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Servlet 4.0
• HTTP/2
–
–
– HTTP 1.1
• HTTP 1.1 RFC
•
–
– jsp
–
– Servlet Mapping API
67
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 68
...
PushBuilder pushBuilder = request.newPushBuilder();
pushBuilder.path( "images/myPhoto.png" )
.addHeader( "content-type", "image/png" )
.push ();
Server Push
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
URL
• getMappingMatch()
– MappingMatch
• getPattern()
– Servlet URL
• getMatchValue()
– URI
• getServletName()
– Servlet
69
HttpServletMapping
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 70
@WebServlet(urlPatterns = {"", "/", "/main", "*.html", "/main/*"},
name = "MainServlet")
public class MainServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
static final Logger logger = Logger.getLogger(MainServlet.class.getName());
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
HttpServletMapping httpServletMapping = req.getHttpServletMapping();
MappingMatch mappingMatch = httpServletMapping.getMappingMatch();
...
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Matching
getMappingMatch getMatchValue getPattern
"" CONTEXT_ROOT "" ""
"/" DEFAULT /
"/main" EXACT main /main
"/index.html" EXTENSION index *.html
"/main/hello" PATH hello /main/*
71
getServletName MainServlet
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
JSF 2.3
• CDI
–
– managed beans
• Date and Time API
• WebSocket
• Ajax
• Bean Validation
• UIData UIRepeat
72
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Bean Validation
73
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Bean Validation 2.0
• Java SE 8
– Date and Time API
– Collection
– Optional
–
•
– @NotEmpty, @NotBlank, @Email, @Positive, @Negative,
@PositiveOrZero, @NegativeOrZero, @PastOrPresent,
@FutureOrPresent
•
74
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 75
@Past
Year startYear = Year.of(2016);
// repeating annotations
@Size(min = 8, group = Default.class)
@Size(min = 12, group = Admin.class)
private String password;
List<@NotNull @Email String> emails;
String @NotNull @Email[] email;
// constraints with container elements
Map<@Valid Customer, @Valid Account> customerAccountInfo;
Constraints (1/2)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 76
// Optional
Optional<@Past LocalDate> getEnrollmentDate();
// new Annotations
@NotEmpty
List<@NotBlank @Email String> customerEmails;
Constraints (2/2)
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Security
77
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Security API for Java EE
• API
– SecurityContext
– HttpAuthenticationMechanism
– IdentityStore
•
• CDI
78
Java EE API
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
SecurityContext
•
– authenticate()
– getCallerPrincipal(), getPrincipalsByType()
– isCallerinRole()
– hasAccessToWebResource()
•
– HttpServletRequest.getUserPrincipal()
HttpServletRequest.isUserInRole()
– EJBContext.getCallerPrincipal()
EJBContext.isCallerInRole()
79
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
HttpAuthenticationMechanism
• Web Caller
– Servlet
• JASPIC ServerAuthModule SPI Interface
– validateRequest() : doFilter() service()
– secureResponse() : doFilter() service()
– cleanSubject() : logout()
•
• IdentityStore
80
Servlet
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
IdentityStore
•
•
– LDAP Database
– Authentication Authorization
•
– validate(Credential) - CredentialValidationResult
– getCallerGroups(CredentialValidationResult)
81
JAAS
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 82
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java Persistence 2.2
•
• Date and Time API
– java.time LocalDate, LocalTime, LocalDateTime, OffsetTime,
OffsetDateTime
• Stream
– Query : Stream getResultStream()
– TypedQuery : Stream<x> getResultStream()
• AttributeConverter CDI
83
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Summary
84
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Java EE Development has been
migrated from Java.net to GitHub
https://javaee.github.io/
https://github.com/javaee
85
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 86
Java EE 8 Full Profile
Connector JAXBJSP Debugging
Managed
Beans
Concurrency
EE
Interceptors JAX-WS WebSocket
JASPIC JMS JTADeployment
Batch JACC
Dependency
Injection
JAXR JSTL Management
EJB JAX-RPC Web ServicesJPA
Common
Annotations
EL
Web Services
Metadata
JavaMail
CDI
JSON-B Security
Bean
Validation
JSF
JAX-RS JSON-P
Servlet
JSP
Maintenance Release
Update
New
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 87
Java EE 8 Web Profile
JSP Debugging
Managed
Beans
Interceptors WebSocket
JASPIC JTA
Dependency
Injection
JSTL
EJB Lite JPA
Common
Annotations
EL
CDI
JSON-B Security
Bean
Validation
JSF
JAX-RS JSON-P
Servlet
JSP
Maintenance Release
Update
New
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Summary
• Final Java EE 8 was shipped!
• EE4J (Enterprise Eclipse for Java) project is now on going.
• Fore more details on EE4J, stay tuned for Ito-san’s presentation!
88
Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The preceding 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.
89
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)

Contenu connexe

Tendances

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
 
20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVMTaewan Kim
 
Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실Taewan Kim
 
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)Taewan Kim
 
Developers vs DBAs - How to win the war
Developers vs DBAs - How to win the warDevelopers vs DBAs - How to win the war
Developers vs DBAs - How to win the wargvenzl
 
Oracle Database features every developer should know about
Oracle Database features every developer should know aboutOracle Database features every developer should know about
Oracle Database features every developer should know aboutgvenzl
 
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...Taewan Kim
 
Polyglot on the JVM with Graal (Japanese)
Polyglot on the JVM with Graal (Japanese)Polyglot on the JVM with Graal (Japanese)
Polyglot on the JVM with Graal (Japanese)Logico
 
Java EE 6 Live Hacking - Java Developer Day 2012
Java EE 6 Live Hacking - Java Developer Day 2012Java EE 6 Live Hacking - Java Developer Day 2012
Java EE 6 Live Hacking - Java Developer Day 2012Martin Fousek
 
2018 Oracle Impact 발표자료: Oracle Enterprise AI
2018  Oracle Impact 발표자료: Oracle Enterprise AI2018  Oracle Impact 발표자료: Oracle Enterprise AI
2018 Oracle Impact 발표자료: Oracle Enterprise AITaewan Kim
 
Data Management in a Microservices World
Data Management in a Microservices WorldData Management in a Microservices World
Data Management in a Microservices Worldgvenzl
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?Edward Burns
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOFglassfish
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksDmitry Kornilov
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsArshal Ameen
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Dmitry Kornilov
 
GlassFish Roadmap
GlassFish RoadmapGlassFish Roadmap
GlassFish Roadmapglassfish
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015Edward Burns
 

Tendances (20)

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
 
20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM20191119 Cloud Native Java : GraalVM
20191119 Cloud Native Java : GraalVM
 
Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
13회 Oracle Developer Meetup 발표 자료: Oracle Cloud Data Interface(2019.07.20)
 
Developers vs DBAs - How to win the war
Developers vs DBAs - How to win the warDevelopers vs DBAs - How to win the war
Developers vs DBAs - How to win the war
 
Oracle Database features every developer should know about
Oracle Database features every developer should know aboutOracle Database features every developer should know about
Oracle Database features every developer should know about
 
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL  (2019.05.18) oracle-nosql pu...
11회 Oracle Developer Meetup 발표 자료: Oracle NoSQL (2019.05.18) oracle-nosql pu...
 
Polyglot on the JVM with Graal (Japanese)
Polyglot on the JVM with Graal (Japanese)Polyglot on the JVM with Graal (Japanese)
Polyglot on the JVM with Graal (Japanese)
 
Java EE 6 Live Hacking - Java Developer Day 2012
Java EE 6 Live Hacking - Java Developer Day 2012Java EE 6 Live Hacking - Java Developer Day 2012
Java EE 6 Live Hacking - Java Developer Day 2012
 
2018 Oracle Impact 발표자료: Oracle Enterprise AI
2018  Oracle Impact 발표자료: Oracle Enterprise AI2018  Oracle Impact 발표자료: Oracle Enterprise AI
2018 Oracle Impact 발표자료: Oracle Enterprise AI
 
Data Management in a Microservices World
Data Management in a Microservices WorldData Management in a Microservices World
Data Management in a Microservices World
 
JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?JavaOne 2014 BOF4241 What's Next for JSF?
JavaOne 2014 BOF4241 What's Next for JSF?
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 
JSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworksJSONB introduction and comparison with other frameworks
JSONB introduction and comparison with other frameworks
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
 
Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)Adopt-a-JSR session (JSON-B/P)
Adopt-a-JSR session (JSON-B/P)
 
GlassFish Roadmap
GlassFish RoadmapGlassFish Roadmap
GlassFish Roadmap
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
 

Similaire à Java EE 8 Overview (Japanese)

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
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Reza Rahman
 
Adopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS updateAdopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS updatePavel Bucek
 
Java EE7
Java EE7Java EE7
Java EE7Jay Lee
 
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
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusJava EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusArun Gupta
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersBruno Borges
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesEdward Burns
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureIndicThreads
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateMartin Grebac
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018harvraja
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Hirofumi Iwasaki
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache AriesOSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Ariesmfrancis
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012Arun Gupta
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New FeaturesShahzad Badar
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPIlan Salviano
 

Similaire à Java EE 8 Overview (Japanese) (20)

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
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
Adopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS updateAdopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS update
 
Java EE7
Java EE7Java EE7
Java EE7
 
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
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusJava EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexus
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The Future
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and update
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache AriesOSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
 
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New Features
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SP
 

Plus de Logico

Welcome, Java 15! (Japanese)
Welcome, Java 15! (Japanese)Welcome, Java 15! (Japanese)
Welcome, Java 15! (Japanese)Logico
 
Look into Project Valhalla from CLR viewpoint
Look into Project Valhalla from CLR viewpointLook into Project Valhalla from CLR viewpoint
Look into Project Valhalla from CLR viewpointLogico
 
Jvmls 2019 feedback valhalla update
Jvmls 2019 feedback   valhalla updateJvmls 2019 feedback   valhalla update
Jvmls 2019 feedback valhalla updateLogico
 
Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)Logico
 
Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Logico
 
ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)Logico
 
Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)Logico
 
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)Logico
 
Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Logico
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)Logico
 
これからのNashorn
これからのNashornこれからのNashorn
これからのNashornLogico
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)Logico
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Logico
 
Nashorn : JavaScript Running on Java VM (Japanese)
Nashorn : JavaScript Running on Java VM (Japanese)Nashorn : JavaScript Running on Java VM (Japanese)
Nashorn : JavaScript Running on Java VM (Japanese)Logico
 

Plus de Logico (14)

Welcome, Java 15! (Japanese)
Welcome, Java 15! (Japanese)Welcome, Java 15! (Japanese)
Welcome, Java 15! (Japanese)
 
Look into Project Valhalla from CLR viewpoint
Look into Project Valhalla from CLR viewpointLook into Project Valhalla from CLR viewpoint
Look into Project Valhalla from CLR viewpoint
 
Jvmls 2019 feedback valhalla update
Jvmls 2019 feedback   valhalla updateJvmls 2019 feedback   valhalla update
Jvmls 2019 feedback valhalla update
 
Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)
 
Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)Oracle Code One 2018 Feedback (Server Side / Japanese)
Oracle Code One 2018 Feedback (Server Side / Japanese)
 
ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)ADBA (Asynchronous Database Access)
ADBA (Asynchronous Database Access)
 
Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)Polyglot on the JVM with Graal (English)
Polyglot on the JVM with Graal (English)
 
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
CDI 2.0 (JSR 365) - Java Day Tokyo 2017 (English)
 
Nashorn in the future (Japanese)
Nashorn in the future (Japanese)Nashorn in the future (Japanese)
Nashorn in the future (Japanese)
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)
 
これからのNashorn
これからのNashornこれからのNashorn
これからのNashorn
 
Nashorn in the future (English)
Nashorn in the future (English)Nashorn in the future (English)
Nashorn in the future (English)
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)
 
Nashorn : JavaScript Running on Java VM (Japanese)
Nashorn : JavaScript Running on Java VM (Japanese)Nashorn : JavaScript Running on Java VM (Japanese)
Nashorn : JavaScript Running on Java VM (Japanese)
 

Dernier

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%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 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
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 

Dernier (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%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 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
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 

Java EE 8 Overview (Japanese)

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE OSS <OSS X Users Meeting> #21 Java EE Akihiro Nishikawa Oracle Corporation Japan December 12, 2017 1
  • 2. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement 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. 2
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Program Agenda 3 Java Enterprise Edition (Java EE) The Road to Java EE 8 Java EE 8 Contents : JSRs and MRs Summary 1 2 3 4
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java Enterprise Edition (Java EE) 4
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 5 Java EE is a set of specifications
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. J2EE 1.3 CMP, JCA J2EE 1.4 JAX-RPC Mgmt, Deployment Java EE 5 Annotations, EJB 3.0, JPA, JSF, JAXB, JAX-WS Java EE 6 JAX-RS, CDI, Servlet 3.0, Web Profile, Pruning Java EE 7 JAX-RS 2.0, JSON-P, WebSocket, JMS 2.0, Batch J2EE 1.2 Servlet, JSP, EJB, JMS Java EE 8 Servlet 4.0, JAX-RS 2.1, JSON-B JSON-P 1.1, Security 6 Java EE Platform 2001 2003 2006 2009 20131999 2017 Robustness Web Services Ease of Development Lightweight Productivity & HTML5 Enterprise Java Modernization & Simplification
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 7 Java EE APIs - Backbone of Leading Open Source Projects Java EE Containers Microservices Web Containers Web Frameworks PaaSREST
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 2017 Java SE 9 2014 Java SE 8 2011 Java SE 7 2006 Java SE 6 2004 Java SE 5 2002 J2SE1.4 2000 J2SE1.3 1998 J2SE1.2 1997 JDK1.1 8 2017 Java EE 8 2013 Java EE 7 2009 Java EE 6 2006 Java EE 5 2002 J2EE1.4 2001 J2EE1.3 1999 J2EE1.2
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 9 • Java • Java VM • Java EE Application Server Reference Implementation Java IT
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. The Road to Java EE 8 10
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. J2EE 1.3 CMP, JCA J2EE 1.4 JAX-RPC Mgmt, Deployment Java EE 5 Annotations, EJB 3.0, JPA, JSF, JAXB, JAX-WS Java EE 6 JAX-RS, CDI, Servlet 3.0, Web Profile, Pruning Java EE 7 JAX-RS 2.0, JSON-P, WebSocket, JMS 2.0, Batch J2EE 1.2 Servlet, JSP, EJB, JMS Java EE 8 Servlet 4.0, JAX-RS 2.1, JSON-B JSON-P 1.1, Security 11 Java EE 8 2001 2003 2006 2009 20131999 2017 Robustness Web Services Ease of Development Lightweight Productivity & HTML5 Enterprise Java Modernization & Simplification
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE 8 • 2014: ... • 2016: ... • 2017.9.21 : Java EE 8 12
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE 8 • Java EE 8 Platform and Web Profile • Contexts and Dependency Injection 2.0 (CDI) • Java API for JSON Binding 1.0 (JSON- B) • Java Message Service 2.1 (JMS) • Java Servlet 4.0 • Java API for RESTful Web Services 2.1 (JAX-RS) • Model-View-Controller 1.0 (MVC) • JavaServer Faces 2.3 (JSF) • Java EE Management API 2.0 • Java API for JSON Processing 1.1 (JSON-P) • Java EE Security API 1.0 • Bean Validation 2.0 13 2014 JSR
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE Community Survey • Java EE 8 • Java EE 8 • – Servlet REST JSON – – Management JMS MVC 14 Java One 2016 Java EE 8 Java EE 8 JAX-RS 2.1 REST Services Servlet 4.0 HTTP/2 JSON-B 1.0 JSON-B JSON-P 1.1 JSON-P CDI 2.0 N/A Bean Validation 2.0 N/A JSF 2.3 N/A Security 1.0 N/A Management 2.0 Management Management 2.0 JMS 2.1 JMS JMS 2.1 MVC 1.0 MVC
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE 8 • Java EE 8 Platform and Web Profile • Contexts and Dependency Injection 2.0 (CDI) • Java API for JSON Binding 1.0 (JSON- B) • Java Message Service 2.1 (JMS) • Java Servlet 4.0 • Java API for RESTful Web Services 2.1 (JAX-RS) • Model-View-Controller 1.0 (MVC) • JavaServer Faces 2.3 (JSF) • Java EE Management API 2.0 • Java API for JSON Processing 1.1 (JSON-P) • Java EE Security API 1.0 • Bean Validation 2.0 15 2016
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE 8 Contents: JSRs and MRs 16
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 17 Java EE 8 Web Tier HTTP/2 CDI
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 18 Java EE 8 API Updates Servlet 4.0 JAX-RS 2.1 Security 1.0 JSF 2.3 Bean Validation 2.0 JSON-B 1.0 CDI 2.0 JSON-P 1.1 Bean Validation JSR 369 JSR 370 JSR 375 JSR 372 JSR 380 JSR 367 JSR 365 JSR 374 HTTP/2 performance – server push Reactive API, Server-sent events CDI WebSocket Bean Validation Java SE 8 Java SE 8 (date/time, collections) JSON <-> Java Java SE JSON
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 19 Maintenance Releases For Java SE 9 (GlassFish 5.0 ) WebSocket 1.1JSR 356 Common Annotations 1.3JSR 250 JAXB 2.0JSR 222 JAX-WS 2.0Bean ValidationJSR 224 SAAJ 1.0JSR 67JavaMail 1.6JSR 919 Interceptors 1.2 rev AJSR 318 Java Persistence 2.2JSR 338 JAF 1.2JSR 925
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-P 20
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-P 1.1 • – RFC 7159 - The JavaScript Object Notation (JSON) Data Interchange Format – RFC 6901 – JSON Pointer – RFC 6902 – JSON Patch – RFC 7396 – JSON Merge Patch • JsonObject JsonArray • Java SE 8 Streams API – JSONCollectors 21 JSON-P
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-Pointer • JSON "/0/user/address" • JsonPointer – getValue() – add() – remove() – replace() – containsValue() 22 IETF RFC 6901
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 23 JsonArray contacts = ... JsonPointer p = Json.createPointer("/0/phones/mobile"); JsonValue v = p.getValue(contacts); [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-234-5678"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999}} ]
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 24 JsonArray contacts = ... JsonPointer p = Json.createPointer("/0/phones/mobile"); JsonReader reader = Json.createReader( new StringReader("¥"650-555-1212¥"")); JsonValue jsonValue = reader.readValue(); contacts = p.replace(contacts, jsonValue); [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-555-1212"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999}} ]
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-Patch • JSON – "add", "remove", "replace", "move", "copy", "test" • JsonPatchBuilder – add, copy, move, remove, replace, test • JsonPatch – apply() – toJsonArray() 25 IETF RFC 6902
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 26 JsonPatchBuilder builder = Json.createPatchBuilder(); JsonPatch patch = builder.replace("0/phones/mobile", "650-111-2222") .remove("/1").build(); JsonArray result = patch.apply(contacts); JSON [ { "name":"Duke", "gender":"M", "phones":{ "home":"650-123-4567", "mobile":"650-111-2222"}}, { "name":"Jane", "gender":"F", "phones":{ "mobile":"707-555-9999}} ]
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-Merge Patch Operation Original Patch Result Replace {"a" : "b"} {"a" : "c"} {"a" : "c"} {"a" : "b"} {"a" : null} {} Add {"a" : "b"} {"b" : "c"} {"a" : "b", "b" : "c" } Remove {"a" : "b", "b" : "c" } {"a" : null} {"b" : "c"} 27 IETF RFC 7396
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. MergePatch JsonValue source = Json.createValue("{¥"color¥":¥"blue¥"}"); JsonValue patch = Json.createValue("{¥"color¥":¥"red¥"}"); JsonMergePatch mergePatch = Json.createMergePatch(patch); JsonValue result = mergePatch.apply(source); // {"color":"red"} 28 Patch
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. MergePatch JsonValue source = Json.createValue("{¥"color¥":¥"red¥"}"); JsonValue target = Json.createValue("{¥"color¥":¥"blue¥"}"); JsonMergePatch mergePatch = Json.createMergeDiff(source, target); // {"color":"blue"} 29
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JsonCollectors JsonArray contacts = ... List<String> femaleNames = contacts.getValuesAs(JsonObject.class).stream() .filter(x -> "F".equals(x.getString("gender"))) .map(x -> (x.getString("name"))) .collect(Collectors.toList()); 30 Lambda JSON Query JSON
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JsonCollectors JsonArray contacts = ...; JsonArray femaleNames = contacts.getValuesAs(JsonObject.class).stream() .filter(x -> "F".equals(x.getString("gender"))) .map(x -> (x.get("name"))) .collect(JsonCollectors.toJsonArray()); 31 JsonCollectors JSON
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-B 32
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-B 1.0 • Java JSON / API – Java à JSON – JSON à Java • API – Annotation (@JsonbProperty @JsonbNillable) – Runtime configuration builder • JSON Binding 33 Java API for JSON Binding
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSON-B 1.0 • JsonBuilder – JSON API – • Jsonb – JSON – fromJson: JSON Java – toJson: Java JSON 34 Java API for JSON Binding
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 35 Car car1 = new Car(); car1.setBrand("Toyota"); car1.setModel("Prius"); car1.setStock(20); Car car2 = new Car(); car2.setBrand("Tesla"); ... List<Car> inventory = new ArrayList<>(); inventory.add(car1); inventory.add(car2); Jsonb jsonb = JsonbBuilder.create(); String json = jsonb.toJson(inventory); JSON-B 1.0 [ { "brand" : "Toyota", "model" : "Prius", "stock" : 20 }, { "brand" : "Tesla", "model" : "Model S", "stock" : 0 } ]
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. public class Customer { private int id; @JsonbProperty(“name”) private String firstName; private String getFirstName() { return firstName; } } @JsonbNillable @JsonbPropertyOrder(PropertyOrderStrat gy.REVERSE) public class Customer { @JsonbNumberFormat("#0") private int id; @JsonbProperty(“name”) private String firstName; private String getFirstName() { return firstName; } } 36
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. • • • • Null • • • • Encoding • Adapters … 37
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Jsonb jsonb = JsonbBuilder.create(); //Ordering, naming strategy, encoding, Locale, ... JsonbConfig config = new JsonbConfig().withFormatting(true) .withAdapters(new CarAdapter()); Jsonb jsonb = JsonbBuilder.newBuilder("myProvider"); Jsonb jsonb = JsonbBuilder.create(config); 38 Runtime configuration builder
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JAX-RS 39
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JAX-RS 2.1 • Reactive Client API • Server-sent events • Hypermedia API enhancements • JSR – JSON-B – HTTP PATCH 40
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 41 // http://example.com/api/read/doe?dpt=1 WebTarget myResource = client.target("http://example.com/api/read") .register(SomeFilter.class) .path("{user}") .resolveTemplate("user", "joe") .queryParam("dpt", "1") .header("some-header", "true"); Response response = myResource.request(...).get(); // ... client.close(); JAX-RS 2.0 Client API
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 42 Client client = ClientBuilder.newClient(); WebTarget myResource = client.target("http://example.com/api/read"); Future<String> response = myResource.request(MediaType.TEXT_PLAIN) .async() .get(String.class); // ... JAX-RS 2.0 Client API
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 43 Client client = ClientBuilder.newClient(); WebTarget myResource = client.target("http://example.com/api/read"); Future<Customer> fCustomer = myResource.request(MediaType.TEXT_PLAIN) .async() .get(new InvocationCallback<Customer>(){ @Override public void completed(Customer customer) { // work on the customer } @Override public void failed(Throwable throwable) { // Oops! } }); JAX-RS 2.0 Client API
  • 44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 44 Orchestration JAX-RS 2.0
  • 45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 45 destination.path("recommended") .request() .header("Rx-User", "Async") .async() .get(new InvocationCallback<List<Destination>>() { @Override public void completed(final List<Destination> recommended) { final CountDownLatch innerLatch = new CountDownLatch(recommended.size()); final Map<String, Forecast> forecasts = Collections.synchronizedMap(new HashMap<>()); ... JAX-RS 2.0 (1/4) Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
  • 46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 46 for (final Destination dest : recommended) { forecasts.resolveTemplate("dest", dest.getDestination()) .request() .async() .get(new InvocationCallback<Forecast>() { @Override public void completed(final Forecast forecast) { forecasts.put(dest.getDestination(), forecast); innerLatch.countDown(); } ... JAX-RS 2.0 (2/4) Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
  • 47. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 47 @Override public void failed(final Throwable throwable) { innerLatch.countDown(); } }); } try { if (!innerLatch.await(10, TimeUnit.SECONDS)) { // timeout } } catch (final InterruptedException e) { // Ooops, interrupted! } ... JAX-RS 2.0 (3/4) Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
  • 48. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 48 // Continue with processing… } @Override public void failed(final Throwable throwable) { // Recommendation error } }); // Continue... JAX-RS 2.0 (4/4) Copyright © 2017, Oracle and/or its affiliates. All rights reserved.
  • 49. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JAX-RS 2.1 CompletionStage<String> cs1 = ClientBuilder.newClient() .target("http://example.com/api") .request() .rx() .get(String.class); cs1.thenAccept(System.out::println); 49 Reactive Client API
  • 50. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 50 CompletionStage<String> cs1 = ClientBuilder.newClient() .target("http://example.com/service1/hello") .request() .rx() .get(String.class); CompletionStage<String> cs2 = ClientBuilder.newClient() .target("http://example.com/service2/bonjour") .request() .rx() .get(String.class); CompletionStage<String> concat = cs1.thenCombine(cs2, String::concat); concat.thenAccept(System.out::println); CompletionStage API
  • 51. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Server-Sent Events (SSE) • – • HTTP – "text/event-stream" • – ID – 51
  • 52. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Server-Sent Events (SSE) 52 Source : https://caniuse.com/
  • 53. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. SSE Client API • SseEventSource – Web – Consumer – • InboundSseEvent – – 53
  • 54. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 54 Client client = ClientBuilder.newClient(); WebTarget target = client.target( "http://example.com/service/subscribe" ); try( SseEventSource eventSource = SseEventSource.target( target ) .reconnectingEvery ( 5, TimeUnit.SECONDS ) .build () ) { eventSource.register( System.out::println ); // ... eventSource.open(); // ... eventSource.close(); } SSE Client API
  • 55. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. SSE Server API • SseEventSink – – HTTP – OutboundSseEvent • Sse – OutboundSseEvent SseBroadcaster • OutboundSseEvent – 1 • SseBroadcaster – 55
  • 56. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 56 @GET @Path("subscribe") @Produces(MediaType.SERVER_SENT_EVENTS) public void subscribe(@Context SseEventSink eventSink, @Context Sse sse) { eventSink.send ( sse.newEventBuilder () .name ( "event-name" ) .data ( String.class, "Welcome!" ) .build () ); eventSink.send( sse.newEvent ( "an event" ) ); eventSink.send( sse.newEvent ( "another event" ) ); eventSink.close (); } SSE Server API
  • 57. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. CDI 57
  • 58. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. • 3 – CDI Core – CDI for Java SE • Java SE CDI API – CDI for Java EE • Observer • • • Java SE 8 Stream API Lambda • SPI Configurator • Observer • Producer Interceptor 58 CDI 2.0
  • 59. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. CDI 1.1 @Inject private Event<PaymentEvent> paymentEvent; // event producer paymentEvent.fire(new PaymentEvent(amt)); // event consumer A public void aObserver(@Observes PaymentEvent p) { // ... } // event consumer B public void bObserver(@Observes PaymentEvent p) { // ... } 59 Immutable
  • 60. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. CDI 2.0 @Inject private Event<PaymentEvent> paymentEvent; // event producer paymentEvent.fire(new PaymentEvent(amt)); // event consumer A public void aObserver(@Observes @Priority(10) PaymentEvent p) { // ... } // event consumer B public void bObserver(@Observes @Priority(20) PaymentEvent p) { // ... } 60
  • 61. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. CDI 2.0 @Inject private Event<PaymentEvent> paymentEvent; // event producer CompletionStage<PaymentEvent> stage = paymentEvent.fireAsync(new PaymentEvent(amt)); // event consumer A public void aObserver(@ObservesAsync PaymentEvent p) { // ... } // event consumer B public void bObserver(@ObservesAsync PaymentEvent p) { // ... } 61
  • 62. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Event Observer • Event – paymentEvent.fire(new PaymentEvent(100)); – paymentEvent.fireAsync(new PaymentEvent(200)); • Event Observer Event Observer • Observer 62
  • 63. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Web Tier Servlet, HTTP/2, and JSF 63
  • 64. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. HTTP/2 • • • Head-of-Line Blocking • HTTP 1.1 64 HTTP 1.x
  • 65. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. HTTP/2 • 1 – – • • Stream • • • HTTP 1.1 65
  • 66. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 66 HTTP/2 TCP 1 Stream 4 Data Stream 1 Headers Stream 1 Data Stream 2 Headers Stream 3 Headers Stream 2 Data
  • 67. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Servlet 4.0 • HTTP/2 – – – HTTP 1.1 • HTTP 1.1 RFC • – – jsp – – Servlet Mapping API 67
  • 68. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 68 ... PushBuilder pushBuilder = request.newPushBuilder(); pushBuilder.path( "images/myPhoto.png" ) .addHeader( "content-type", "image/png" ) .push (); Server Push
  • 69. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. URL • getMappingMatch() – MappingMatch • getPattern() – Servlet URL • getMatchValue() – URI • getServletName() – Servlet 69 HttpServletMapping
  • 70. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 70 @WebServlet(urlPatterns = {"", "/", "/main", "*.html", "/main/*"}, name = "MainServlet") public class MainServlet extends HttpServlet { private static final long serialVersionUID = 1L; static final Logger logger = Logger.getLogger(MainServlet.class.getName()); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { HttpServletMapping httpServletMapping = req.getHttpServletMapping(); MappingMatch mappingMatch = httpServletMapping.getMappingMatch(); ...
  • 71. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Matching getMappingMatch getMatchValue getPattern "" CONTEXT_ROOT "" "" "/" DEFAULT / "/main" EXACT main /main "/index.html" EXTENSION index *.html "/main/hello" PATH hello /main/* 71 getServletName MainServlet
  • 72. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. JSF 2.3 • CDI – – managed beans • Date and Time API • WebSocket • Ajax • Bean Validation • UIData UIRepeat 72
  • 73. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Bean Validation 73
  • 74. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Bean Validation 2.0 • Java SE 8 – Date and Time API – Collection – Optional – • – @NotEmpty, @NotBlank, @Email, @Positive, @Negative, @PositiveOrZero, @NegativeOrZero, @PastOrPresent, @FutureOrPresent • 74
  • 75. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 75 @Past Year startYear = Year.of(2016); // repeating annotations @Size(min = 8, group = Default.class) @Size(min = 12, group = Admin.class) private String password; List<@NotNull @Email String> emails; String @NotNull @Email[] email; // constraints with container elements Map<@Valid Customer, @Valid Account> customerAccountInfo; Constraints (1/2)
  • 76. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 76 // Optional Optional<@Past LocalDate> getEnrollmentDate(); // new Annotations @NotEmpty List<@NotBlank @Email String> customerEmails; Constraints (2/2)
  • 77. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Security 77
  • 78. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Security API for Java EE • API – SecurityContext – HttpAuthenticationMechanism – IdentityStore • • CDI 78 Java EE API
  • 79. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. SecurityContext • – authenticate() – getCallerPrincipal(), getPrincipalsByType() – isCallerinRole() – hasAccessToWebResource() • – HttpServletRequest.getUserPrincipal() HttpServletRequest.isUserInRole() – EJBContext.getCallerPrincipal() EJBContext.isCallerInRole() 79
  • 80. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. HttpAuthenticationMechanism • Web Caller – Servlet • JASPIC ServerAuthModule SPI Interface – validateRequest() : doFilter() service() – secureResponse() : doFilter() service() – cleanSubject() : logout() • • IdentityStore 80 Servlet
  • 81. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. IdentityStore • • – LDAP Database – Authentication Authorization • – validate(Credential) - CredentialValidationResult – getCallerGroups(CredentialValidationResult) 81 JAAS
  • 82. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 82
  • 83. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java Persistence 2.2 • • Date and Time API – java.time LocalDate, LocalTime, LocalDateTime, OffsetTime, OffsetDateTime • Stream – Query : Stream getResultStream() – TypedQuery : Stream<x> getResultStream() • AttributeConverter CDI 83
  • 84. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Summary 84
  • 85. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Java EE Development has been migrated from Java.net to GitHub https://javaee.github.io/ https://github.com/javaee 85
  • 86. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 86 Java EE 8 Full Profile Connector JAXBJSP Debugging Managed Beans Concurrency EE Interceptors JAX-WS WebSocket JASPIC JMS JTADeployment Batch JACC Dependency Injection JAXR JSTL Management EJB JAX-RPC Web ServicesJPA Common Annotations EL Web Services Metadata JavaMail CDI JSON-B Security Bean Validation JSF JAX-RS JSON-P Servlet JSP Maintenance Release Update New
  • 87. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. 87 Java EE 8 Web Profile JSP Debugging Managed Beans Interceptors WebSocket JASPIC JTA Dependency Injection JSTL EJB Lite JPA Common Annotations EL CDI JSON-B Security Bean Validation JSF JAX-RS JSON-P Servlet JSP Maintenance Release Update New
  • 88. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Summary • Final Java EE 8 was shipped! • EE4J (Enterprise Eclipse for Java) project is now on going. • Fore more details on EE4J, stay tuned for Ito-san’s presentation! 88
  • 89. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Safe Harbor Statement The preceding 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. 89