JAVA, MOVING FORWARD     JavaSE8 & JavaEE7                 Copyright © 2012 Akira Koyasu. Some rights reserved.
JavaOne Tokyo 2012           April 4-52                  Copyright © 2012 Akira Koyasu. Some rights reserved.
the Coming Technologies3                Copyright © 2012 Akira Koyasu. Some rights reserved.
the Coming Technologies     JavaSE8      Project Jigsaw      Project Lambda      HotRockit      Nashorn3                  ...
the Coming Technologies     JavaSE8           JavaEE7      Project Jigsaw        PaaS      Project Lambda        JAX-RS 2....
JavaSE8     Copyright © 2012 Akira Koyasu. Some rights reserved.
JavaSE Roadmap                2011                   2012                                        2013    2011/7/28        ...
Themes of JavaSE8         (from JSR 337)6                   Copyright © 2012 Akira Koyasu. Some rights reserved.
Themes of JavaSE8         (from JSR 337)       Productivity6                   Copyright © 2012 Akira Koyasu. Some rights ...
Themes of JavaSE8         (from JSR 337)       Productivity       Performance6                   Copyright © 2012 Akira Ko...
Themes of JavaSE8         (from JSR 337)       Productivity       Performance       Modularity6                   Copyrigh...
JavaSE8    Project Jigsaw    Project Lambda    HotRockit    Nashorn7               Copyright © 2012 Akira Koyasu. Some rig...
Project Jigsaw8           Copyright © 2012 Akira Koyasu. Some rights reserved.
Project Jigsaw    No more classpath8              Copyright © 2012 Akira Koyasu. Some rights reserved.
Project Jigsaw    No more classpath       Escape from “JAR hell”       Modular JDK8                   Copyright © 2012 Aki...
module-info.java                                   com.foo                            com.foo.Main    module com.foo {}   ...
requires                                                      com.foo     module com.foo {                               c...
@ version     module com.foo @ 1.0.0 {       requires org.bar @ 1.2.0;                             com.foo       requires ...
permits                                                           com.app     module com.foo {       permits com.app;     ...
permits                           com.other                                                            com.app     module ...
permits                           com.other                                                            com.app     module ...
optional     module com.foo {       requires org.bar;       requires com.baz;       requires optional org.bar.extra;     }...
optional     module com.foo {       requires org.bar;       requires com.baz;       requires optional org.bar.extra;     }...
provides     module com.app {       requires com.foo.util;       requires com.foo.db;     }                               ...
jpkg     $	 jpkg	 -m	 modules/com.foo	 jmod	 com.foo     $	 ls     modules/     com.foo@1.0.0.jmod                        ...
jmod (1)     $	 jmod	 -L	 mlib	 create     $	 jmod	 -L	 mlib	 install	      	 	 	 	 /path/to/com.foo@*.jmod	      	 	 	 	 ...
jmod (2)     $	 jmod	 add-repo	 http://jig.sfbay     $	 jmod	 install	 jdk.tools                                      http...
JavaSE8     Project Jigsaw     Project Lambda     HotRockit     Nashorn18               Copyright © 2012 Akira Koyasu. Som...
Project Lambda19           Copyright © 2012 Akira Koyasu. Some rights reserved.
Project Lambda19       !     Copyright © 2012 Akira Koyasu. Some rights reserved.
Project Lambda          !19           Copyright © 2012 Akira Koyasu. Some rights reserved.
Project Lambda                      !     Easy-to-use Parallel19                          Copyright © 2012 Akira Koyasu. S...
Project Lambda                      !     Easy-to-use Parallel     Reduce conceptual and syntactic GAP       between Seria...
class Student     public class Student {     	 private int gradYear;     	 private double score;     	     	 public int ge...
Question21        Copyright © 2012 Akira Koyasu. Some rights reserved.
Question     Compute the highest score          of the students         graduated in 201121                 Copyright © 20...
Highest Score     with External Iteration      List<Student> students = new ArrayList<>();      // ...      double hightes...
Highest Score     with Internal Iteration     SmartList<Student> students = new SmartList<>();     // ...     double hight...
Highest Score     with Internal Iteration     SmartList<Student> students = new SmartList<>();     // ...     double hight...
with Lambdas     List<Student> students = new ArrayList<>();     // ...     double hightestScore = students     	 .filter(...
with Lambdas                                          and Parallelism     List<Student> students = new ArrayList<>();     ...
with Lambdas                                          and Parallelism     List<Student> students = new ArrayList<>();     ...
the Points25         Copyright © 2012 Akira Koyasu. Some rights reserved.
the Points     Lambda Expression25              Copyright © 2012 Akira Koyasu. Some rights reserved.
the Points     Lambda Expression     Default Method25              Copyright © 2012 Akira Koyasu. Some rights reserved.
the Points     Lambda Expression     Default Method     New Interface:          ParallelIterable25               Copyright...
Functional Interface26              Copyright © 2012 Akira Koyasu. Some rights reserved.
Functional Interface     Functional interface:26               Copyright © 2012 Akira Koyasu. Some rights reserved.
Functional Interface        Functional interface:     Interface with one method26                 Copyright © 2012 Akira K...
Functional Interface        Functional interface:     Interface with one method         java.util.Comparator<T>         ja...
Lambda Expression           Lambda Expression     instantiates a fuctional interface27                      Copyright © 20...
Lambda Expression              Lambda Expression        instantiates a fuctional interface     Comparator<String> c       ...
Lambda Expression              Lambda Expression        instantiates a fuctional interface     Comparator<String> c       ...
Dilemma     Collections need new methods              forEach     reduce              filter       sorted              map ...
Dilemma     Collections need new methods              forEach     reduce              filter       sorted              map ...
Default Method29           Copyright © 2012 Akira Koyasu. Some rights reserved.
Default Method           Interface method     with default implementation29                   Copyright © 2012 Akira Koyas...
Default Method                  Interface method            with default implementation     public interface Iterable<T> {...
New Interface:             ParallelIterable               ParallelIterable has         the same methods as Iterable,      ...
Method Reference     FileFilter filter = new FileFilter() {         public boolean accept(File f) {             return f.c...
Method Reference        FileFilter filter = new FileFilter() {            public boolean accept(File f) {                r...
Method Reference        FileFilter filter = new FileFilter() {            public boolean accept(File f) {                r...
Highest Score            with Lambdas     List<Student> students = new ArrayList<>();     // ...     double hightestScore ...
JavaSE8     Project Jigsaw     Project Lambda     HotRockit     Nashorn33             Copyright © 2012 Akira Koyasu. Some ...
Oracle JVMs34         Copyright © 2012 Akira Koyasu. Some rights reserved.
Oracle JVMs                             HotSpot                                   from Sun34         Copyright © 2012 Akir...
Oracle JVMs     JRockit                             HotSpot      from BEA                                 from Sun34      ...
Oracle JVMs     JRockit                             HotSpot      from BEA                                 from Sun34      ...
Oracle JVMs     JRockit                               HotSpot      from BEA                                   from Sun    ...
JRockit35        Copyright © 2012 Akira Koyasu. Some rights reserved.
JRockit     jcmd     no Perm-Gen     Mission Control     Flight Recorder     Deterministic GC35               Copyright © ...
JRockit     jcmd     no Perm-Gen     Mission Control            (Premium Feature)     Flight Recorder            (Premium ...
JavaSE8     Project Jigsaw     Project Lambda     HotRockit     Nashorn36               Copyright © 2012 Akira Koyasu. Som...
Nashorn     New JavaScript Engine in JDK8     Compliance: ECMA-262 Edition 5       (Latest ECMAScript standard)     JavaSc...
Native on the JVM                     AST/IR                                 Java     JavaScript       Abstract Syntax Tre...
JavaEE7     Copyright © 2012 Akira Koyasu. Some rights reserved.
JavaEE Roadmap        2009            2010           2011                2012                    2013     2009/12/10      ...
Themes of JavaEE7          (from JSR 342)41                   Copyright © 2012 Akira Koyasu. Some rights reserved.
Themes of JavaEE7          (from JSR 342)       Cloud41                   Copyright © 2012 Akira Koyasu. Some rights reser...
JavaEE7     PaaS     JAX-RS 2.0     JCache42            Copyright © 2012 Akira Koyasu. Some rights reserved.
Platform as a Service     the JavaEE7 Platform           is a Service43                Copyright © 2012 Akira Koyasu. Some...
[IPS]aaS            IaaS     Infrastructure as a Service                                       PaaS                       ...
[IPS]aaS            IaaS     Infrastructure as a Service                                       PaaS                       ...
[IPS]aaS            IaaS     Infrastructure as a Service                                       PaaS                       ...
[IPS]aaS            IaaS     Infrastructure as a Service                                       PaaS                       ...
Key Features45          Copyright © 2012 Akira Koyasu. Some rights reserved.
Key Features     Provisioning45          Copyright © 2012 Akira Koyasu. Some rights reserved.
Key Features     Provisioning     Elasticity45            Copyright © 2012 Akira Koyasu. Some rights reserved.
Key Features     Provisioning     Elasticity     Multi-tenancy45            Copyright © 2012 Akira Koyasu. Some rights res...
Provisioning              Auto-Provision Services                                                Application            Cl...
Elasticity     Dynamic self-adjusting      SLA driven Elasticity     Node    Node   Node              Node47              ...
Multi-tenancy     Shared Application, Shared Data Source       Tenant 1       Tenant 2       Application                  ...
JavaEE7     PaaS     JAX-RS 2.0     JCache49            Copyright © 2012 Akira Koyasu. Some rights reserved.
JAX-RS 2.0                                                                     javax.ws.rs                   JAX-RS     Ja...
JAX-RS     Client                                Server                                           Resource                ...
JAX-RS                GET     Client     POST                         Server                PUT               DELETE      ...
JAX-RS                GET     Client     POST                           Server                PUT               DELETE    ...
JAX-RS                GET     Client     POST                           Server                PUT     Object    DELETE    ...
Define a Resource 1.1                           JAX-RS     http://example.info/company/1234/employee?id=567852            ...
Define a Resource 1.1                           JAX-RS     http://example.info/company/1234/employee?id=5678         @Path...
What’s new in JAX-RS 2.0     Client API                 Improved Conneg     Filters & Interceptors     Hypermedia     Asyn...
Client API     Client client = ClientFactory.newClient();     String employeeName = client     	 	 .target("http://../camp...
Filters                                          Resource                                             A                   ...
Filters     Request                                                    Resource                                           ...
Filters           Request                                                          Resource                               ...
Filters           Request                                                          Resource                               ...
Filters           Request                                                          Resource                               ...
Filters           Request                        PreMatchFilter                       (server side only)            Filter...
Filters           Request                        PreMatchFilter                       (server side only)            Filter...
Filters           Request                        PreMatchFilter                       (server side only)            Filter...
Interceptors                                     @Consumes                                     ("application/widget+xml") ...
Interceptors     Request                                               @Consumes                                          ...
Interceptors     Request                                                @Consumes                                         ...
Interceptors     Request                                                 @Consumes                                        ...
Interceptors     Request                                                  @Consumes                                       ...
Interceptors     Request                ReaderInterceptor                   <Widget>                                      ...
Asynchrony (server side)      Suspend & Resume connections               javax.ws.rs.core.ExecutionContext       @Path("/a...
Asynchrony (client side)                            AsyncInvoker      AsyncInvoker async = client      	   	  .target("htt...
JavaEE7     PaaS     JAX-RS 2.0     JCache59            Copyright © 2012 Akira Koyasu. Some rights reserved.
JCache                                                      javax.cache     Standard Caching API60              Copyright ...
JCache                                                         javax.cache     Standard Caching API           Expiration  ...
Basic Use     CacheManager cacheManager = Caching.getCacheManager();     Cache<Integer, String> cache = cacheManager.getCa...
Atomic Operation     cache.getAndRemove(key);     cache.getAndReplace(key, value2);     cache.putIfAbsent(key, value);    ...
Annotation     @CacheDefaults(cacheName="myScheduler")     public class MyScheduler {     	     	 @CachePut     	 public v...
Conclusion      Copyright © 2012 Akira Koyasu. Some rights reserved.
Conclusion65         Copyright © 2012 Akira Koyasu. Some rights reserved.
Conclusion     Revolution         is coming,      Don’t miss it!65              Copyright © 2012 Akira Koyasu. Some rights...
JavaOne 2012        Sept 30-Oct 466                Copyright © 2012 Akira Koyasu. Some rights reserved.
Notes     This work is licensed under the Creative Commons     Attribution-NonCommercial 3.0 Unported License. To view    ...
Upcoming SlideShare
Loading in …5
×

Java, Moving Forward

1,275 views

Published on

the Topics in JavaSE8 and some of Key features in JavaEE7.

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,275
On SlideShare
0
From Embeds
0
Number of Embeds
329
Actions
Shares
0
Downloads
38
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Java, Moving Forward

    1. 1. JAVA, MOVING FORWARD JavaSE8 & JavaEE7 Copyright © 2012 Akira Koyasu. Some rights reserved.
    2. 2. JavaOne Tokyo 2012 April 4-52 Copyright © 2012 Akira Koyasu. Some rights reserved.
    3. 3. the Coming Technologies3 Copyright © 2012 Akira Koyasu. Some rights reserved.
    4. 4. the Coming Technologies JavaSE8 Project Jigsaw Project Lambda HotRockit Nashorn3 Copyright © 2012 Akira Koyasu. Some rights reserved.
    5. 5. the Coming Technologies JavaSE8 JavaEE7 Project Jigsaw PaaS Project Lambda JAX-RS 2.0 HotRockit JCache Nashorn3 Copyright © 2012 Akira Koyasu. Some rights reserved.
    6. 6. JavaSE8 Copyright © 2012 Akira Koyasu. Some rights reserved.
    7. 7. JavaSE Roadmap 2011 2012 2013 2011/7/28 2012 later 2013 Summer JavaSE7 JavaSE7u6 JavaSE8 JRE for MacOSX Jigsaw 2012/4/27 Auto-update Lambda JavaFX3.0 JavaSE7u4 HotRockit JDK for MacOSX Nashorn JavaFX2.1 2012/11 G1GC JRE default JavaSE6 Last public update5 Copyright © 2012 Akira Koyasu. Some rights reserved.
    8. 8. Themes of JavaSE8 (from JSR 337)6 Copyright © 2012 Akira Koyasu. Some rights reserved.
    9. 9. Themes of JavaSE8 (from JSR 337) Productivity6 Copyright © 2012 Akira Koyasu. Some rights reserved.
    10. 10. Themes of JavaSE8 (from JSR 337) Productivity Performance6 Copyright © 2012 Akira Koyasu. Some rights reserved.
    11. 11. Themes of JavaSE8 (from JSR 337) Productivity Performance Modularity6 Copyright © 2012 Akira Koyasu. Some rights reserved.
    12. 12. JavaSE8 Project Jigsaw Project Lambda HotRockit Nashorn7 Copyright © 2012 Akira Koyasu. Some rights reserved.
    13. 13. Project Jigsaw8 Copyright © 2012 Akira Koyasu. Some rights reserved.
    14. 14. Project Jigsaw No more classpath8 Copyright © 2012 Akira Koyasu. Some rights reserved.
    15. 15. Project Jigsaw No more classpath Escape from “JAR hell” Modular JDK8 Copyright © 2012 Akira Koyasu. Some rights reserved.
    16. 16. module-info.java com.foo com.foo.Main module com.foo {} com.foo.Sub com.foo.util.Tool9 Copyright © 2012 Akira Koyasu. Some rights reserved.
    17. 17. requires com.foo module com.foo { com.foo.Main requires org.bar; com.foo.Sub requires com.baz; } com.foo.util.Tool org.bar com.baz10 Copyright © 2012 Akira Koyasu. Some rights reserved.
    18. 18. @ version module com.foo @ 1.0.0 { requires org.bar @ 1.2.0; com.foo requires com.baz @ 0.8-beta; } org.bar com.baz11 Copyright © 2012 Akira Koyasu. Some rights reserved.
    19. 19. permits com.app module com.foo { permits com.app; requires org.bar; requires com.baz; com.foo } org.bar com.baz12 Copyright © 2012 Akira Koyasu. Some rights reserved.
    20. 20. permits com.other com.app module com.foo { permits com.app; requires org.bar; requires com.baz; com.foo } org.bar com.baz12 Copyright © 2012 Akira Koyasu. Some rights reserved.
    21. 21. permits com.other com.app module com.foo { permits com.app; requires org.bar; requires com.baz; com.foo } org.bar com.baz12 Copyright © 2012 Akira Koyasu. Some rights reserved.
    22. 22. optional module com.foo { requires org.bar; requires com.baz; requires optional org.bar.extra; } com.foo org.bar.extra org.bar com.baz13 Copyright © 2012 Akira Koyasu. Some rights reserved.
    23. 23. optional module com.foo { requires org.bar; requires com.baz; requires optional org.bar.extra; } com.foo org.bar.extra org.bar com.baz13 Copyright © 2012 Akira Koyasu. Some rights reserved.
    24. 24. provides module com.app { requires com.foo.util; requires com.foo.db; } com.app module com.foo.lib { provides com.foo.util; provides com.foo.db; com.foo.lib } com.foo.lib.util com.foo.lib.db14 Copyright © 2012 Akira Koyasu. Some rights reserved.
    25. 25. jpkg $ jpkg -m modules/com.foo jmod com.foo $ ls modules/ com.foo@1.0.0.jmod com.foo15 Copyright © 2012 Akira Koyasu. Some rights reserved.
    26. 26. jmod (1) $ jmod -L mlib create $ jmod -L mlib install /path/to/com.foo@*.jmod /path/to/com.app@*.jmod $ jmod -L mlib ls com.app com.foo@1.0.0 com.app@0.8-beta $ java -L mlib -m com.app com.foo16 Copyright © 2012 Akira Koyasu. Some rights reserved.
    27. 27. jmod (2) $ jmod add-repo http://jig.sfbay $ jmod install jdk.tools http://jig.sfbay jdk.tools@8.0.0.jmod jdk.jndi@8.0.0.jmod17 Copyright © 2012 Akira Koyasu. Some rights reserved.
    28. 28. JavaSE8 Project Jigsaw Project Lambda HotRockit Nashorn18 Copyright © 2012 Akira Koyasu. Some rights reserved.
    29. 29. Project Lambda19 Copyright © 2012 Akira Koyasu. Some rights reserved.
    30. 30. Project Lambda19 ! Copyright © 2012 Akira Koyasu. Some rights reserved.
    31. 31. Project Lambda !19 Copyright © 2012 Akira Koyasu. Some rights reserved.
    32. 32. Project Lambda ! Easy-to-use Parallel19 Copyright © 2012 Akira Koyasu. Some rights reserved.
    33. 33. Project Lambda ! Easy-to-use Parallel Reduce conceptual and syntactic GAP between Serial and Parallel expressions19 Copyright © 2012 Akira Koyasu. Some rights reserved.
    34. 34. class Student public class Student { private int gradYear; private double score; public int getGradYear() { return gradYear; } public void setGradYear(int gradYear) { this.gradYear = gradYear; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } }20 Copyright © 2012 Akira Koyasu. Some rights reserved.
    35. 35. Question21 Copyright © 2012 Akira Koyasu. Some rights reserved.
    36. 36. Question Compute the highest score of the students graduated in 201121 Copyright © 2012 Akira Koyasu. Some rights reserved.
    37. 37. Highest Score with External Iteration List<Student> students = new ArrayList<>(); // ... double hightestScore = 0.0; for (Student s : students) { if (s.getGradYear() == 2011) { if (s.getScore() > hightestScore) { hightestScore = s.getScore(); } } }22 Copyright © 2012 Akira Koyasu. Some rights reserved.
    38. 38. Highest Score with Internal Iteration SmartList<Student> students = new SmartList<>(); // ... double hightestScore = students .filter(new Predicate<Student>() { @Override public boolean eval(Student s) { return s.getGradYear() == 2011; }}) .map(new Mapper<Student, Double>() { @Override public Double map(Student s) { return s.getScore(); }}) .max();23 Copyright © 2012 Akira Koyasu. Some rights reserved.
    39. 39. Highest Score with Internal Iteration SmartList<Student> students = new SmartList<>(); // ... double hightestScore = students .filter(new Predicate<Student>() { @Override public boolean eval(Student s) { return s.getGradYear() == 2011; }}) .map(new Mapper<Student, Double>() { @Override public Double map(Student s) { return s.getScore(); }}) .max();23 Copyright © 2012 Akira Koyasu. Some rights reserved.
    40. 40. with Lambdas List<Student> students = new ArrayList<>(); // ... double hightestScore = students .filter((Student s) -> s.getGradYear() == 2011) .map((Student s) -> s.getScore()) .max();24 Copyright © 2012 Akira Koyasu. Some rights reserved.
    41. 41. with Lambdas and Parallelism List<Student> students = new ArrayList<>(); // ... double hightestScore = students .filter((Student s) -> s.getGradYear() == 2011) .map((Student s) -> s.getScore()) .max();24 Copyright © 2012 Akira Koyasu. Some rights reserved.
    42. 42. with Lambdas and Parallelism List<Student> students = new ArrayList<>(); // ... double hightestScore = students.parallel() .filter((Student s) -> s.getGradYear() == 2011) .map((Student s) -> s.getScore()) .max();24 Copyright © 2012 Akira Koyasu. Some rights reserved.
    43. 43. the Points25 Copyright © 2012 Akira Koyasu. Some rights reserved.
    44. 44. the Points Lambda Expression25 Copyright © 2012 Akira Koyasu. Some rights reserved.
    45. 45. the Points Lambda Expression Default Method25 Copyright © 2012 Akira Koyasu. Some rights reserved.
    46. 46. the Points Lambda Expression Default Method New Interface: ParallelIterable25 Copyright © 2012 Akira Koyasu. Some rights reserved.
    47. 47. Functional Interface26 Copyright © 2012 Akira Koyasu. Some rights reserved.
    48. 48. Functional Interface Functional interface:26 Copyright © 2012 Akira Koyasu. Some rights reserved.
    49. 49. Functional Interface Functional interface: Interface with one method26 Copyright © 2012 Akira Koyasu. Some rights reserved.
    50. 50. Functional Interface Functional interface: Interface with one method java.util.Comparator<T> java.io.FileFilter java.lang.Runnable java.awt.event.ActionListener ...26 Copyright © 2012 Akira Koyasu. Some rights reserved.
    51. 51. Lambda Expression Lambda Expression instantiates a fuctional interface27 Copyright © 2012 Akira Koyasu. Some rights reserved.
    52. 52. Lambda Expression Lambda Expression instantiates a fuctional interface Comparator<String> c = (String x, String y) -> x.length() - y.length();27 Copyright © 2012 Akira Koyasu. Some rights reserved.
    53. 53. Lambda Expression Lambda Expression instantiates a fuctional interface Comparator<String> c = (String x, String y) -> x.length() - y.length(); Comparator<String> c = new Comparator<String>() { = @Override public int compare(String x, String y) { return x.length() - y.length(); }};27 Copyright © 2012 Akira Koyasu. Some rights reserved.
    54. 54. Dilemma Collections need new methods forEach reduce filter sorted map ...28 Copyright © 2012 Akira Koyasu. Some rights reserved.
    55. 55. Dilemma Collections need new methods forEach reduce filter sorted map ... Compatibility?28 Copyright © 2012 Akira Koyasu. Some rights reserved.
    56. 56. Default Method29 Copyright © 2012 Akira Koyasu. Some rights reserved.
    57. 57. Default Method Interface method with default implementation29 Copyright © 2012 Akira Koyasu. Some rights reserved.
    58. 58. Default Method Interface method with default implementation public interface Iterable<T> { Iteratr<T> iterator(); Iterable<T> filter(Predicate<? super T> predicate) default { return Iterables.filter(this, predicate); } void forEach(Block<? super T> block) default { Iterables.forEach(this, block); } // ... }29 Copyright © 2012 Akira Koyasu. Some rights reserved.
    59. 59. New Interface: ParallelIterable ParallelIterable has the same methods as Iterable, except in parallel. forEach reduce filter sorted map ... interface Collection<T> { Collection new method // ... ParallelIterable<T> parallel(); parallel() }30 Copyright © 2012 Akira Koyasu. Some rights reserved.
    60. 60. Method Reference FileFilter filter = new FileFilter() { public boolean accept(File f) { return f.canRead(); } };31 Copyright © 2012 Akira Koyasu. Some rights reserved.
    61. 61. Method Reference FileFilter filter = new FileFilter() { public boolean accept(File f) { return f.canRead(); } }; FileFilter filter = (File f) -> f.canRead();31 Copyright © 2012 Akira Koyasu. Some rights reserved.
    62. 62. Method Reference FileFilter filter = new FileFilter() { public boolean accept(File f) { return f.canRead(); } }; FileFilter filter = (File f) -> f.canRead(); FileFilter filter = File#canRead;31 Copyright © 2012 Akira Koyasu. Some rights reserved.
    63. 63. Highest Score with Lambdas List<Student> students = new ArrayList<>(); // ... double hightestScore = students.parallel() .filter(s -> s.getGradYear() == 2011) .map(Student#getScore()) .max();32 Copyright © 2012 Akira Koyasu. Some rights reserved.
    64. 64. JavaSE8 Project Jigsaw Project Lambda HotRockit Nashorn33 Copyright © 2012 Akira Koyasu. Some rights reserved.
    65. 65. Oracle JVMs34 Copyright © 2012 Akira Koyasu. Some rights reserved.
    66. 66. Oracle JVMs HotSpot from Sun34 Copyright © 2012 Akira Koyasu. Some rights reserved.
    67. 67. Oracle JVMs JRockit HotSpot from BEA from Sun34 Copyright © 2012 Akira Koyasu. Some rights reserved.
    68. 68. Oracle JVMs JRockit HotSpot from BEA from Sun34 Copyright © 2012 Akira Koyasu. Some rights reserved.
    69. 69. Oracle JVMs JRockit HotSpot from BEA from Sun HotRockit34 Copyright © 2012 Akira Koyasu. Some rights reserved.
    70. 70. JRockit35 Copyright © 2012 Akira Koyasu. Some rights reserved.
    71. 71. JRockit jcmd no Perm-Gen Mission Control Flight Recorder Deterministic GC35 Copyright © 2012 Akira Koyasu. Some rights reserved.
    72. 72. JRockit jcmd no Perm-Gen Mission Control (Premium Feature) Flight Recorder (Premium Feature) Deterministic GC (Premium Feature)35 Copyright © 2012 Akira Koyasu. Some rights reserved.
    73. 73. JavaSE8 Project Jigsaw Project Lambda HotRockit Nashorn36 Copyright © 2012 Akira Koyasu. Some rights reserved.
    74. 74. Nashorn New JavaScript Engine in JDK8 Compliance: ECMA-262 Edition 5 (Latest ECMAScript standard) JavaScript & Java call each other37 Copyright © 2012 Akira Koyasu. Some rights reserved.
    75. 75. Native on the JVM AST/IR Java JavaScript Abstract Syntax Tree Intermediate Representation byte code InvokeDynamic uses MethodHandle38 Copyright © 2012 Akira Koyasu. Some rights reserved.
    76. 76. JavaEE7 Copyright © 2012 Akira Koyasu. Some rights reserved.
    77. 77. JavaEE Roadmap 2009 2010 2011 2012 2013 2009/12/10 2013 Q2 JavaEE6 JavaEE7 Extensibility Provisioning Profile 2011/2/28 Elasticity Pruning Multi-tenancy Glassfish Orchestration Server 3.1 Clustering Glassfish Glassfish v3 JavaEE6 support Server 4 JavaEE7 support40 Copyright © 2012 Akira Koyasu. Some rights reserved.
    78. 78. Themes of JavaEE7 (from JSR 342)41 Copyright © 2012 Akira Koyasu. Some rights reserved.
    79. 79. Themes of JavaEE7 (from JSR 342) Cloud41 Copyright © 2012 Akira Koyasu. Some rights reserved.
    80. 80. JavaEE7 PaaS JAX-RS 2.0 JCache42 Copyright © 2012 Akira Koyasu. Some rights reserved.
    81. 81. Platform as a Service the JavaEE7 Platform is a Service43 Copyright © 2012 Akira Koyasu. Some rights reserved.
    82. 82. [IPS]aaS IaaS Infrastructure as a Service PaaS Platform as a Service SaaS Software as a Service44 Copyright © 2012 Akira Koyasu. Some rights reserved.
    83. 83. [IPS]aaS IaaS Infrastructure as a Service PaaS Platform as a Service SaaS Software as a Service Application Middleware OS HW/NW44 Copyright © 2012 Akira Koyasu. Some rights reserved.
    84. 84. [IPS]aaS IaaS Infrastructure as a Service PaaS Platform as a Service SaaS Software as a Service Application Application Middleware Middleware OS OS HW/NW HW/NW44 Copyright © 2012 Akira Koyasu. Some rights reserved.
    85. 85. [IPS]aaS IaaS Infrastructure as a Service PaaS Platform as a Service SaaS Software as a Service Application Application Application Middleware Middleware Middleware OS OS OS HW/NW HW/NW HW/NW44 Copyright © 2012 Akira Koyasu. Some rights reserved.
    86. 86. Key Features45 Copyright © 2012 Akira Koyasu. Some rights reserved.
    87. 87. Key Features Provisioning45 Copyright © 2012 Akira Koyasu. Some rights reserved.
    88. 88. Key Features Provisioning Elasticity45 Copyright © 2012 Akira Koyasu. Some rights reserved.
    89. 89. Key Features Provisioning Elasticity Multi-tenancy45 Copyright © 2012 Akira Koyasu. Some rights reserved.
    90. 90. Provisioning Auto-Provision Services Application Cloud Administration Service Messaging LDAP Service Service Database Application Provision and Initialize Service Container Application Dependencies46 Copyright © 2012 Akira Koyasu. Some rights reserved.
    91. 91. Elasticity Dynamic self-adjusting SLA driven Elasticity Node Node Node Node47 Copyright © 2012 Akira Koyasu. Some rights reserved.
    92. 92. Multi-tenancy Shared Application, Shared Data Source Tenant 1 Tenant 2 Application Data Source Tenant 3 @TenantId48 Copyright © 2012 Akira Koyasu. Some rights reserved.
    93. 93. JavaEE7 PaaS JAX-RS 2.0 JCache49 Copyright © 2012 Akira Koyasu. Some rights reserved.
    94. 94. JAX-RS 2.0 javax.ws.rs JAX-RS Java API for RESTful web services version 1.1 is a part of JavaEE650 Copyright © 2012 Akira Koyasu. Some rights reserved.
    95. 95. JAX-RS Client Server Resource A Resource B51 Copyright © 2012 Akira Koyasu. Some rights reserved.
    96. 96. JAX-RS GET Client POST Server PUT DELETE Resource A Resource B51 Copyright © 2012 Akira Koyasu. Some rights reserved.
    97. 97. JAX-RS GET Client POST Server PUT DELETE Resource A text Resource json B xml byte-stream51 Copyright © 2012 Akira Koyasu. Some rights reserved.
    98. 98. JAX-RS GET Client POST Server PUT Object DELETE Resource A A Object text Resource B json B xml byte-stream51 Copyright © 2012 Akira Koyasu. Some rights reserved.
    99. 99. Define a Resource 1.1 JAX-RS http://example.info/company/1234/employee?id=567852 Copyright © 2012 Akira Koyasu. Some rights reserved.
    100. 100. Define a Resource 1.1 JAX-RS http://example.info/company/1234/employee?id=5678 @Path("/company/{companyId}") public class CompanyResource { @GET @Path("/employee") @Produces(MediaType.TEXT_PLAIN) public String employee( @PathParam("companyId") String companyId, @QueryParam("id") String employeeId) { return findEmployee(companyId, employeeId); } // ... }52 Copyright © 2012 Akira Koyasu. Some rights reserved.
    101. 101. What’s new in JAX-RS 2.0 Client API Improved Conneg Filters & Interceptors Hypermedia Asynchrony Validation JSR-339: Early Draft Review 3 on 07 June, 201253 Copyright © 2012 Akira Koyasu. Some rights reserved.
    102. 102. Client API Client client = ClientFactory.newClient(); String employeeName = client .target("http://../campany/{campanyId}/employee") .pathParam("campanyId", "1234") .queryParam("id", "5678") .request(MediaType.TEXT_PLAIN) .get(String.class);54 Copyright © 2012 Akira Koyasu. Some rights reserved.
    103. 103. Filters Resource A Resource B55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    104. 104. Filters Request Resource A Resource B55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    105. 105. Filters Request Resource A Response Resource B55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    106. 106. Filters Request Resource A Response Resource B55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    107. 107. Filters Request Resource A Response Resource B Response55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    108. 108. Filters Request PreMatchFilter (server side only) Filter 1 Resource A Response Resource B Response55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    109. 109. Filters Request PreMatchFilter (server side only) Filter 1 RequestFilter Filter 2 Filter 3 Resource A Response Filter 2 Filter 3 Resource B Response55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    110. 110. Filters Request PreMatchFilter (server side only) Filter 1 RequestFilter Filter 2 Filter 3 Resource A Response Filter 5 Filter 4 ResponseFilter Filter 2 Filter 3 Resource B Response55 Copyright © 2012 Akira Koyasu. Some rights reserved.
    111. 111. Interceptors @Consumes ("application/widget+xml") MessageBodyReader <Widget> Resource A @Produces ("application/widget+xml") MessageBodyWriter <Widget>56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    112. 112. Interceptors Request @Consumes ("application/widget+xml") MessageBodyReader <Widget> Resource A @Produces ("application/widget+xml") MessageBodyWriter <Widget>56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    113. 113. Interceptors Request @Consumes ("application/widget+xml") MessageBodyReader <Widget> Widget Resource A @Produces ("application/widget+xml") MessageBodyWriter <Widget>56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    114. 114. Interceptors Request @Consumes ("application/widget+xml") MessageBodyReader <Widget> Widget Resource A @Produces ("application/widget+xml") MessageBodyWriter <Widget> Widget56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    115. 115. Interceptors Request @Consumes ("application/widget+xml") MessageBodyReader <Widget> Widget Resource A Response @Produces ("application/widget+xml") MessageBodyWriter <Widget> Widget56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    116. 116. Interceptors Request ReaderInterceptor <Widget> @Consumes ("application/widget+xml") MessageBodyReader <Widget> Widget Resource A Response WriterInterceptor @Produces <Widget> ("application/widget+xml") MessageBodyWriter <Widget> Widget56 Copyright © 2012 Akira Koyasu. Some rights reserved.
    117. 117. Asynchrony (server side) Suspend & Resume connections javax.ws.rs.core.ExecutionContext @Path("/async/longRunning") public class MyResource { @Context ExecutionContext ctx; @GET @Produces("text/plain") public void longRunningOp() { Executors.newSingleThreadExecutor().submit(new Runnable() { public void run() { executeLongRunningOp(); ctx.resume("Hello async world!"); }}); ctx.suspend(); } }57 Copyright © 2012 Akira Koyasu. Some rights reserved.
    118. 118. Asynchrony (client side) AsyncInvoker AsyncInvoker async = client .target("http://.../campany/{campanyId}/employee") .pathParam("campanyId", "1234") .queryParam("id", "5678") .request(MediaType.TEXT_PLAIN) .async(); // Future<Response> Future<Response> fresponse = async.get(); // InvocationCallback<T> Future<String> fstring = async.get(new InvocationCallback<String>(){ @Override public void completed(String response) { /* ... */ } @Override public void failed(ClientException error) { /* ... */ } });58 Copyright © 2012 Akira Koyasu. Some rights reserved.
    119. 119. JavaEE7 PaaS JAX-RS 2.0 JCache59 Copyright © 2012 Akira Koyasu. Some rights reserved.
    120. 120. JCache javax.cache Standard Caching API60 Copyright © 2012 Akira Koyasu. Some rights reserved.
    121. 121. JCache javax.cache Standard Caching API Expiration Mutual exclusion Spooling Consistency60 Copyright © 2012 Akira Koyasu. Some rights reserved.
    122. 122. Basic Use CacheManager cacheManager = Caching.getCacheManager(); Cache<Integer, String> cache = cacheManager.getCache("example"); if (cache == null) { cache = cacheManager .<Integer, String>createCacheBuilder("example") .setExpiry(ExpiryType.MODIFIED, new Duration(TimeUnit.SECONDS, 300L)) .build(); } Integer key = Integer.valueOf(1); String value = "val1"; cache.put(key, value); String value2 = cache.get(key);61 Copyright © 2012 Akira Koyasu. Some rights reserved.
    123. 123. Atomic Operation cache.getAndRemove(key); cache.getAndReplace(key, value2); cache.putIfAbsent(key, value); cache.replace(key, value); cache.replace(key, value, value2);62 Copyright © 2012 Akira Koyasu. Some rights reserved.
    124. 124. Annotation @CacheDefaults(cacheName="myScheduler") public class MyScheduler { @CachePut public void create( @CacheKeyParam String id, @CacheValue Schedule schedule) { /* ... */ } @CacheResult public Schedule get(String id) { /* ... */ } @CacheRemoveEntry public void remove(String id) { /* ... */ } }63 Copyright © 2012 Akira Koyasu. Some rights reserved.
    125. 125. Conclusion Copyright © 2012 Akira Koyasu. Some rights reserved.
    126. 126. Conclusion65 Copyright © 2012 Akira Koyasu. Some rights reserved.
    127. 127. Conclusion Revolution is coming, Don’t miss it!65 Copyright © 2012 Akira Koyasu. Some rights reserved.
    128. 128. JavaOne 2012 Sept 30-Oct 466 Copyright © 2012 Akira Koyasu. Some rights reserved.
    129. 129. Notes This work is licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/ licenses/by-nc/3.0/.67 Copyright © 2012 Akira Koyasu. Some rights reserved.

    ×