j1 la-2011-se-tech-keynote
DESCRIPTION
Java SE: Rebuilding the Momentum (Java 7 and Java SE 8: Features and Plans)TRANSCRIPT
| Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. | Insert Information Protection Policy Classification from Slide 8
The Java SE Platform: Rebuilding MomentumTerrence BarrSenior Technologist, Oracle@terrencebarr
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 2
http://javaspotlight.org@javaspotlight
Thursday, December 15, 2011
Mike DuigouAlan BatemanJim LaskeyAlex BuckleyStuart MarksJoe DarcyBruno SouzaAdam BeinAdam MessingerMark ReinholdCameron Purdy
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 2
http://javaspotlight.org@javaspotlight
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 3
Safe Harbor Statement
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
The preceding and following material 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
Safe Harbor Statement
Thursday, December 15, 2011
Priorities for our Java Platforms
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Increase competitiveness
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Increase competitiveness
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Increase competitiveness
Adapt to change
Thursday, December 15, 2011
Priorities for our Java Platforms
Grow developer base
Grow adoption
Increase competitiveness
Adapt to change
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 5
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 5
7Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
76
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Project Lambda (JSR 335)
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Project Lambda (JSR 335)Strict Verification
Parallel Class LoadersType Annotations (JSR 308)
Transfer QueuesPhasersBulk-Data Operations
Unicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayer
More New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced LocalesSDP & SCTP
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Mid 2012 Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Project Lambda (JSR 335)Strict Verification
Parallel Class LoadersType Annotations (JSR 308)
Transfer QueuesPhasersBulk-Data Operations
Unicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayer
More New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced LocalesSDP & SCTP
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Mid 2012 Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict Verification
Parallel Class LoadersType Annotations (JSR 308)
Transfer QueuesPhasersBulk-Data Operations
Unicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayer
More New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced LocalesSDP & SCTP
Project Lambda
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Mid 2012 Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict VerificationParallel Class Loaders
Type Annotations (JSR 308)Transfer QueuesPhasers
Bulk-Data OperationsUnicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayerMore New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced Locales
SDP & SCTP Project Lambda
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict VerificationParallel Class Loaders
Type Annotations (JSR 308)Transfer QueuesPhasers
Bulk-Data OperationsUnicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayerMore New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced Locales
SDP & SCTP Project LambdaMid 2011
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
7Project Jigsaw
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict VerificationParallel Class Loaders
Type Annotations (JSR 308)Transfer QueuesPhasers
Bulk-Data OperationsUnicode 6.0
Swing Nimbus
XRender Pipeline
ECC
Swing JLayerMore New I/O (JSR 203)
JDBC 4.1
TLS 1.2
Enhanced Locales
SDP & SCTP
Project Lambda
8Mid 2011
6
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JDK 7 Schedule
7
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JDK 7 Schedule
2011/07/28 General Availability2011/06/08 Final test cycle starts2011/05/18 Bug fixes: Showstoppers only
2011/05/11 All targeted bugs addressed First release candidate built
2011/04/28 API/interface changes: Showstoppers only2011/04/12 Rampdown start: P1-P3 bugs only2010/12/16 Feature Complete
7
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 8
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 8
Four JSRs
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
8
Four JSRs
Thursday, December 15, 2011
9,494 Bug Fixes
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
8
Four JSRs
Thursday, December 15, 2011
9,494 Bug Fixes
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
9,018 Mercurial Changesets
8
Four JSRs
Thursday, December 15, 2011
9,494 Bug Fixes
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
9,018 Mercurial Changesets147 Builds
8
Four JSRs
Thursday, December 15, 2011
9,494 Bug Fixes
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
9,018 Mercurial Changesets147 Builds
Four years, seven months,and seventeen days …
8
Four JSRs
Thursday, December 15, 2011
7Java9,494 Bug Fixes
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
1,966 Enhancements
9,018 Mercurial Changesets147 Builds
Four years, seven months,and seventeen days …
2011/7/28
8
Four JSRs
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
79
InvokeDynamic (JSR 292)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Coin (JSR 334)79
Fork/Join Framework (JSR 166y)
InvokeDynamic (JSR 292)
NIO.2 (JSR 203)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 10
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 10
http://www.flickr.com/photos/chefranden/908539119/
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Thursday, December 15, 2011
new HashMap<String,String>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map();
<String,String> map =
Thursday, December 15, 2011
new HashMap<String,Map<Integer,String>><String,Map<Integer,String>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map();
map =
Thursday, December 15, 2011
new HashMap<String,Map<Integer,List<String>>>
<String,Map<Integer,List<String>>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map();
map =
Thursday, December 15, 2011
new HashMap<String,Map<Integer,List<String>>>
<String,Map<Integer,List<String>>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map();
// Diamond
map =
<>Thursday, December 15, 2011
new HashMap<String,Map<Integer,List<String>>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map();
// Diamond
map = <>
Thursday, December 15, 2011
// ...
new HashMap<>();
<String,Map<Integer,List<String>>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map
// Diamond
map;
map =
Thursday, December 15, 2011
new HashMap<>();<String,Map<Integer,List<String>>>
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 11
Map
// Diamond
foo() {
} return
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 12
Thursday, December 15, 2011
if (s.equals(
else if (s.equals(
else if (s.equals(
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 12
else
"foo" doFoo();
"bar" doBar();
doBaz();
throw new IllegalArgumentException(s);
))
))
))
"baz"
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 12
switch (s) {
default:
}
case : break;
case case
::
break; break;
"foo" doFoo();"bar" doBar();
doBaz();
throw new IllegalArgumentException(s);
"baz"
// Strings in switch
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
try { // ...}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
try { // ...} IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x;}
catch (
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
try { // ...} IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; catch ( x) {
logger.log(SEVERE, "Unexpected failure", x); throw x;}
} SQLException
catch (
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
try { // ...} IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x; catch ( x) {
logger.log(SEVERE, "Unexpected failure", x); throw x;}
}
| SQLException
// Multi-catch
catch (
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 13
try { // ...} IOException x) { logger.log(SEVERE, "Unexpected failure", x); throw x;}
| SQLException
// Multi-catch
catch (
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 14
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 14
static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst);
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 15
static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst);
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 15
static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); try {
finally { in.close(); out.close(); }}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); }
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
✘15
static void copy(Path src, Path dst) throws IOException { InputStream in = Files.newInputStream(src); OutputStream out = Files.newOutputStream(dst); try {
finally { in.close(); out.close(); }}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); }
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 16
InputStream in = OutputStream out = try {
finally {
in.close();
out.close(); }}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); }
Files.newInputStream(src); Files.newOutputStream(dst);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 16
InputStream in = OutputStream out = try {
finally {
in.close();
out.close(); }}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); }
null; null;
in = out =
if (in != null)
if (out != null)
Files.newInputStream(src); Files.newOutputStream(dst);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 17
InputStream in =
OutputStream out = try {
finally { in.close();
out.close(); }
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
}
in = out =
}
Files.newInputStream(src);
Files.newOutputStream(dst);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 17
InputStream in =
OutputStream out = try {
finally { in.close();
out.close(); }
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
}
try {
} finally {
}
Files.newInputStream(src);
Files.newOutputStream(dst);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
Files.newOutputStream(dst); try {
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 18
InputStream in = OutputStream out =
try {
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
}?
Files.newInputStream(src);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
Files.newOutputStream(dst); try (
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 18
InputStream in = OutputStream out =
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
// Try-with-resources
?
) Files.newInputStream(src);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
Files.newOutputStream(dst); try (
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 18
InputStream in = OutputStream out =
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
// Try-with-resources
?
) Files.newInputStream(src);
Thursday, December 15, 2011
static void copy(Path src, Path dst) throws IOException {
Files.newOutputStream(dst); )
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 18
InputStream in = OutputStream out =
}
byte[] buf = new byte[BUFSIZ]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n);
try (
{
}
// Try-with-resources
?
Files.newInputStream(src);
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 19
// Try-with-resources
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 19
// Try-with-resources
package java.lang;
public interface AutoCloseable { public void close() throws IOException;}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 19
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 19
package foo;
class FooResource implements AutoCloseable{
// ...
public void close() { // ... }
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 20
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 20
// Preci
se re-th
row
void ret
hrow(boo
lean b)
throws
IOExcep
tion, SQ
LExcepti
on
{ tr
y {
// .
..
} catc
h (Excep
tion x)
{
logg
er.log(S
EVERE, "
Unexpect
ed failu
re", x);
thro
w x;
}}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 20
// Preci
se re-th
row
void ret
hrow(boo
lean b)
throws
IOExcep
tion, SQ
LExcepti
on
{ tr
y {
// .
..
} catc
h (Excep
tion x)
{
logg
er.log(S
EVERE, "
Unexpect
ed failu
re", x);
thro
w x;
}}
// Literalsbyte b = (byte)0b10101010;
int magic = 0xCAFE_BABE;long max = 0x7fff_ffff_ffff_ffffL;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 20
// Preci
se re-th
row
void ret
hrow(boo
lean b)
throws
IOExcep
tion, SQ
LExcepti
on
{ tr
y {
// .
..
} catc
h (Excep
tion x)
{
logg
er.log(S
EVERE, "
Unexpect
ed failu
re", x);
thro
w x;
}}
// Safe varargs
@SafeVarargsstatic <T> void addToList3 (List<T> listArg, T ... elements){ for (T x : elements) { listArg.add(x); }}
// Literalsbyte b = (byte)0b10101010;
int magic = 0xCAFE_BABE;long max = 0x7fff_ffff_ffff_ffffL;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 21
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 22
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
723
Fork/Join Framework
Project Coin (JSR 334)
InvokeDynamic (JSR 292)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
723
Fork/Join Framework
Project Coin (JSR 334)
InvokeDynamic (JSR 292)
NIO.2 (JSR 203)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 24
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Clojure
Tcl
v-language
Funnel
Mini
Lisp
LogoJHCR
Drools
Prolog
LLP
JESS Eiffel
Smalltalk
G Jython
Correlate
Bex Script
Sleep
JudoScript
SimkinWebL
Processing
Tiger
Icon
Modula-2
E
Rexx
Present
Scheme
Basic
TermWare
Hojo
Tea
PHP
FScript
Jickle
Piccola
Pascal
Luck
Scala Sather
PLAN
foo
Ada
ObjectScript
iScript
SALSAOberon
Phobos
JRuby
Dawn
GroovyYassl
Forth
Zigzag
Nice
Yoix
C#
Anvil
JavaScript
BeanShell
CAL
Pnuts
24
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 25
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 25
Ruby = Method CallsLots and lots and lots of ʼem …
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 26
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 26
def foo barend
def bar bazend
def baz # ...end
Thursday, December 15, 2011
JRubycall
logic
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 26
def foo barend
def bar bazend
def baz # ...end Kills many JVM optimizations
JRuby on Java 5/6
foo bar bazJRuby
calllogic
Thursday, December 15, 2011
JRuby on Java 7 with InvokeDynamic
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 26
def foo barend
def bar bazend
def baz # ...end Straight-through dispatch paths
foo bar baz
Thursday, December 15, 2011
foo bar
JRuby on Java 7 with InvokeDynamic
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 26
def foo barend
def bar bazend
def baz # ...end
baz
Optimizations (like inlining) can happen!
bar baz
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 27
1
5
8
12
15
fib +calls +consts +both richards redblack
1.9x3.2x
7.4x
14.2x
3.6x
5.5x
1.6x1.8x
3.5x4.4x
1.7x2.7x
Times faster than Ruby 1.9.3
JRuby on Java 6 JRuby on invokedynamic
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
728
Fork/Join Framework
Project Coin (JSR 334)
InvokeDynamic (JSR 292)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
728
Fork/Join Framework
Project Coin (JSR 334)
InvokeDynamic (JSR 292)
NIO.2 (JSR 203)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 29
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 29
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 30
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 30
1. Keep all the processor cores busy
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 30
1. Keep all the processor cores busy
2. Minimize synchronization overhead
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 30
1. Keep all the processor cores busy
2. Minimize synchronization overhead
3. Scale linearly as the number of cores increases
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 31
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Result compute(Task t) {
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
}}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
}}
return t.computeSequentially();
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
} else {
left = compute(p.leftHalf()); right = compute(p.rightHalf());
}}
Result left, right;
return t.computeSequentially();
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 32
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
} else {
left = compute(p.leftHalf()); right = compute(p.rightHalf());
}}
Result left, right;
return t.computeSequentially();
return combine(left, right);
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 33
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
} else {
left = compute(p.leftHalf()); right = compute(p.rightHalf());
}}
Result left, right;
return t.computeSequentially();
return combine(left, right);
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 33
Result compute(Task t) { if (t.size() < SEQUENTIAL_THRESHOLD) {
} else {
left = compute(p.leftHalf()); right = compute(p.rightHalf());
}}
Result left, right;
return t.computeSequentially();
return combine(left, right);
INVOKE-IN-PARALLEL {
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 34
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 34
public class Task extends java.util.concurrent.RecursiveAction{
List<Student> students;
Task(List<Student> ss) { students = ss; }
Task leftHalf() { int n = students.size(); return new Task(students.subList(0, n / 2)); }
Task rightHalf() { int n = students.size(); return new Task(students.subList(n / 2, n)); }
double computeSequentially() { double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; }
static final int SEQUENTIAL_THRESHOLD = 1 << 14;
double result;
protected void compute() { if (students.size() < SEQUENTIAL_THRESHOLD) { result = computeSequentially(); } else { Task left = leftHalf(); Task right = rightHalf(); invokeAll(left, right); // INVOKE-IN-PARALLEL result = Math.max(left.result, right.result); } }
static double compute(List<Student> ss) { ForkJoinPool pool = new ForkJoinPool(); Task t = new Task(ss); pool.invoke(t); return t.result; }
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
735
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
735
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
NIO.2 (JSR 203)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 36
New Filesystem APIFile notificationsDirectory operations
Asynchronous I/ONew filesystem provider for zip/jar archives
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
Path searchDir = Paths.get("c:/Users");final Path findFile = Paths.get("baby.jpg");
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
Path searchDir = Paths.get("c:/Users");final Path findFile = Paths.get("baby.jpg");
FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; }};
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
Path searchDir = Paths.get("c:/Users");final Path findFile = Paths.get("baby.jpg");
FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; }};
EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
Path searchDir = Paths.get("c:/Users");final Path findFile = Paths.get("baby.jpg");
FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; }};
EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
Files.walkFileTree(searchDir, opts, Integer.MAX_VALUE, visitor);
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
import java.nio.file.*;
Path searchDir = Paths.get("c:/Users");final Path findFile = Paths.get("baby.jpg");
FileVisitor visitor = new SimpleFileVisitor() { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (file.getName().startsWith(findFile)) { System.out.format("%s%n", findFile); } return FileVisitResult.CONTINUE; }};
EnumSet<FileVisitOption> opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS);
Files.walkFileTree(searchDir, opts, Integer.MAX_VALUE, visitor);
37
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
738
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict class-file checking · Upgrade the class-loader architecture · Method to close a URLClassLoader · Concurrency and collections updates · Unicode 6.0 · Locale enhancement · Separate user and user-interface locales · More new I/O APIs (JSR 203) · Filesystem provider for zip/jar archives · SCTP · SDP · Windows Vista IPv6 stack · TLS 1.2 · Elliptic-curve cryptography (ECC) · JDBC 4.1 · XRender pipeline for Java 2D · New platform APIs for 6u10 graphics features · Nimbus look-and-feel for Swing · Swing JLayer component · Gervill sound synthesizer · Update the XML stack · Enhanced MBeans
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
738
InvokeDynamic (JSR 292)
Fork/Join Framework
Project Coin (JSR 334)
Strict class-file checking · Upgrade the class-loader architecture · Method to close a URLClassLoader · Concurrency and collections updates · Unicode 6.0 · Locale enhancement · Separate user and user-interface locales · More new I/O APIs (JSR 203) · Filesystem provider for zip/jar archives · SCTP · SDP · Windows Vista IPv6 stack · TLS 1.2 · Elliptic-curve cryptography (ECC) · JDBC 4.1 · XRender pipeline for Java 2D · New platform APIs for 6u10 graphics features · Nimbus look-and-feel for Swing · Swing JLayer component · Gervill sound synthesizer · Update the XML stack · Enhanced MBeans
NIO.2 (JSR 203)
Thursday, December 15, 2011
Copyright © 2010 Oracle and/or its affiliates. All rights reserved.
JVM Convergence
Thursday, December 15, 2011
Copyright © 2010 Oracle and/or its affiliates. All rights reserved.
JVM Convergence
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
840
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
8 Project Lambda (JSR 335)
40
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
8 Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
40
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 41
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 41
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 41
C#
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 41
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
class Student { String name; int gradYear; double score;}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
double max = Double.MIN_VALUE;for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score);}return max;
Thursday, December 15, 2011
public class Task extends java.util.concurrent.RecursiveAction{
List<Student> students;
Task(List<Student> ss) { students = ss; }
Task leftHalf() { int n = students.size(); return new Task(students.subList(0, n / 2)); }
Task rightHalf() { int n = students.size(); return new Task(students.subList(n / 2, n)); }
double computeSequentially() { double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } return max; }
static final int SEQUENTIAL_THRESHOLD = 1 << 14;
double result;
protected void compute() { if (students.size() < SEQUENTIAL_THRESHOLD) { result = computeSequentially(); } else { Task left = leftHalf(); Task right = rightHalf(); invokeAll(left, right); // INVOKE-IN-PARALLEL result = Math.max(left.result, right.result); } }
static double compute(List<Student> ss) { ForkJoinPool pool = new ForkJoinPool(); Task t = new Task(ss); pool.invoke(t); return t.result; }
}
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
List<Student> students = ...;
double max = Double.MIN_VALUE;for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score);}return max;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 42
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
double max = Double.MIN_VALUE;for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score);}return max;
Thursday, December 15, 2011
s.scoreMath.maxs.gradYear == 2011 if ( )
max = (max, }return max;
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 43
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
);
double max Double.MIN_VALUE; = for (Student s : students) {
Thursday, December 15, 2011
s.scoreMath.maxs.gradYear == 2011 if ( )
max = (max, }return max;
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 43
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
);
double max Double.MIN_VALUE; = for (Student s : ) {students
Thursday, December 15, 2011
Math.maxs.gradYear == 2011 if ( )
max = (max, }return max;
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 43
class Student { String name; int gradYear; double score;}
List<Student> students = ...;
s.score);
double max Double.MIN_VALUE; = for (Student s : ) {students
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 44
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
= studentsdouble max
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 44
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter. = studentsdouble max
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 44
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter
.map
. = studentsdouble max
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 44
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter
.map
.reduce
. = studentsdouble max
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 45
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter
.map
.reduce
. = studentsdouble max
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 45
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(new Predicate<Student>() { {
; }
.map
.reduce
. = studentsdouble max
public boolean eval(Student s) return
})
Thursday, December 15, 2011
)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 46
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(new Predicate<Student>() { {
; } } .map
.reduce
)
. = studentsdouble max
public boolean eval(Student s return
Thursday, December 15, 2011
)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 46
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(new Predicate<Student>() { {
; } } .map new Mapper<Student,Double>() {(
{;
} } .reduce
)
)
. = studentsdouble max
public boolean eval(Student s
public Double map(Student s)
return
return
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 47
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(new Predicate<Student>() { {
; } } .map new Mapper<Student,Double>() {(
{;
} } .reduce
)
)
. = studentsdouble max
public boolean eval(Student s
public Double map(Student s)
return
return
)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 47
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(new Predicate<Student>() { {
; } } .map new Mapper<Student,Double>() {(
{;
} } .reduce( , new Reducer<Double,Double>() {
(max, score) } }
)
)
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
public boolean eval(Student s
public Double map(Student s)
return
return
return ;
)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 47
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
Math.max
s.gradYear == 2011
s.score
filter(
.map new Mapper<Student,Double>() {( {
; } } .reduce( , new Reducer<Double,Double>() {
(max, score) } }
)
)
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s
public Double map(Student s) return
return ;
)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 48
Math.max
s.gradYear == 2011
s.score
filter(
.map new Mapper<Student,Double>() {( {
; } } .reduce( , new Reducer<Double,Double>() {
} }
)
)
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s
public Double map(Student s) return
return (max, score);
)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 48
Math.max
s.gradYear == 2011
s.score
filter(
.map new Mapper<Student,Double>() {( {
; } } .reduce( , new Reducer<Double,Double>() {
} }
)
)
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s
public Double map(Student s) return
return (max, score);
-> )
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 48
Math.max
s.gradYear == 2011
s.score
filter(
.map(
.reduce( , new Reducer<Double,Double>() {
} }
)
)
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s
(Student s)
return (max, score);
-> )
Thursday, December 15, 2011
->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 49
Math.max
s.gradYear == 2011s.score
filter(.map(
.reduce( , new Reducer<Double,Double>() {
} }
))
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s(Student s)
return
,
(max, score);
)
Thursday, December 15, 2011
->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 49
Math.max
s.gradYear == 2011s.score
filter(.map(
.reduce( , new Reducer<Double,Double>() {
} }
))
);
0.0
. = studentsdouble max
{ public Double reduce(Double max, Double score)
(Student s(Student s)
return
->
,
(max, score);
)
Thursday, December 15, 2011
->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 49
Math.max
s.gradYear == 2011s.score
filter(.map(
.reduce(
))
);
0.0
. = studentsdouble max
(Double max, Double score)
(Student s(Student s) ->
,
(max, score)
)
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 50
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);
0.0
. = studentsdouble max
(Double max, Double score)
(Student s(Student s)
,
(max, score)
)
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 50
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);
0.0
. = studentsdouble max
(Double max, Double score)
(Student s(Student s)
,
-> (max, score)
)
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 50
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);
0.0
. = studentsdouble max
( max, score)
ss
,
-> (max, score)
Thursday, December 15, 2011
->
-> ->
double max
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 51
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);
0.0
. = students
(max, score)
ss
,
(max, score)
Thursday, December 15, 2011
-> ->
double max
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 51
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);
0.0
. = students ss
,
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max
Math.max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);0.0
. = students ss
,
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max
Thursday, December 15, 2011
double max = students.filter(new Predicate<Student>() { public boolean eval(Student s) { return s.gradYear == 2011; } }).map(new Mapper<Student,Double>() { public Double map(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double,Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } });
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max
// Iterable
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max
// Iterable // Iterable
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 52
double max s.gradYear == 2011
s.scorefilter(
.map(
.reduce(
))
);0.0
. = students ss
, Math#max // Double
// Iterable // Iterable
Thursday, December 15, 2011
-> ->
double max
Math#max
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 53
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);0.0
. = students
ss
, // Double
// Iterable // Iterable
List<Student> students = ...;
Thursday, December 15, 2011
-> ->
double max
Math#max
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 53
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);0.0
. = students
ss
, // Double
// Iterable // Iterable
.parallel()
List<Student> students = ...;
Thursday, December 15, 2011
-> ->
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 54
double max
Math#max
s.gradYear == 2011s.score
filter(.map(.reduce(
))
);0.0
. = students
ss
,
.parallel()
List<Student> students = ...;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 55
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 55
interface Iterable<T> {
Iterator<T> iterator();
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 56
interface Iterable<T> {
Iterator<T> iterator();
}
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 56
interface Iterable<T> {
Iterator<T> iterator();
}
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer);
;
;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 57
interface Iterable<T> {
Iterator<T> iterator();
}
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer);
;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 57
interface Iterable<T> {
Iterator<T> iterator();
}
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer);
Iterables.filter; default
;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 58
interface Iterable<T> {
Iterator<T> iterator();
}
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer);
default Iterables.filter;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 58
interface Iterable<T> {
Iterator<T> iterator();
}
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer);
default
default Iterables.map;
Iterables.filter;
Thursday, December 15, 2011
}
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 59
interface Iterable<T> {
Iterator<T> iterator();
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer)
default
default Iterables.map;
Iterables.filter;
Thursday, December 15, 2011
}
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 59
interface Iterable<T> {
Iterator<T> iterator();
Iterable<T> filter(Predicate<? super T> predicate)
<U> Iterable<U> map(Mapper<? super T, ? extends U> mapper)
<U> U reduce(U base, Reducer<U, ? super T> reducer)
default
default
default Iterables.reduce;
Iterables.map;
Iterables.filter;
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 60
Project Lambda = Lambda expressions + Bulk-data operations + Method literals + Default methods
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 61
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 61
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 61
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
8 Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
62
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 63
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 63
http://www.flickr.com/photos/lizadaly/2944362379
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 64
Thursday, December 15, 2011
$ java -cp $APPHOME/lib/jdom-1.0.jar\:$APPHOME/lib/jaxen-1.0.jar\:$APPHOME/lib/saxpath-1.0.jar\:$APPHOME/lib/rome-1.0.jar\:$APPHOME/lib/rome-fetcher-1.0.jar\:$APPHOME/lib/joda-time-1.6.jar\:$APPHOME/lib/tagsoup-1.2.jar\ org.planetjdk.aggregator.Main
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 64
Thursday, December 15, 2011
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 64
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
jdom
rome
rome-fetcher
joda-time
tagsoupjaxp
org.planetjdk.aggregator
65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
jdom
rome
rome-fetcher
joda-time
tagsoupjaxp
org.planetjdk.aggregator
65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
jdom
rome
rome-fetcher
joda-time
tagsoupjaxp
org.planetjdk.aggregator
65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
jdom
jaxen
rome
rome-fetcher
joda-time
tagsoupjaxp
org.planetjdk.aggregator
65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
jdom
jaxen
saxpathrome
rome-fetcher
joda-time
tagsoupjaxp
org.planetjdk.aggregator
65
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
jar
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
jar
jmod
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
rpm
jar
jmod
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
deb
rpm
jar
jmod
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
// module-info.java
module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main;}
deb
rpm
jar
jmod
mvn
66
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 67
http://www.flickr.com/photos/viagallery/2290654438
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 67
http://www.flickr.com/photos/viagallery/2290654438
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 67
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 68
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 69
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 70
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 71
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 72
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 72
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
javafx
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 72
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 73
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 74
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 75
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 76
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 77
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 78
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 79
base
ssllogging
rmi auth
scripting
naming compiler
kerberostxn management jaxp
javac
corba jdbcxml-dsig desktopjaxws
javadoc
jre-toolsheadlessjaxws-tools
javahjavap
java toolsjre
deploy
jdk
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 80
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 80
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 81
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 81
80/20Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
882
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JavaScript (Project Nashorn)
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JVM Convergence
JavaScript (Project Nashorn)
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JVM Convergence
JavaScript (Project Nashorn)
Type Annotations (JSR 308)
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JVM Convergence
JavaScript (Project Nashorn)
Date/Time API (JSR 310)
Type Annotations (JSR 308)
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JVM Convergence
JavaScript (Project Nashorn)
Sensors
Date/Time API (JSR 310)
Type Annotations (JSR 308)
Thursday, December 15, 2011
Project Jigsaw (JSR TBD)
Project Lambda (JSR 335)
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
883
JVM Convergence
JavaScript (Project Nashorn)
Sensors
Date/Time API (JSR 310)
Plus more to come …
Type Annotations (JSR 308)
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JDK Roadmap
2011 2012 2013
JDK 7u2•JRE 7 on java.com•JavaFX 2.0 co-install
JDK 8•Windows, Linux, Solaris, OS X, Embedded Platforms
•Jigsaw•Lambda•JavaFX 3.0•Complete Oracle JVM Convergence
•JavaScript Interop•more
Last PublicJDK 6 Update
JDK 7u6•OS X JRE Port (for end-users)
•Improved OS integration, auto-updateJDK 7
JDK 7u4•OS X JDK Port (for developers)
2014
NetBeans 7•Java SE 7 Support•more
NetBeans.next•Java SE 8 Support•JavaFX 3.0 Support•more
Mac OS X•JDK 7 Developer Preview•Java FX 2.0 Dev Preview
NetBeans 7.1•JavaFX 2.0 Support
84
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 85
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 85
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 85
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved. 85
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
openjdk.java.net/projects/jdk8jdk8.java.net
86
Thursday, December 15, 2011
Thursday, December 15, 2011
| Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. | Insert Information Protection Policy Classification from Slide 8
Thursday, December 15, 2011