td mxc javase mcdonald

Upload: armandochagoya

Post on 30-May-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Td Mxc Javase Mcdonald

    1/80

    1

    Java SE 6 and 7 Features

    Carol McDonaldJava ArchitectSun Microsystems

    1

  • 8/14/2019 Td Mxc Javase Mcdonald

    2/80

    2

    Java SE Platform Roadmap and

    Themes

    2006 2007 20082009

    Open SourcingJava

    'Its not a matter ofwhen but how'

    OpenJDKLaunch

    Java SE 6 Java SE 7

    JavaFXSDK

    AnnounceJavaFX

    JRE 6u10'Consumer JRE'

    JRE 6u5p'Performance JRE'

    ModularityMultiple Languages

    Rich Clients

  • 8/14/2019 Td Mxc Javase Mcdonald

    3/80

    3

    Agenda

    Java SE Technology TodayDynamic Language Integration

    Web Services Enhancement

    Database Update

    Desktop ImprovementJava SE 6 Update 10

    New Developments in the Platform

    Multiple Languages

    ModularityManagement and VisualVM

    Rich Clients

  • 8/14/2019 Td Mxc Javase Mcdonald

    4/80

    4

    Project OpenJDKOpen Source Java SE Platform Implementation

    OpenJDK is an open source project that implements Java SE 6(and beyond) platform Majority of the code released underGPLv2

    OpenJDK community

    > openjdk.java.net

  • 8/14/2019 Td Mxc Javase Mcdonald

    5/80

    5

    How Java SE Platform Gets

    DevelopedPresent and future

    What API Specifications JDK Implementation

    Where jcp.org openjdk.java.net

    How Expert Groups OpenJDK projects

    When Now Now!

  • 8/14/2019 Td Mxc Javase Mcdonald

    6/80

    6

    JDK version 6 Filling in the distribution gaps

    OpenJDK-based Java SE 6bundled in Ubuntu 8.04

    Apple releases Java SE 6 for 64bitOS-X

    TS-5214OpenJDK Community UpdateWed 2.50pm

    +

  • 8/14/2019 Td Mxc Javase Mcdonald

    7/807

    Java SE 6 Platform: Top 10 Features

    Scripting Ability to mix JavaScripttechnology with Java code

    Web Services Easy to use Web Service APIs

    Database Updated JDBC APIs, all-Java database in JDK

    Desktop AWT/Swing API enhancements, Consumer JRE

    Monitoring and Management JDK Tools

    Compiler Access APIs to control the compiler

    Pluggable Annotations Define your own annotation processors

    Java SE For Deployment Consumer JRE

    Security Further support for security APIs

    Performance Performance, performance, performance

  • 8/14/2019 Td Mxc Javase Mcdonald

    8/808

    Java SE 6 : Top 10 Features

    Web Service APIs Scripting language support Updated database APIs Swing enhancements Monitoring and Management Compiler APIs

    Pluggable Annotations Desktop deployment Integration with native security

    services Quality, compatibility and stability

  • 8/14/2019 Td Mxc Javase Mcdonald

    9/80

    ScriptingScripting

  • 8/14/2019 Td Mxc Javase Mcdonald

    10/8010

    Languages on the VM: Past

  • 8/14/2019 Td Mxc Javase Mcdonald

    11/8011

    Languages on the JVM: Present

    Clojure

    Tcl

    JavaScript

    v-language

    CAL

    Sather

    Funnel

    Mini

    PLAN

    Lisp

    Scheme

    Basic

    Logo JHCR

    TermWare

    Drools

    Prolog

    LLP

    JESS

    Eiffel

    Smalltalk

    C#

    G

    Groovy

    Nice

    Anvil

    Hojo

    foo

    Correlate

    Ada

    Bex Script Tea

    PHP

    Phobos

    Sleep

    FScript

    JudoScript

    JRuby

    ObjectScript

    Jickle

    Yoix

    Simkin

    Simkin

    BeanShell

    Dawn

    WebL iScript

    Jython

    Pnuts

    Yassl

    Forth

    PiccolaSALSA

    Processing

    Zigzag

    Tiger

    Tiger

    IconPascal

    Oberon

    Modula-2

    Luck

    E

    Rexx JavaFX ScriptScala

    PAN-5435Script BowlWed 9.30am

  • 8/14/2019 Td Mxc Javase Mcdonald

    12/8012

    Java Platform Supports Scripting

    Java Language != Java Platform> Java VM runs language-neutral bytecode

    Class files written in other languages

    > Groovy> Jython Compiler> Jruby

    Why?> Many other languages, many other virtues> Rapid prototyping and experimentation> different types of developers

  • 8/14/2019 Td Mxc Javase Mcdonald

    13/8013

    Scripting

    Scripting for the Java Platform (JSR 223)> Framework APIs for adding script engines

    >Access to resources of the Java platform, JAR files, fromscripting languages

    > Developer APIs to mix script fragments with Javalanguage code>Access to scripting languages from Java

    A JavaScript engine is included in JDK 6> Mozilla Rhino engine

    other JSR 223 compliant scripting engines (Groovy,Ruby, Python, et al) can be downloaded from

    > scripting.dev.java.net

  • 8/14/2019 Td Mxc Javase Mcdonald

    14/8014

    Launch Script within Java Code

    // create a ScriptEngineManager ScriptEngineManager m = new ScriptEngineManager();

    // get an instance of JavaScript script engine ScriptEngine engine = m.getEngineByName("js");

    // evaluate a script engine.eval("alert(\"Hello World!\")");

  • 8/14/2019 Td Mxc Javase Mcdonald

    15/8015

    Bind Java Objects to script

    // create script engine managerScriptEngineManager manager = new ScriptEngineManager();

    // create JavaScript engineScriptEngine engine = manager.getEngineByName(JavaScript);

    File f = new File(test.txt);

    // expose File object as variable to scriptengine.put(file, f);

    // evaluate a script string

    // script accesses file variable and calls method on itengine.eval(print(file.getAbsolutePath()));

    Java objectJava Script

  • 8/14/2019 Td Mxc Javase Mcdonald

    16/8016

    Scripting on Java SE 6 Platform// create a ScriptEngineManager & grab an engine

    ScriptEngineManager m = new ScriptEngineManager(); ScriptEngine engine = m.getEngineByName("js");

    // evaluate javascript directly....

    jsEngine.eval("print('Hello, world!')");

    // ...or from a scriptInputStream is =

    this.getClass().getResourceAsStream("/scripts/hello.js");

    Reader reader = new InputStreamReader(is);engine.eval(reader);

    // ...even call functions and methods in a script engine.eval("function sayHello() {" +

    " println('Hello, world!');" +"}");

    Invocable invocableEngine = (Invocable) jsEngine;invocableEngine.invokeFunction("sayHello");

  • 8/14/2019 Td Mxc Javase Mcdonald

    17/8017

    Demo: Scripting with Java SE

    Build and run ScriptPad sample app from JDK 6samples> You can build and run as NetBeans project

    Executing JavaScript code Invoking Java methods from JavaScript code

  • 8/14/2019 Td Mxc Javase Mcdonald

    18/80

    Web ServicesWeb Services

  • 8/14/2019 Td Mxc Javase Mcdonald

    19/8019

    XML and Web Services

    JAX-WS is part of Java SE 6 platform> Interoperability: Standards

    > SOAP 1.2

    > WS-I Basic Profile 1.1 Data binding using JAXB 2.0

    > XML Java Object

    Updates to the JAXP, which includesStaX> Xml parsing Pull model

  • 8/14/2019 Td Mxc Javase Mcdonald

    20/8020

    Web Service Example

    // Create a POJO

    public class Calculator {

    public int add(int a, int b) {

    return a+b;}

    }

  • 8/14/2019 Td Mxc Javase Mcdonald

    21/8021

    Web Service Example

    // Create a service implementation

    @WebService

    public class Calculator {

    public int add(int a, int b) {

    return a+b;}

    }

    // Create and publish the endpoint

    Calculator calculator = new Calculator();

    Endpoint endpoint = Endpoint.publish

    (http://localhost/calculator,calculator);

  • 8/14/2019 Td Mxc Javase Mcdonald

    22/8022

    Web Service Development

    Tools to generate necessary files for you> wsgen: generates service stubs on the service side

    e.g.wsgen -cp . example.Stock -wsdl -servicename

    {http://mynamespace}MyService> wsimport: generates proxy stub on the client side

    e.g.wsimport -d generated http://example.org/stock?wsdl

  • 8/14/2019 Td Mxc Javase Mcdonald

    23/8023

    Web Service Client

    // Create a Service objectCalculatorService svc =

    new CalculatorService();

    // Create a proxy from the Service objectCalculator proxy =

    svc.getCalculatorPort();

    // Invoke a Web service operationint answer = proxy.add(35, 7);

  • 8/14/2019 Td Mxc Javase Mcdonald

    24/80

    DatabaseDatabase

  • 8/14/2019 Td Mxc Javase Mcdonald

    25/80

    25

    Java DB

    Java DB database bundled with JDK 6> Java DB is based on Apache Derby

    open source Apache Derby 100% Java database

    Ideal for embedded or client-server use.> Small -- 2MB.

    > Embed in browser for better Web 2.0.

    > Easy application + DB distribution.

  • 8/14/2019 Td Mxc Javase Mcdonald

    26/80

    26

    JDBC 4.0 SQL XML support

    SQLXML Data Type:SQLXML sqlxml = resultSet.getSQLXML(column);

    InputStream binaryStream = sqlxml.getBinaryStream();

    Document result = parser.parse(binaryStream);

    Support for WebRowSet> Extends CachedRowSet + Rows in XML

    ResultSet rs = stmt.executeQuery("select * from student");

    WebRowSet wrs = new WebRowSetImpl();wrs.populate(rs);

    wrs.writeXml(new FileOutputStream("student.xml"));

  • 8/14/2019 Td Mxc Javase Mcdonald

    27/80

    27

    JDBC 4.0 Annotation-Based SQLQueries

    public class Person {public String id;public String firstName, String lastName;public String deptCode;

    }

    public interface PersonQueriesextends BaseQuery {// Get everyonefom thetable@Select(select * from emp_table)

    public Dataset getEveryone( );

    public Dataset getEveryone(String code);// Deletea particular person@Update(delete emp_table where id = {personId})public int deleteEmployee(String personId);

  • 8/14/2019 Td Mxc Javase Mcdonald

    28/80

    Desktop APIsDesktop APIsImprovementsImprovements

  • 8/14/2019 Td Mxc Javase Mcdonald

    29/80

    29

    Desktop APIs Improvements

    AWT improvements> Tray icon> Splash screen>

    Desktop class> Dialog modality enhancements and API> Text printing

    Swing improvements

    > GroupLayout basis for NetBeans GUI Builder(Matisse)

    > JTable sorting and filtering> SwingWorker

  • 8/14/2019 Td Mxc Javase Mcdonald

    30/80

    30

    Tray Icon Support

    // Construct a TrayIconTrayIcon trayIcon = new TrayIcon(image, "Tray Demo",

    popupMenu);

    // Set the TrayIcon propertiestrayIcon.addActionListener(actionListener);

    // Add the tray iconSystemTray.getSystemTray().add(trayIcon);

    Tooltip and Image Popup menu

    >Actions, events respond to clicks

  • 8/14/2019 Td Mxc Javase Mcdonald

    31/80

    31

    Splash Screen Support

    Displays a splash screen instantly before theJVM starts!> Display from command line

    java -splash:image.gif TheApp

  • 8/14/2019 Td Mxc Javase Mcdonald

    32/80

    32

    Java Desktop integration

    java.awt.Desktop API> Launch the default browser> Launch the default email client> Launch the default application to handle file open, file edit

    and file printDesktop desktop = Desktop.getDesktop();

    if (desktop.isSupported(Desktop.Action.EDIT))

    { desktop.edit(file }

    desktop.browse(url);

  • 8/14/2019 Td Mxc Javase Mcdonald

    33/80

    33

    SwingWorker

    Makes use ofconcurrency package

    Makes it easy to offload work to separate threads Example :

    > http://java.sun.com/developer/technicalArticles/javase/swingwork

    More Information:http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html#SwingWorke

    For Easy Multi-threaded Application DevelopmentWith Swing

    http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html#SwingWorkerhttp://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html#SwingWorker
  • 8/14/2019 Td Mxc Javase Mcdonald

    34/80

    34

    SwingWorker Example

    class ImageRetriever extends SwingWorker {

    @Overridepublic String doInBackground() {

    Icon icon = retrieveImage(strImageUrl);return icon;

    }

    @Overrideprotected voiddone() {

    lblImage.setIcon(icon);..

    }

    }// in event handler tell thread to begin asynchronous method.ImageRetriever imgRetriever =

    new ImageRetriever(lblImage, imageUrl);

    imgRetriever.execute();

    // This event thread continues here without blocking.

  • 8/14/2019 Td Mxc Javase Mcdonald

    35/80

    Monitoring &Monitoring &ManagementManagement

  • 8/14/2019 Td Mxc Javase Mcdonald

    36/80

    36

    jconsole, jps, jmap, jhat, jstack

    Run a sample Java application

    Use the tools> Usejps to see process ids of all Java processes

    > Usejconsole to dynamically connect to a process> Usejmap to capture snapshot ofmemory heap of a Java

    process> Usejhatto interpret heap

    > Usejstackto thread-dump on a live process

    You can try this> www.javapassion.com/handsonlabs/javase6tools/

  • 8/14/2019 Td Mxc Javase Mcdonald

    37/80

    Compiler AccessCompiler Access

  • 8/14/2019 Td Mxc Javase Mcdonald

    38/80

    38

    Compiler Access

    programmatic access to javacforin-processcompilation of dynamically generated Java code

    aimed at java tool developers> JavaServer Pages (JSP) or PHP construction kit

    engines that need to generate classes on demand> developers benefit from faster tools

    > Jasper JSP engine runs JSP TCK 3.5x faster

  • 8/14/2019 Td Mxc Javase Mcdonald

    39/80

    Pluggable AnnotationsPluggable Annotations

  • 8/14/2019 Td Mxc Javase Mcdonald

    40/80

    40

    Pluggable Annotations

    Allow developers to define new annotations...@ForReviewpublic void myMethod() {...}

    ...and APIs to define components that process them...import javax.annotation.processing.*;

    public class ForReviewProcessor extends AbstractProcessor {..}

    ...and integrate them with the Java Compilerjavac -processor ForReviewProcessor MyCode.java

  • 8/14/2019 Td Mxc Javase Mcdonald

    41/80

    SecuritySecurity

  • 8/14/2019 Td Mxc Javase Mcdonald

    42/80

    42

    Security

    Added new APIs> XML Digital Signature (XMLDSig) API (JSR 105)> Smart Card I/O API (JSR 268)

    Improved authentication schemes> JAAS-based authentication using LDAP

  • 8/14/2019 Td Mxc Javase Mcdonald

    43/80

    Java SE 6 Update 10Java SE 6 Update 10

  • 8/14/2019 Td Mxc Javase Mcdonald

    44/80

    44

    Java SE 6u10 Consumer JRE

    Updated Java Runtime environment for the desktop

    Recharge use of Java for rich client applications

    > Small, fast download (Java Kernel)

    > Unified Java applet / application deployment ith JNLP

    > Quick applet startup time (Java Quick Starter)

    > JavaFX ready

    Get the beta

    > jdk6.dev.java.net/6u10ea.html

  • 8/14/2019 Td Mxc Javase Mcdonald

    45/80

    45

    Java SE 6u10 Consumer JRE

    Quickstarter> Reduces the start up time for Java applications and applets

    Java Kernel> divides JRE libraries into small bundles. Only download whats

    needed now, rest later

    Deployment Toolkit

    > Enables easy detection and installation of the JRE New Improved Java Plug-In

    Nimbus:cross-platform Swing look & feel

  • 8/14/2019 Td Mxc Javase Mcdonald

    46/80

    46

    Old Java Plugin Architecture

    JVMinBrowser

    Applet Applet

    Applet

    Applets in browser process> Same VM> Same lifecycle

    > Same resources> Different deployment from

    Java Applications

  • 8/14/2019 Td Mxc Javase Mcdonald

    47/80

    47JVM

    New Java Plugin Architecture

    JVMin

    Browser

    Applet

    Applet

    JVM

    Applet

    Applets have own process> Choose the VM they want

    > Live outside browser

    > Live beyond the browser

    > Same deployment as JavaApplications

  • 8/14/2019 Td Mxc Javase Mcdonald

    48/80

    48

    Nimbus Look and Feel Improvements

    SwingSet

  • 8/14/2019 Td Mxc Javase Mcdonald

    49/80

    PerformancePerformance

  • 8/14/2019 Td Mxc Javase Mcdonald

    50/80

    50

    Java SE 6u5p Performance Release

    Performance tuned release of theJRE

    64bit architectures only

    > Solaris, Windows, Linux

    Large number ofoptimizations:> Crypto libraries, TreeMap, HashMap, XML

    Parsing

    > Escape analysis, depth-first copying, pagesizes

    Optimizations seep into future JRE

    updates

  • 8/14/2019 Td Mxc Javase Mcdonald

    51/80

    51

    Java Platform Performance Trends on x64

    J2SE5.0_04

    J2SE5.0_05

    J2SE5.0_06

    J2SE5.0_08

    Java SE 6.0 Java SE6.0_02

    Java SE6.0_05

    Java SE6.0_05-P

    100%

    110%

    120%

    130%

    140%

    150%

    160%

    170%

    180%

    190%

    200%

    210%

    220%

    %P

    erf.

    Improve

    ment

    SPECjbb2005 onSun x64 Server

  • 8/14/2019 Td Mxc Javase Mcdonald

    52/80

    52

    Java Platform Performance Trends on x64

    J2SE5.0_04

    J2SE5.0_05

    J2SE5.0_06

    J2SE5.0_08

    Java SE 6.0 Java SE6.0_02

    Java SE6.0_05

    Java SE6.0_05-P

    100%

    120%

    140%

    160%

    180%

    200%

    220%

    240%

    260%

    280%

    Intel Core 2

    AMD Barcelona

    %P

    erf.

    Improve

    ment

    SPECjbb2005 onIntel and AMD

  • 8/14/2019 Td Mxc Javase Mcdonald

    53/80

    Java SE 7 Highlights:Java SE 7 Highlights:

    ScriptingScripting

  • 8/14/2019 Td Mxc Javase Mcdonald

    54/80

    54

    Languages on the JVM: Present

    Clojure

    Tcl

    JavaScript

    v-language

    CAL

    Sather

    Funnel

    Mini

    PLAN

    Lisp

    Scheme

    Basic

    Logo JHCR

    TermWare

    Drools

    Prolog

    LLP

    JESS

    Eiffel

    Smalltalk

    C#

    G

    Groovy

    Nice

    Anvil

    Hojo

    foo

    Correlate

    Ada

    Bex Script Tea

    PHP

    Phobos

    Sleep

    FScript

    JudoScript

    JRuby

    ObjectScript

    Jickle

    Yoix

    Simkin

    Simkin

    BeanShell

    Dawn

    WebL iScript

    Jython

    Pnuts

    Yassl

    Forth

    Piccola

    SALSA

    Processing

    Zigzag

    Tiger

    Tiger

    IconPascal

    Oberon

    Modula-2

    Luck

    E

    Rexx JavaFX Script Scala

    PAN-5435Script BowlWed 9.30am

  • 8/14/2019 Td Mxc Javase Mcdonald

    55/80

    55

    Languages on the JVM: FutureJava SE 7

    Broadening the (J)VM to accelerate runtimes Bytecode fordynamic invocation> Anonymous classloading> Lightweight method handles

    > Optimized dynamic invocation> Continuations and tail call optimizations

    DaVinci Project: openjdk.java.net/projects/mlvm>

    Draft specification> Prototype available

    JRuby is the pioneerPlan to bundle other engines into JDK 7

    JVM Language Summithttp://jvmlangsummit.com

    Sept 2008

  • 8/14/2019 Td Mxc Javase Mcdonald

    56/80

    Java SE 7 Highlights:Java SE 7 Highlights:

    ModularityModularity

  • 8/14/2019 Td Mxc Javase Mcdonald

    57/80

    57

    Modular programming in Java today

    Packages> Package names are hierarchical> Package membership is not hierarchical

    Access control> Types and members shared across packages must be

    made public

    Interfaces> Not always desirable to have all members be public

  • 8/14/2019 Td Mxc Javase Mcdonald

    58/80

    58

    Deployment goals for the Java ModuleSystem

    Address "JAR hell" Better distribution format than JAR files

    Enable side-by-side versioning

    Simple and predictable classloading

    Support entire spectrum of Java programs Repository infrastructure to isolate modules Customizable for different environments

    (e.g. applets) and module systems

    Versioning

    Dependencycontrol

    Distributionformat

    Classloaders

    Java Module System

  • 8/14/2019 Td Mxc Javase Mcdonald

    59/80

    59

    Classes in different packages need tocollaborate

    org/

    netbeans/

    core/

    Debugger.class

    ...utils/

    ErrorTracker.class

    ...

    wizards/

    JavaFXApp.class

    ...

    addins/

    ...

    org.netbeans.coreis a conceptual"module"

  • 8/14/2019 Td Mxc Javase Mcdonald

    60/80

    60

    Modules in the Java language

    // org/netbeans/core/Debugger.javamodule org.netbeans.core;

    packageorg.netbeans.core;

    public class Debugger {

    ... new ErrorTracker() ...

    }

    Module conceptin the language

  • 8/14/2019 Td Mxc Javase Mcdonald

    61/80

    61

    Modules in the Java language

    // org/netbeans/core/Debugger.javamodule org.netbeans.core;

    package org.netbeans.core;

    public class Debugger {

    ... new ErrorTracker() ...

    }

    // org/netbeans/core/utils/ErrorTracker.java

    module org.netbeans.core;

    packageorg.netbeans.core.utils;

    module class ErrorTracker {

    moduleint getErrorLine() { ... }}

    Module conceptin the language

    Module accessspecified in the

    language

    One modulehas manypackages

  • 8/14/2019 Td Mxc Javase Mcdonald

    62/80

    62

    The JAM Module System

    Java Modules> JAR-like file format

    > Easy metadata

    > Addresses problems with JARs

  • 8/14/2019 Td Mxc Javase Mcdonald

    63/80

    63

    JAM metadata

    // org/netbeans/core/module-info.java@Version("7.0")

    @MainClass("org.netbeans.core.Main")

    @Attribute(name="IDE", value="NetBeans")

    @ImportModules{

    @ImportModule(name="java.se.core",version="1.7+"),

    @ImportModule(name="org.foo.util",

    version="1.0", reexport=true)

    })

    @ImportPolicyClass("org.netbeans.CustomPolicy")@ModuleInitializerClass("org.netbeans.core.Init")

    @PlatformBinding(os="solaris", arch="sparc")

    @ExportResources({"icons/**"})

    module org.netbeans.core;

    Version

    Initializer

    Module

    dependencies

    Attributes

    Main class

    Custom importpolicy

    Platformspecific

    Exportedresources

  • 8/14/2019 Td Mxc Javase Mcdonald

    64/80

    64

    Compiling and running a JAM module

    javac org/netbeans/core/*

    javac org/netbeans/core/utils/*

    jam cvf org.netbeans.core-7.0.jam

    org/netbeans/core/*org/netbeans/core/utils/*

    java -jam org.netbeans.core-7.0.jam

    cp org.netbeans.core-7.0.jam /netbeans/repository

    java -module org.netbeans.core:6.0+-repository /netbeans/repository

  • 8/14/2019 Td Mxc Javase Mcdonald

    65/80

    65

    org.netbeans.core-7.0.jam

    /META-INF/MANIFEST.MF

    /MODULE-INF/MODULE.METADATA

    /MODULE-INF/bin/xml-windows.dll

    /MODULE-INF/bin/xml-linux.so

    /MODULE-INF/lib/xml-parser.jar

    /org/netbeans/core/module-info.class

    /org/netbeans/core/Main.class

    /org/netbeans/core/Debugger.class

    /org/netbeans/core/utils/ErrorTracker.class/icons/graphics.jpg

    Module metadata

    Native libraries

    JAR files

    Other resources

    .jam.pack.gz extension for Pack200-gzipped JAM module

  • 8/14/2019 Td Mxc Javase Mcdonald

    66/80

    66

    No more JAR hell

    Can import other JAM module

    Different versions of the "same" module definition (B) can co-exist

    > use the highest

    A single version of a module definition(E) can be shared between modules

    A JAM module instance has its own classloader

    Classloading is completely deterministic

    Module A v1.0

    Module B v2.0 Module C v3.0 Module D v4.0

    ModuleE v5.0

    imports imports imports

    imports imports

    importsModule B v1.0

    imports

  • 8/14/2019 Td Mxc Javase Mcdonald

    67/80

    67

    Loading OSGi bundles in JDK version 7

    OSGiContainer

    OSGi bundles

    JVMBootstrap repository

    JAM repository Repository forOSGi

    Java Modules

    Extension repository

    OSGi Interoperability

  • 8/14/2019 Td Mxc Javase Mcdonald

    68/80

    68

    Java Module System - Status

    JSR 277 Draft 2 is in progress> OSGi Interoperability spec is out !

    OpenJDK Modules project> openjdk.java.net/projects/modules/

  • 8/14/2019 Td Mxc Javase Mcdonald

    69/80

    69

    Modularizing Java SE itself

    Java SE has grown very large 2 main classes of applications

    > Serverapplications

    > Desktop applications Introducing Java SE Profiles in Java SE 7

    > A formalsubset of Java SE, defined in the JCP> Plus optional packages not part of Java SE> Formal == Reference Implementation and Test Suite

  • 8/14/2019 Td Mxc Javase Mcdonald

    70/80

    70

    Java SE Applications

    The (full) Java SE Platform

    JVM

    CoreAPIs

    OS

    GUIWeb

    Services /data access

    ToolsAPIs

    EnterpriseAPIs

  • 8/14/2019 Td Mxc Javase Mcdonald

    71/80

  • 8/14/2019 Td Mxc Javase Mcdonald

    72/80

    72

    Management Updates

    JSR 255: Java Management Extensions (JMX) Specification,version 2.0

    > Federated JMX technology servers

    > Get code: opendmk.dev.java.net

  • 8/14/2019 Td Mxc Javase Mcdonald

    73/80

    73

    Web Services Connector for JMX Agents

    > early access Get code: ws-jmx-connector.dev.java.net

    Based on web service management standards

    > WS-Management (DMTF)

    > http://www.dmtf.org/standards/wsman/

    MBean Server

    JSR 262 Server

    Response

    Request

    ClientWS-Management Request

    WS-Management Response

    Management Updates

    http://www.dmtf.org/standards/wsman/http://www.dmtf.org/standards/wsman/
  • 8/14/2019 Td Mxc Javase Mcdonald

    74/80

    74

    VisualVM for Sun's JDK

    Get the release candidate today> visualvm.dev.java.net

    BOF-5223VisualVMThu 7.30pm

    James GoslingExtreme Innovation

    Fri 8.30AM

  • 8/14/2019 Td Mxc Javase Mcdonald

    75/80

    75

    What's VisualVM?

    A new Integrated and Extensible TroubleshootingTool for the Java Platform

    JDK Management, Monitoring and Troubleshooting

    tools and lightweight CPU and Memory profilingProduction and development time tool

    Audience: developers, administrators, performanceand sustaining engineers, etc.

    https://visualvm.dev.java.net

  • 8/14/2019 Td Mxc Javase Mcdonald

    76/80

    76

    Closure anonymous function, for cross cutting concerns

    Closure literals

    { parameters => statements expression }

    Function example

    Evolving specification at> http://www.javac.info

    { int x, int y => (x + y) }

    int answer = { int x, int y =>(x + y) }.invoke(5, 7);

  • 8/14/2019 Td Mxc Javase Mcdonald

    77/80

    77

    Closure Conversion Example

    ActionListenerlistener=

    {ActionEventevt=>saveAll();};

    JButtonbutton=newJButton(OK);button.addActionListener(listener);

    Can assign a closure to a variable of compatible

    interface type

  • 8/14/2019 Td Mxc Javase Mcdonald

    78/80

    78

    Important Updates

    More New I/O APIs> New filesystem API

    > Revised socket channel functionality

    > Asynchronous I/O

    Draft stage> openjdk.java.net/projects/nio/

    > Spec, code, samples

    TS-5686New I/O APIsThu 9.30am

  • 8/14/2019 Td Mxc Javase Mcdonald

    79/80

    79

    Call For Action

    Java SE 6 platform> Use it now!

    OpenJDK> Join us in building it!

    Java SE 7 platform> Join us in defining it!

    Interact with JDK developers @ planetjdk.org

  • 8/14/2019 Td Mxc Javase Mcdonald

    80/80

    Java SE 6 and 7 Features

    Carol McDonaldJava ArchitectSun Microsystems