SlideShare una empresa de Scribd logo
1 de 55
What is new in Java SE
7 and – Java Enterprise
Edition 6
Eugene Bogaart
Solution Architect
Sun Microsystems

                          1
JDK 7 Features
> Language
 • Annotations on Java types
 • Small language changes (Project Coin)
 • Modularity (JSR-294)
> Core
 •   Modularisation (Project Jigsaw)
 •   Concurrency and collections updates
 •   More new IO APIs (NIO.2)
 •   Additional network protocol support
 •   Eliptic curve cryptography
 •   Unicode 5.1
                                           2
JDK 7 Features
> VM
 • Compressed 64-bit pointers
 • Garbage-First GC
 • Support for dynamic languages (Da Vinci Machine
   project)
> Client
 • Forward port Java SE6 u10 features
 • XRender pipeline for Java 2D




                                                     3
Modularity
 Project Jigsaw



                  4
New Module System for Java
• JSR-294 Improved Modularity Support in the Java
  Programming Language
• Requirements for JSR-294
  >   Integrate with the VM
  >   Integrate with the language
  >   Integrate with (platform's) native packaging
  >   Support multi-module packages
  >   Support “friend” modules
• Open JDK's Project Jigsaw
  > Reference implementation for JSR-294
  > openjdk.java.net/projects/jigsaw
  > Can have other type of module systems based on OSGi, IPS,
      Debian, etc.
                                                                5
Modularizing You Code
planetjdk/src/
            org/planetjdk/aggregator/Main.java



                    Modularize


planetjdk/src/
            org/planetjdk/aggregator/Main.java
            module-info.java


                                                 6
module-info.java                   Module name

 module org.planetjdk.aggregator {
                                 Module system
    system jigsaw;
    requires module jdom;
    requires module tagsoup;
    requires module rome;
                                     Dependencies
    requires module rome-fetcher;
    requires module joda-time;
    requires module java-xml;
    requires module java-base;
    class org.planetjdk.aggregator.Main;
 }                                     Main class
                                                    7
Module Versioning
module org.planetjdk.aggregator @ 1.0 {
   system jigsaw;
   requires module jdom @ 1.*;
   requires module tagsoup @ 1.2.*;
   requires module rome @ =1.0;
   requires module rome-fetcher @ =1.0;
   requires module joda-time @ [1.6,2.0);
   requires module java-xml @ 7.*;
   requires module java-base @ 7.*;
   class org.planetjdk.aggregator.Main;
}
                                            8
Small
(Language)
 Changes
  Project Coin

                 9
Better Integer Literals
• Binary literals
 int mask = 0b1010;
• With underscores
 int bigMask = 0b1010_0101;
 long big = 9_223_783_036_967_937L;
• Unsigned literals
 byte b = 0xffu;



                                      10
Better Type Inference

 Map<String, Integer> foo =
     new HashMap<String, Integer>();

 Map<String, Integer> foo =
     new HashMap<>();




                                       11
Strings in Switch
• Strings are constants too
       String s = ...;
       switch (s) {
         case "foo":
            return 1;

           case "bar":
             Return 2;

           default:
             return 0;
       }
                              12
Resource Management
• Manually closing resources is tricky and tedious
public void copy(String src, String dest) throws IOException {
   InputStream in = new FileInputStream(src);
   try {
       OutputStream out = new FileOutputStream(dest);
       try {
          byte[] buf = new byte[8 * 1024];
          int n;
          while ((n = in.read(buf)) >= 0)
              out.write(buf, 0, n);
       } finally {
          out.close();
       }
   } finally {
       in.close();
}}
                                                           13
Automatic Resource Management

static void copy(String src, String dest)
      throws IOException {
    try (InputStream in = new FileInputStream(src);
         OutputStream out = new FileOutputStream(dest)) {
        byte[] buf = new byte[8192];
        int n;
        while ((n = in.read(buf)) >= 0)
            out.write(buf, 0, n);
    }
   //in and out closes
}



                                                        14
Index Syntax for Lists and Maps

List<String> list =
  Arrays.asList(new String[] {"a", "b", "c"});
String firstElement = list[0];

Map<Integer, String> map = new HashMap<>();
map[Integer.valueOf(1)] = "One";




                                              15
Dynamic
 Languages
  Support
Da Vinci Machine Project

                           16
JVM Specification



“The Java virtual machine knows nothing
about the Java programming language, only
of a particular binary format, the class file
format.”
                         1.2 The Java Virtual Machine



                                                        17
Languages Running on the JVM
                                                                           Tea              iScript
 Zigzag                                           JESS                       Jickle
                      Modula-2                                    Lisp
          Correlate                    Nice
                                                         CAL
                                                                           JudoScript
                                                                                      JavaScript
                              Simkin                 Drools     Basic
 Icon       Groovy                       Eiffel                                               Luck
                                                         v-language               Pascal
                              Prolog          Mini
                      Tcl                                         PLAN        Hojo            Scala
Rexx                        JavaFX Script                                Funnel
            Tiger           Anvil                               Yassl                     FScript
                                                                                      Oberon
    E                               Smalltalk
            Logo  Tiger                                          JHCR         JRuby
  Ada                G                                         Scheme                         Sather
                          Clojure
                                                                         Phobos
 Processing    WebL Dawn                                   TermWare
                                                                                           Sleep
                        LLP                                                  Pnuts         Bex Script
         BeanShell        Forth                           PHP
                                       C#
                                              Yoix           SALSA        ObjectScript
                        Jython                            Piccola                                            18


                                                                                                        18
InvokeDynamic Bytecode
• JVM currently has four ways to invoke method
  > Invokevirtual, invokeinterface, invokestatic, invokespecial
• All require full method signature data
• InvokeDynamic will use method handle
  > Effectively an indirect pointer to the method
• When dynamic method is first called bootstrap code
  determines method and creates handle
• Subsequent calls simply reference defined handle
• Type changes force a re-compute of the method location
  and an update to the handle
  > Method call changes are invisible to calling code
                                                                  19
Bootstrapping Method Handle




                              20
invokedynamic Byte Code


                              Call site reifies the call




pink = CallSite object
green = MethodHandle object
                                                           21
JDK 7 Milestone Timeline
• M5        29 Oct 2009
    >   Concurrency and collections updates (jsr166y)
    >   Elliptic-curve cryptography (ECC)
    >   JSR TBD: Small language enhancements (Project Coin)
    >   Swing updates
    >   Update the XML stack
•   M6      18 Feb 2010
•   M7      15 Apr 2010
•   M8      3 Jun 2010             Feature complete
•   M9      22 Jul 2010
•   M10     9 Sep 2010
                                                              22
More information
• On OpenJDK7
• http://www.javapassion.com/javaee6/




                                        23
Java EE: Past & Present
                                                                         Rightsizing
                                                           Ease of
                                                         Development    Java EE 6
                                               Web
                                              Services                   Pruning
                                                         Java EE 5      Extensibility
                             Robustness                                  Profiles
           Enterprise Java                                 Ease of
              Platform
                                            J2EE 1.4     Development     Ease of
                                                                        Development
                                                         Annotations
                             J2EE 1.3          Web                       EJB Lite
            J2EE 1.2                         Services      EJB 3.0
                                                                         RESTful
                                            Management
                                CMP                      Persistence     Services
               Servlet                      Deployment
  JPE                         Connector                   New and       Dependency
 Project        JSP          Architecture     Async.      Updated        Ejection
                EJB                          Connector   Web Services
                JMS                                                     Web Profile
              RMI/IIOP

                                                                                        24
Java EE 6
Final release December
         10, 2009


                         25
Java EE 5
J2EE 1.4                   Java EE 5
• Deployment               • Java language
  descriptors                annotations @
• Required container       • Plain Old Java Objects
  interfaces                 (POJOs)
• JNDI Lookups             • Dependency Injection
• Deployment               • More and better defaults
  descriptor, interfaces
• No Supported UI          • Java Server Faces(JSF)
  Framework
                                                    26
Java EE 6
 GOALS



            27
Java EE 6 Platform
Goals
• Rightsizing
  > Flexible
  > Lighter weight
• Extensible
  > Embrace Open Source
     Frameworks
• Productive
  > Improve on Java EE 5

                           28
Rightsizing the Platform
Platform Flexibility

• Decouple specifications to
  allow more combinations
• Expand potiential licensee
  ecosystem
• Profiles
  > Targeted technology bundles
  > Web Profile


                                  29
About Profiles
•   Profiles are targeted bundles of technologies
•   (Simple) rules set by platform spec
•   Profiles can be subsets, supersets or overlapping
•   First profile: the Web Profile
•   Decoupling of specs to allow more combinations
•   Future profiles defined in the Java Community
    Process



                                                        30
Rightsizing the Platform
Web Profile

• Fully functional mid-sized
  profile
• Actively discussed
  > Expert Group
  > Industry
• Technologies
  > Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP
    2.2, EL 1.2, JSTL 1.2, JSF 2.0, JTA
    1.1, JSR 45, Common Annotations
                                              31
Rightsizing the Platform
Pruning (Deprecation)

• Some technologies optional
  > Optional in next release
  > Deleted in subsequent release
  > Marked in Javadocs
• Pruning list
  >   JAX-RPC
  >   EJB 2.x Entity Beans
  >   JAXR
  >   JSR-85 (Rules based Auth & Audit)
                                          32
About Pruning
• Make some technologies optional
• Reduce the real and conceptual footprint
• Same rules as proposed by the Java SE
  > “pruned now, optional in the next release”
• Pruned technologies will be marked in the javadocs
• Current pruning list:
  > JAX-RPC, EJB Entity Beans, JAXR, JSR-88




                                                       33
Rightsizing the Platform
Extensibility

• Embrace open source
  libraries and frameworks
• Zero-configuration, drag-n-
  drop web frameworks
  > Servlets, servlet filters
  > Framework context listeners
    are discovered & registered
• Plugin library jars using Web
  Fragments
                                  34
Ease of Development
Extensibility

•   Continue Java EE 5 advancements
•   Primary focus: Web Tier
•   Multiple areas easier to use: EJB 3.1
•   General Principles
    > Annotation-based programming model
    > Reduce or eliminate need for
      deployment descriptors
    > Traditional API for advanced users


                                            35
About Extensibility
• Embrace open source libraries and frameworks
• Zero-configuration, drag-and-drop for web
  frameworks
  > Monolithic web.xml can become complex to maintain as
    the dependencies of the application increases
  > Servlets, servlet filters, context listeners for a framework
    get discovered and registered automatically
• Completely general solution using web fragments
• Scripting languages can use the same mechanism


                                                                   36
Ease of Development
•   Ongoing effort
•   This time focus is the web tier
•   Lots of opportunities in other areas, e.g. EJB
•   General principles:
    > Use of annotations across all web APIs
    > Reduce or eliminate need for deployment descriptors
       – No editing of web.xml required
    > Self-registration of third-party libraries
    > Simplified packaging
    > JAX-RS for RESTful web services
    > Get technologies to work together well
                                                            37
Java EE 6
Platform Summary



                   38
Java EE 6 Platform
What's New?

• Several new APIs
• Web Profile
• Pluggability/extensibility
• Dependency injection
• Many improvements to APIs


                               39
Java EE 6 Platform
New Technologies

• JAX-RS 1.1
• Bean Validation 1.0
• Dependency injection 1.0
• CDI 1.0
• Managed Beans 1.0


                             40
Java EE 6 Platform
Updated Technolgies

• EJB 3.1        • JAX-WS 2.2
• JPA 2.0        • JSR-109 1.3
• Servlet 3.0    • JSP 2.2
• JSF 2.0        • EL 2.2
• Connectors 1.6 • JSR-250 1.1
• Interceptors 1.1 • JACC 1.4
                 • JASPIC 1.0    41
Java EE 6
 Samples



            42
Ease of Development
Adding an EJB to a Web Application

                 ShoppingCart
  BuyBooks.war    EJB Class          BuyBooks.war



                 ShoppingCart.jar
                                     ShoppingCart
                                      EJB Class

  BuyBooks.ear

                                                    43
Java EE Platform 5 Packaging




                               44
Java EE Platform 6 Packaging




                               45
Session Bean with No - Interface




                                   46
Ease of Development - Annotations
Servlet in Java EE 5: Create two source files
/* Code in Java Class */         <!--Deployment descriptor web.xml
                                    -->
package com.foo;                 <web-app>
public class MyServlet extends      <servlet>
HttpServlet {                           <servlet-name>MyServlet
public void                              </servlet-name>
doGet(HttpServletRequest                <servlet-class>
req,HttpServletResponse res)              com.foo.MyServlet
                                        </servlet-class>
{                                   </servlet>
                                    <servlet-mapping>
...                                     <servlet-name>MyServlet
                                        </servlet-name>
}                                       <url-pattern>/myApp/*
                                        </url-pattern>
...                                 </servlet-mapping>
                                    ...
}                                </web-app>

                                                                     47
Ease of Development - Annotations
Servlet in Java EE 5: Java Class
/* Code in Java Class */

package com.foo;

public class MyServlet extends HttpServlet {

    public void doGet(HttpServletRequest req,HttpServletResponse res) {
        /* doGet body */
    }
}




                                                                          48
Ease of Development - Annotations
Servlet in Java EE 5: Descriptor
 <!--Deployment descriptor web.xml -->
 <web-app>
    <servlet>
        <servlet-name>MyServlet
         </servlet-name>
        <servlet-class>
          com.foo.MyServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>MyServlet
        </servlet-name>
        <url-pattern>/myApp/*
        </url-pattern>
    </servlet-mapping>
    ...
 </web-app>


                                         49
Ease of Development - Annotations
Java EE 6 Servlet: Single Source file (many cases)

package com.foo;
@WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”)
public class MyServlet extends HttpServlet {
   public void doGet(HttpServletRequest req,
                   HttpServletResponse res)
   {
      ...
   }




                                                       50
Demos
Java EE 6

            51
Demo Setup



                   Enterprise       Java
  JavaServer
                  Java Beans     Persistence      JavaDB
     Faces
                   (Business         API        (Database)
 (presentation)
                     Logic)     (Data Access)




                                                             52
Summary
•   Java continues to evolve
•   JDK7 driving changes in the platform
•   JavaFX providing a RIA platform built on Java
•   More to come...




                                                    53
More information
• Tutorial On Java EE 6
• Webinar on Java EE 6
• http://www.javapassion.com/javaee6/




                                        54
Thanks
Eugene Bogaart
Eugene.Bogaart@sun.com


                         55

Más contenido relacionado

La actualidad más candente

Turmeric SOA Cloud Mashups
Turmeric SOA Cloud MashupsTurmeric SOA Cloud Mashups
Turmeric SOA Cloud Mashupskingargyle
 
Know yourengines velocity2011
Know yourengines velocity2011Know yourengines velocity2011
Know yourengines velocity2011Demis Bellot
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHoward Lewis Ship
 
Introduction to Clojure
Introduction to ClojureIntroduction to Clojure
Introduction to ClojureRenzo Borgatti
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64The Linux Foundation
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmerselliando dias
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmerselliando dias
 
Clojure talk at Münster JUG
Clojure talk at Münster JUGClojure talk at Münster JUG
Clojure talk at Münster JUGAlex Ott
 
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeAlexander Shopov
 
Lifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java BytecodeLifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java BytecodeAlexander Shopov
 
Lifting The Veil - Reading Java Bytecode During Lunchtime
Lifting The Veil - Reading Java Bytecode During LunchtimeLifting The Veil - Reading Java Bytecode During Lunchtime
Lifting The Veil - Reading Java Bytecode During LunchtimeAlexander Shopov
 
javascript teach
javascript teachjavascript teach
javascript teachguest3732fa
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRubyFrederic Jean
 

La actualidad más candente (14)

Turmeric SOA Cloud Mashups
Turmeric SOA Cloud MashupsTurmeric SOA Cloud Mashups
Turmeric SOA Cloud Mashups
 
Know yourengines velocity2011
Know yourengines velocity2011Know yourengines velocity2011
Know yourengines velocity2011
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
Introduction to Clojure
Introduction to ClojureIntroduction to Clojure
Introduction to Clojure
 
XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64XS Boston 2008 Paravirt Ops in Linux IA64
XS Boston 2008 Paravirt Ops in Linux IA64
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
Clojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp ProgrammersClojure - An Introduction for Lisp Programmers
Clojure - An Introduction for Lisp Programmers
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
 
Clojure talk at Münster JUG
Clojure talk at Münster JUGClojure talk at Münster JUG
Clojure talk at Münster JUG
 
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java Bytecode
 
Lifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java BytecodeLifting The Veil - Reading Java Bytecode
Lifting The Veil - Reading Java Bytecode
 
Lifting The Veil - Reading Java Bytecode During Lunchtime
Lifting The Veil - Reading Java Bytecode During LunchtimeLifting The Veil - Reading Java Bytecode During Lunchtime
Lifting The Veil - Reading Java Bytecode During Lunchtime
 
javascript teach
javascript teachjavascript teach
javascript teach
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRuby
 

Destacado

Pro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXPro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXStephen Chin
 
Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFXEugene Bogaart
 
Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014manolitto
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXBruno Borges
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewEugene Bogaart
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Bruno Borges
 
JavaOneで聴いてきたディープなJavaFXセッション
JavaOneで聴いてきたディープなJavaFXセッションJavaOneで聴いてきたディープなJavaFXセッション
JavaOneで聴いてきたディープなJavaFXセッションTakashi Aoe
 

Destacado (7)

Pro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXPro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFX
 
Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFX
 
Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014Ankor Presentation @ JavaOne San Francisco September 2014
Ankor Presentation @ JavaOne San Francisco September 2014
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 Overview
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
JavaOneで聴いてきたディープなJavaFXセッション
JavaOneで聴いてきたディープなJavaFXセッションJavaOneで聴いてきたディープなJavaFXセッション
JavaOneで聴いてきたディープなJavaFXセッション
 

Similar a What is new and cool j2se & java

Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 
Java 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kolliparaJava 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kolliparaManjula Kollipara
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute projectDmitry Buzdin
 
JCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJoseph Kuo
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprisebenbrowning
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyelliando dias
 
L Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsL Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyAlexandre Morgaut
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RaceBaruch Sadogursky
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMRaimonds Simanovskis
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Arun Gupta
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)smancke
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 

Similar a What is new and cool j2se & java (20)

Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 
Java 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kolliparaJava 7 Dolphin manjula kollipara
Java 7 Dolphin manjula kollipara
 
Understanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual MachineUnderstanding the Dalvik Virtual Machine
Understanding the Dalvik Virtual Machine
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute project
 
JCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of JavaJCConf 2018 - Retrospect and Prospect of Java
JCConf 2018 - Retrospect and Prospect of Java
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprise
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
 
L Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformaticsL Fu - Dao: a novel programming language for bioinformatics
L Fu - Dao: a novel programming language for bioinformatics
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love story
 
JavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI MigratJavaOne 2010: OSGI Migrat
JavaOne 2010: OSGI Migrat
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
JRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVMJRuby - Programmer's Best Friend on JVM
JRuby - Programmer's Best Friend on JVM
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)Jalimo Slides Linuxtag2007 (English)
Jalimo Slides Linuxtag2007 (English)
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 

Más de Eugene Bogaart

EDA With Glassfish ESB Jfall IEP Intelligent Event Processing
EDA With Glassfish ESB Jfall IEP Intelligent Event ProcessingEDA With Glassfish ESB Jfall IEP Intelligent Event Processing
EDA With Glassfish ESB Jfall IEP Intelligent Event ProcessingEugene Bogaart
 
Glassfish Overview 29 Oktober 2009
Glassfish Overview 29 Oktober 2009Glassfish Overview 29 Oktober 2009
Glassfish Overview 29 Oktober 2009Eugene Bogaart
 
Gf University 27may09 Amersfoort
Gf University 27may09 AmersfoortGf University 27may09 Amersfoort
Gf University 27may09 AmersfoortEugene Bogaart
 
Glass Fish V3 University Amers May2009
Glass Fish V3  University Amers May2009Glass Fish V3  University Amers May2009
Glass Fish V3 University Amers May2009Eugene Bogaart
 
Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Eugene Bogaart
 
Glassfish Overview for Sogeti 20090225
Glassfish Overview for Sogeti 20090225Glassfish Overview for Sogeti 20090225
Glassfish Overview for Sogeti 20090225Eugene Bogaart
 

Más de Eugene Bogaart (6)

EDA With Glassfish ESB Jfall IEP Intelligent Event Processing
EDA With Glassfish ESB Jfall IEP Intelligent Event ProcessingEDA With Glassfish ESB Jfall IEP Intelligent Event Processing
EDA With Glassfish ESB Jfall IEP Intelligent Event Processing
 
Glassfish Overview 29 Oktober 2009
Glassfish Overview 29 Oktober 2009Glassfish Overview 29 Oktober 2009
Glassfish Overview 29 Oktober 2009
 
Gf University 27may09 Amersfoort
Gf University 27may09 AmersfoortGf University 27may09 Amersfoort
Gf University 27may09 Amersfoort
 
Glass Fish V3 University Amers May2009
Glass Fish V3  University Amers May2009Glass Fish V3  University Amers May2009
Glass Fish V3 University Amers May2009
 
Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520Glassfish Overview Fontys 20090520
Glassfish Overview Fontys 20090520
 
Glassfish Overview for Sogeti 20090225
Glassfish Overview for Sogeti 20090225Glassfish Overview for Sogeti 20090225
Glassfish Overview for Sogeti 20090225
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

What is new and cool j2se & java

  • 1. What is new in Java SE 7 and – Java Enterprise Edition 6 Eugene Bogaart Solution Architect Sun Microsystems 1
  • 2. JDK 7 Features > Language • Annotations on Java types • Small language changes (Project Coin) • Modularity (JSR-294) > Core • Modularisation (Project Jigsaw) • Concurrency and collections updates • More new IO APIs (NIO.2) • Additional network protocol support • Eliptic curve cryptography • Unicode 5.1 2
  • 3. JDK 7 Features > VM • Compressed 64-bit pointers • Garbage-First GC • Support for dynamic languages (Da Vinci Machine project) > Client • Forward port Java SE6 u10 features • XRender pipeline for Java 2D 3
  • 5. New Module System for Java • JSR-294 Improved Modularity Support in the Java Programming Language • Requirements for JSR-294 > Integrate with the VM > Integrate with the language > Integrate with (platform's) native packaging > Support multi-module packages > Support “friend” modules • Open JDK's Project Jigsaw > Reference implementation for JSR-294 > openjdk.java.net/projects/jigsaw > Can have other type of module systems based on OSGi, IPS, Debian, etc. 5
  • 6. Modularizing You Code planetjdk/src/ org/planetjdk/aggregator/Main.java Modularize planetjdk/src/ org/planetjdk/aggregator/Main.java module-info.java 6
  • 7. module-info.java Module name module org.planetjdk.aggregator { Module system system jigsaw; requires module jdom; requires module tagsoup; requires module rome; Dependencies requires module rome-fetcher; requires module joda-time; requires module java-xml; requires module java-base; class org.planetjdk.aggregator.Main; } Main class 7
  • 8. Module Versioning module org.planetjdk.aggregator @ 1.0 { system jigsaw; requires module jdom @ 1.*; requires module tagsoup @ 1.2.*; requires module rome @ =1.0; requires module rome-fetcher @ =1.0; requires module joda-time @ [1.6,2.0); requires module java-xml @ 7.*; requires module java-base @ 7.*; class org.planetjdk.aggregator.Main; } 8
  • 9. Small (Language) Changes Project Coin 9
  • 10. Better Integer Literals • Binary literals int mask = 0b1010; • With underscores int bigMask = 0b1010_0101; long big = 9_223_783_036_967_937L; • Unsigned literals byte b = 0xffu; 10
  • 11. Better Type Inference Map<String, Integer> foo = new HashMap<String, Integer>(); Map<String, Integer> foo = new HashMap<>(); 11
  • 12. Strings in Switch • Strings are constants too String s = ...; switch (s) { case "foo": return 1; case "bar": Return 2; default: return 0; } 12
  • 13. Resource Management • Manually closing resources is tricky and tedious public void copy(String src, String dest) throws IOException { InputStream in = new FileInputStream(src); try { OutputStream out = new FileOutputStream(dest); try { byte[] buf = new byte[8 * 1024]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } finally { out.close(); } } finally { in.close(); }} 13
  • 14. Automatic Resource Management static void copy(String src, String dest) throws IOException { try (InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dest)) { byte[] buf = new byte[8192]; int n; while ((n = in.read(buf)) >= 0) out.write(buf, 0, n); } //in and out closes } 14
  • 15. Index Syntax for Lists and Maps List<String> list = Arrays.asList(new String[] {"a", "b", "c"}); String firstElement = list[0]; Map<Integer, String> map = new HashMap<>(); map[Integer.valueOf(1)] = "One"; 15
  • 16. Dynamic Languages Support Da Vinci Machine Project 16
  • 17. JVM Specification “The Java virtual machine knows nothing about the Java programming language, only of a particular binary format, the class file format.” 1.2 The Java Virtual Machine 17
  • 18. Languages Running on the JVM Tea iScript Zigzag JESS Jickle Modula-2 Lisp Correlate Nice CAL JudoScript JavaScript Simkin Drools Basic Icon Groovy Eiffel Luck v-language Pascal Prolog Mini Tcl PLAN Hojo Scala Rexx JavaFX Script Funnel Tiger Anvil Yassl FScript Oberon E Smalltalk Logo Tiger JHCR JRuby Ada G Scheme Sather Clojure Phobos Processing WebL Dawn TermWare Sleep LLP Pnuts Bex Script BeanShell Forth PHP C# Yoix SALSA ObjectScript Jython Piccola 18 18
  • 19. InvokeDynamic Bytecode • JVM currently has four ways to invoke method > Invokevirtual, invokeinterface, invokestatic, invokespecial • All require full method signature data • InvokeDynamic will use method handle > Effectively an indirect pointer to the method • When dynamic method is first called bootstrap code determines method and creates handle • Subsequent calls simply reference defined handle • Type changes force a re-compute of the method location and an update to the handle > Method call changes are invisible to calling code 19
  • 21. invokedynamic Byte Code Call site reifies the call pink = CallSite object green = MethodHandle object 21
  • 22. JDK 7 Milestone Timeline • M5 29 Oct 2009 > Concurrency and collections updates (jsr166y) > Elliptic-curve cryptography (ECC) > JSR TBD: Small language enhancements (Project Coin) > Swing updates > Update the XML stack • M6 18 Feb 2010 • M7 15 Apr 2010 • M8 3 Jun 2010 Feature complete • M9 22 Jul 2010 • M10 9 Sep 2010 22
  • 23. More information • On OpenJDK7 • http://www.javapassion.com/javaee6/ 23
  • 24. Java EE: Past & Present Rightsizing Ease of Development Java EE 6 Web Services Pruning Java EE 5 Extensibility Robustness Profiles Enterprise Java Ease of Platform J2EE 1.4 Development Ease of Development Annotations J2EE 1.3 Web EJB Lite J2EE 1.2 Services EJB 3.0 RESTful Management CMP Persistence Services Servlet Deployment JPE Connector New and Dependency Project JSP Architecture Async. Updated Ejection EJB Connector Web Services JMS Web Profile RMI/IIOP 24
  • 25. Java EE 6 Final release December 10, 2009 25
  • 26. Java EE 5 J2EE 1.4 Java EE 5 • Deployment • Java language descriptors annotations @ • Required container • Plain Old Java Objects interfaces (POJOs) • JNDI Lookups • Dependency Injection • Deployment • More and better defaults descriptor, interfaces • No Supported UI • Java Server Faces(JSF) Framework 26
  • 27. Java EE 6 GOALS 27
  • 28. Java EE 6 Platform Goals • Rightsizing > Flexible > Lighter weight • Extensible > Embrace Open Source Frameworks • Productive > Improve on Java EE 5 28
  • 29. Rightsizing the Platform Platform Flexibility • Decouple specifications to allow more combinations • Expand potiential licensee ecosystem • Profiles > Targeted technology bundles > Web Profile 29
  • 30. About Profiles • Profiles are targeted bundles of technologies • (Simple) rules set by platform spec • Profiles can be subsets, supersets or overlapping • First profile: the Web Profile • Decoupling of specs to allow more combinations • Future profiles defined in the Java Community Process 30
  • 31. Rightsizing the Platform Web Profile • Fully functional mid-sized profile • Actively discussed > Expert Group > Industry • Technologies > Servlet 3.0, EJB Lite 3.1, JPA 2.0, JSP 2.2, EL 1.2, JSTL 1.2, JSF 2.0, JTA 1.1, JSR 45, Common Annotations 31
  • 32. Rightsizing the Platform Pruning (Deprecation) • Some technologies optional > Optional in next release > Deleted in subsequent release > Marked in Javadocs • Pruning list > JAX-RPC > EJB 2.x Entity Beans > JAXR > JSR-85 (Rules based Auth & Audit) 32
  • 33. About Pruning • Make some technologies optional • Reduce the real and conceptual footprint • Same rules as proposed by the Java SE > “pruned now, optional in the next release” • Pruned technologies will be marked in the javadocs • Current pruning list: > JAX-RPC, EJB Entity Beans, JAXR, JSR-88 33
  • 34. Rightsizing the Platform Extensibility • Embrace open source libraries and frameworks • Zero-configuration, drag-n- drop web frameworks > Servlets, servlet filters > Framework context listeners are discovered & registered • Plugin library jars using Web Fragments 34
  • 35. Ease of Development Extensibility • Continue Java EE 5 advancements • Primary focus: Web Tier • Multiple areas easier to use: EJB 3.1 • General Principles > Annotation-based programming model > Reduce or eliminate need for deployment descriptors > Traditional API for advanced users 35
  • 36. About Extensibility • Embrace open source libraries and frameworks • Zero-configuration, drag-and-drop for web frameworks > Monolithic web.xml can become complex to maintain as the dependencies of the application increases > Servlets, servlet filters, context listeners for a framework get discovered and registered automatically • Completely general solution using web fragments • Scripting languages can use the same mechanism 36
  • 37. Ease of Development • Ongoing effort • This time focus is the web tier • Lots of opportunities in other areas, e.g. EJB • General principles: > Use of annotations across all web APIs > Reduce or eliminate need for deployment descriptors – No editing of web.xml required > Self-registration of third-party libraries > Simplified packaging > JAX-RS for RESTful web services > Get technologies to work together well 37
  • 38. Java EE 6 Platform Summary 38
  • 39. Java EE 6 Platform What's New? • Several new APIs • Web Profile • Pluggability/extensibility • Dependency injection • Many improvements to APIs 39
  • 40. Java EE 6 Platform New Technologies • JAX-RS 1.1 • Bean Validation 1.0 • Dependency injection 1.0 • CDI 1.0 • Managed Beans 1.0 40
  • 41. Java EE 6 Platform Updated Technolgies • EJB 3.1 • JAX-WS 2.2 • JPA 2.0 • JSR-109 1.3 • Servlet 3.0 • JSP 2.2 • JSF 2.0 • EL 2.2 • Connectors 1.6 • JSR-250 1.1 • Interceptors 1.1 • JACC 1.4 • JASPIC 1.0 41
  • 42. Java EE 6 Samples 42
  • 43. Ease of Development Adding an EJB to a Web Application ShoppingCart BuyBooks.war EJB Class BuyBooks.war ShoppingCart.jar ShoppingCart EJB Class BuyBooks.ear 43
  • 44. Java EE Platform 5 Packaging 44
  • 45. Java EE Platform 6 Packaging 45
  • 46. Session Bean with No - Interface 46
  • 47. Ease of Development - Annotations Servlet in Java EE 5: Create two source files /* Code in Java Class */ <!--Deployment descriptor web.xml --> package com.foo; <web-app> public class MyServlet extends <servlet> HttpServlet { <servlet-name>MyServlet public void </servlet-name> doGet(HttpServletRequest <servlet-class> req,HttpServletResponse res) com.foo.MyServlet </servlet-class> { </servlet> <servlet-mapping> ... <servlet-name>MyServlet </servlet-name> } <url-pattern>/myApp/* </url-pattern> ... </servlet-mapping> ... } </web-app> 47
  • 48. Ease of Development - Annotations Servlet in Java EE 5: Java Class /* Code in Java Class */ package com.foo; public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) { /* doGet body */ } } 48
  • 49. Ease of Development - Annotations Servlet in Java EE 5: Descriptor <!--Deployment descriptor web.xml --> <web-app> <servlet> <servlet-name>MyServlet </servlet-name> <servlet-class> com.foo.MyServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>MyServlet </servlet-name> <url-pattern>/myApp/* </url-pattern> </servlet-mapping> ... </web-app> 49
  • 50. Ease of Development - Annotations Java EE 6 Servlet: Single Source file (many cases) package com.foo; @WebServlet(name=”MyServlet”, urlPattern=”/myApp/*”) public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) { ... } 50
  • 52. Demo Setup Enterprise Java JavaServer Java Beans Persistence JavaDB Faces (Business API (Database) (presentation) Logic) (Data Access) 52
  • 53. Summary • Java continues to evolve • JDK7 driving changes in the platform • JavaFX providing a RIA platform built on Java • More to come... 53
  • 54. More information • Tutorial On Java EE 6 • Webinar on Java EE 6 • http://www.javapassion.com/javaee6/ 54