SlideShare a Scribd company logo
1 of 76
Java New Evolution

Allan Huang @ esobi Inc.
Agenda




Java 5 Features Review
Java 6 New Features
Java 7 New Features
Java Versions






Version 1.0 and 1.1 are named as JDK
Version 1.2 to 1.4 are named as J2SE
Version 1.5 are named as Java 5.0
JSR – Java Specification Request
Versions and Naming









JDK 1.0 – 1996
JDK 1.1 – 1997 – JDBC, RMI, Reflection
J2SE 1.2 – 1998 – Swing, Collections
J2SE 1.3 – 2000 – HotSpot JVM, JavaSound, JNDI
J2SE 1.4 – 2002 – assert, NIO, Web Start
J2SE 5.0 (1.5) – 2004 – Generic, Autoboxing..
Java SE 6.0 (1.6) – 2006 – Rhino, JDBC 4.0…
Java SE 7.0 (1.7) – 2011 – Small language
changes, API changes
Java 5
Java 5 Features Review (1)


Generics


Allows a type or method to operate on objects of various
types while providing compile-time type safety to the
Collections Framework and eliminates the drudgery of
casting.
Java 5 Features Review (2)


Enhanced for Loop


This new language construct eliminates the drudgery and
error-proneness of iterators and index variables when
iterating over collections and arrays.
Java 5 Features Review (3)


Autoboxing / Unboxing


Eliminates the drudgery of manual conversion between
primitive types (such as int) and wrapper types (such as
Integer).
Java 5 Features Review (4)


Typesafe Enums


Allows you to create enumeration types with arbitrary
methods and fields, then It provides all the benefits of the
Typesafe Enum pattern without the verbosity and the errorproneness.
Java 5 Features Review (5)


Varargs


Eliminates the need for manually boxing up argument lists
into an array when invoking methods that accept variablelength argument lists.
Java 5 Features Review (6)


Static Import


Lets you avoid qualifying static members with class names
without the shortcomings of the "Constant Interface Antipattern".
Constant Interface Anti-pattern
Anti-pattern



Better Pattern

Describes the use of an interface solely to define
constants, and having classes implement that
interface in order to achieve convenient syntactic
access to those constants.
Java 5 Features Review (7)


Annotations (Metadata)


Lets you avoid writing Boilerplate Codes under many
circumstances by enabling tools to generate it from a
"declarative" programming style - annotations in the source
code.
Java 5 Features Review (8)



Java Utility Scanner


A simple text scanner which can parse primitive types and
strings using regular expressions. You can provide several
resource types to read from.
Java 5 Features Review (9)



Java Utility Formatter


An interpreter for printf-style format strings that is like the
printf function in C language.
Java Features Review (10-1)


Java Utility Concurrent




The concurrency utilities packages provide a
powerful, extensible framework of highperformance threading utilities.
Advantages






Reduced programming effort
Increased performance
Increased reliability
Improved maintainability
Increased productivity
Java Features Review (10-2)


Java Utility Concurrent


Task scheduling framework




Fork / join framework




Standardizes invocation, scheduling, execution, and control of
asynchronous tasks according to a set of execution policies.
Designs to efficiently run a large number of tasks using a pool
of worker threads.

Concurrent collections


Adds new collections classes and high-performance,
concurrent implementations, e.g. Queue, BlockingQueue,
BlockingDeque.
Java Features Review (10-3)


Java Utility Concurrent


Atomic variables




Synchronizers




General purpose synchronization classes that facilitate
coordination between threads.

Locks




A small toolkit of classes that support lock-free thread-safe
programming on single variables.

Provides a framework for locking and waiting for conditions
that is distinct from built-in synchronization and monitors.

Nanosecond-granularity timing


Returns the current value of the running Java Virtual
Machine's high-resolution time source, in nanoseconds.
Java Utility Concurrent
Java 6
Java 6 New Features (1)


Pluggable Annotation Processing API (JSR
269)






Annotations aimed in providing a Meta-Data
Facility to the Java
A Customized Annotation Processor which can be
plugged-in to the code to operate on the set of
annotations that appear in a source file.
Class-Level Annotation




@Target(value = {ElementType.TYPE})

Method-Level Annotation


@Target(value = {ElementType.METHOD})
Pluggable Annotation Processing API
Examples
Class-Level Annotation

Method-Level Annotation
Java 6 New Features (2-1)


Common Annotations (JSR 250)




Define a set of annotations that address common
semantic concepts and therefore can be used by
many Java EE and Java SE components.
Avoid applications defining their own annotations
which will result in having larger number of
duplicates.
Java 6 New Features (2-2)


Common Annotations (JSR 250)


@Generated




@Resource, @Resources, @DataSourceDefinition,
@ManagedBean




Get executed after dependency injection is done or called before the
instance is removed

@Priority




Declares a reference to one / many resources

@PostConstruct, @PreDestroy




Marks sources that have been generated

Indicate in what order the classes should be used

@DeclareRoles, @RoleAllowed, @PermitAll, @DenyAll,
@RunAs


Role Based Annotations about security
Java 6 New Features (3)


Java Architecture for XML Binding - JAXB 2.0
(JSR 222)




A Mapping Technology allows developers to map
Java classes to XML representations.
Two main features are capable of Marshalling
Java objects into XML and Un-marshalling XML
back into Java objects.
JAXB Examples
Java 6 New Features (4)


Java API for XML Based Web Services – JAX-WS
2.0 (JSR 224)




Define a set of APIs for creating web services in SOAP,
and provide many annotation to simplify the development
and deployment for both web service clients and web
service providers (endpoints).
Java-to-WSDL mapping determines which Java method
gets invoked and how that SOAP message is mapped to
the method’s parameters, and also determines how the
method’s return value gets mapped to the SOAP response.
JAX-WS Architecture
WS Action Flow

WS Action in Server-Side
JAX-WS Examples
Service Endpoint Interface

Service Endpoint Publisher

Service Endpoint Implementation Web Service Client
Java 6 New Features (5-1)


Web Services Metadata for Java (JSR 181)




Annotate a Web Service implementation class or
a Web Service interface, and create portable Java
Web Services from a simple POJO class by
adding annotations
Benefits




Provide a simplified model for developing Web Services
Abstract the implementation details
Achieve robustness, easy maintenance, and high
interoperability
Java 6 New Features (5-2)


Web Services Metatdata for Java (JSR 181)


@WebService




@WebMethod




Denotes a method that is a Web Service operation

@OneWay




Marks a Java class as implementing a Web Service or marks a
service endpoint interface (SEI) as implementing a Web
Service interface

Denotes a method as a Web Service one-way operation that
only has an input message and no output message

@WebParam


Customizes the mapping of an individual parameter to a Web
Service message part and XML element
Java 6 New Features (5-3)


Web Services Metatdata for Java (JSR 181)


@WebResult




@HandleChain




Customizes the mapping of a return value to a WSDL part or
XML element
Associates the Web Service with an externally defined handler
chain

@SOAPBinding


Specifies the mapping of the Web Service onto the SOAP
message protocol
Java 6 New Features (6-1)


Streaming API for XML – StAX (JSR 173)









StAX API exposes methods for iterative, eventbased processing of XML documents.
StAX is a Pull style API, SAX is a Push style API.
StAX can do both XML reading and writing, SAX
can only do XML reading.
StAX allows Sub-parsing / Delegation
StAX has support for XML Writing
StAX has not support for Schema Validation
Java 6 New Features (6-2)


Streaming API for XML – StAX (JSR 173)


StAX is really two distinct API sets





Iterator API can keep track of the previous event,
but Cursor can’t do that.




A Cursor API is likes JDBC ResultSet
An Iterator API is likes Iterator interface

javax.xml.stream.XMLEventReader

Cursor API is more memory-efficient than Iterator
API.


javax.xml.stream.XMLStreamReader
DOM, SAX, StAX
DOM

SAX

StAX

SAX vs. StAX
StAX API Examples
Read from XML

Write to XML
Java 6 New Features (7)


XML Digital Signature (JSR 105)


Digital Signature






A value computed with a cryptographic algorithm and
appended to a data object in such a way that any
recipient of the data can use the signature to verify the
data's origin and integrity.

Define a standard set of APIs for generating and
validating XML Digital Signatures specified by
W3C.
It defines a process and a format for generating
digital signatures in the XML format, and it can
sign arbitrary data, whether it is XML or binary.
XML Digital Signature Examples
Java 6 New Features (8)


Java Class File Specification Update (JSR
202)




This JSR will make incremental updates to the
Java class file format.
This will principally consist of increasing certain
class file size limits and adding support for split
verification.
Java 6 New Features (9-1)


Java Compiler API (JSR 199)




Allow a Java program to select and invoke a Java compiler
programmatically, then compile java source files.
Web and application servers can depend on this API
exhaustively to provide compilation activities of the
dynamically created Java source files.
Java 6 New Features (9-2)


Java Compiler API (JSR 199)


JavaFileManager






Create output files, scan for the input files, and cache
them for better performance.
The content of Input files managed may come from a
physical file in a hard-disk, in-memory or a remote
socket.

DiagnosticListener


Report the diagnostics (error, warning or information)
that may occur during the compilation process within a
program.
Java 6 New Features (10-1)


JDBC 4.0 (JSR 221)


Auto-loading of JDBC driver class







No need for Class.forName(“DriverName”)
Support Service Provider Mechanism via METAINF/services/java.sql.Driver
Find unique JDBC driver via java.util.ServiceLoader

RowID data type support






A kind of pseudo column for Oracle and DB2, etc.
RowIDs are unique IDs for rows in a given table.
RowIDs are the fastest means of accessing particular
rows.
RowIDs can be used to see how a table is organized.
Java 6 New Features (10-2)


JDBC 4.0 (JSR 221)


Connection management enhancements




SQL Exception handling enhancements






Improved connection state tracking
New SQLException Sub-Classes: Transient,
Recoverable, Non-Transient exceptions
Enhanced For-Each Loop in Iterable SQLException

SQLXML data type support for SQL:2003



Correspond to the XML data type in the database
Use an DOM or SAX representation of XML data
Java 6 New Features (10-3)


JDBC 4.0 (JSR 221)


Enhanced Blob / Clob functionality





National Character Set support




New corresponding methods for NCHAR, NVARCHAR,
LONGNVARCHAR, NCLOB

A bundled Database – Apache Derby




New corresponding methods for BLOB, CLOB, NCLOB
A new method free() for release of resource

An open source relational database implemented
entirely in Java

Not support Annotation-Based SQL Queries
JDBC 4.0 Examples
Service Loader

SQLXML
Java 6 New Features (11-1)


JavaScript Support – Rhino (JSR 223)




Mozilla Rhino Script Engine that supports various
Scripting Languages is integrated into the Java.
Rhino converts JavaScript scripts into classes,
and it’s intended to be used in server-side apps
without built-in support for the Web browser
objects.
Java 6 New Features (11-2)


JavaScript Support – Rhino (JSR 223)


Convenience




Developing rapid prototypes




Avoid the edit-compile-run cycle and just use edit-run!

Application extension/customization




Create new variables without declaring the variable type,
and reuse variables to store objects of different types.

You can "externalize" parts of your application.

"Command line" shells for applications


Admins and deployers frequently prefer command line
tools for debugging, runtime / deploy time configuration.
Java 6 New Features (11-3)


JavaScript Support – Rhino (JSR 223)




Language Bindings provides mechanisms for
establishing communications between the Java
code and the script code.
ScriptEngineManager class provides mechanisms
for Searching and Adding Scripting Engines into
the Java Platform.
JavaScript Support Examples
Java 7
Java 7 New Features (1)


Binary Literals




The types byte, short, int, and long can also be expressed
using the binary number system.
To specify a binary literal, add the prefix 0b or 0B to the
number.
Java 7 New Features (2)


Underscores in Numeric Literals


Any number of underscore characters (_) can appear
anywhere between digits in a numerical literal.
Java 7 New Features (3)


Strings in switch Statements


Use the String class in the expression of a switch
statement.
Java 7 New Features (4)


Type Inference for Generic Instance Creation




Replace the type arguments required to invoke the
constructor of a generic class with an empty set of type
parameters (<>).
This pair of angle brackets is informally called the diamond.
Java 7 New Features (5)


Improved Compiler Warnings and Errors
When Using Non-Reifiable Formal
Parameters with Varargs Methods


The complier generates a warning at the
declaration site of a varargs method or constructor
with a non-reifiable varargs formal parameter.
Java 7 New Features (5-1)


Heap Pollution




A non-reifiable type is a type that is not completely
available at runtime, and type erasure removes information
from parameterized types at compile-time.
Heap pollution occurs when a variable of a parameterized
type refers to an object that is not of that parameterized
type.
Java 7 New Features (5-2)



Variable Arguments Methods and Non-Reifiable
Formal Parameters




Compiler encounters a varargs method, it translates the
varargs formal parameter into an array.
Java does not permit the creation of arrays of
parameterized types.
Java 7 New Features (5-3)



Potential Vulnerabilities of Varargs Methods with
Non-Reifiable Formal Parameters


Compiler has generated a warning when it translated the
varargs formal parameter to the formal parameter.
Java 7 New Features (5-4)


Suppressing Warnings from Varargs Methods
with Non-Reifiable Formal Parameters


If you declare a varargs method with
parameterized parameters, and you ensure that
the method does not throw a ClassCastException
or other similar exception, you can suppress the
warning that the compiler generates.
Suppressing Compiler Warnings






Add @SafeVarargs to the static and non-constructor
method declarations
Add @SuppressWarnings(“unchecked") to the
method declaration
Use the compiler non-standard option -Xlint:varargs
Java 7 New Features (6)


The try-with-resources Statement




A try statement declare one or more resources and
ensures that each resource is automatically closed at the
end of the statement.
A resource is an object that must be closed after the
program is finished with it, and it implements
java.lang.AutoClosable.
Java 7 New Features (7)


Handling More Than One Type of Exception


A single catch block can handle more than one type of
exception that can reduce code duplication and lessen the
temptation to catch an overly broad exception.
Java 7 New Features (8)


Rethrowing Exceptions with More Inclusive Type
Checking


Performs more precise analysis of rethrown exceptions that
enables you to specify more specific exception types in the
throws clause of a method declaration.
Java 7 New Features (9-1)


Java New I/O 2.0 – NIO.2 (JSR 203)


A new file system and path abstraction




Metadata File Attributes




Provides new file system functionalities to perform over
a file, a directory, or a link.
Provides access to metadata file attributes through the
java.nio.file.attribute package.

Symbolic Links and Hard Links




Provides support for both hard links and symbolic links
(soft link).
Each method of the Path class knows how to detect a
link and will behave in the default manner.
Java 7 New Features (9-2)



Hard Link vs. Symbolic Link (Soft Link)




A hard link is an actual physical entity representing the link.
A symbolic link is a pointer to a physical entity.
Symbolic links function similar to the short-cuts in a DOS
based operating system.
Java 7 New Features (9-3)


Java New I/O 2.0 – NIO.2 (JSR 203)


New API for Files and Directories




The FileVisitor Interface




Performs the most common tasks for managing files and
directories, such as create, read, write, move, delete.
Traverses a file tree via FileVisitor, such as finding,
copying, deleting, and moving files.

Monitoring via Watch Service API




A thread-safe service that is capable of watching objects
for changes and events.
Monitors a directory for changes to its content through
actions such as create, delete, and modify.
Java 7 New Features (9-4)


Java New I/O 2.0 – NIO.2 (JSR 203)


New powerful Random Access Files




Networking with the Sockets APIs




Provides facilities such as mapping a region of the file
directly into memory for faster access, locking a region
of the file, etc.
Updating existing classes with new methods and adding
new interfaces/classes for writing TCP/UDP-based
applications.

The Asynchronous Channel API


A channel that supports asynchronous I/O operations for
use by multiple concurrent threads.
NIO.2 Examples (1)
Selectors Help Multiplex
Change Notification
NIO.2 Examples (2)
Memory Mapping

Char Encoding & Searching
Java 7 New Features (10-1)


Dynamically Typed Languages Support (JSR 292)


Static Language (Static type-checking)




Dynamic Language (Dynamic type-checking)






The process of verifying the type safety of a program based
on analysis of a program's source code.
The process of verifying the type safety of a program at
runtime.

Developers are increasingly using pre-existing runtime
environments to host their languages.
Allows an easier mix and match approach of dynamic and
static languages on the JVM.
Java 7 New Features (10-2)




Dynamically Typed Languages Support (JSR 292)
 Adds a new bytecode instruction - InvokeDynamic, to allow
method invocation relying on dynamic type checking.
Three major features
 Dynamic Invocation




Method Handle Invocation




This instruction is used to call methods which have linkage and
dispatch semantics defined by non-Java languages.
A method handle is a typed, directly executable reference to an
underlying method, constructor, field, or similar low-level operation,
with optional transformations of arguments or return values.

Exotic (non-Java) Identifiers


An exotic identifier is introduced by a hash mark (# symbol), which is
immediately followed by a string literal.
Dynamically Typed Language Examples
Reference (1)











Java Programming Language Enhancements
Constant interface
Boilerplate Code Wikipedia
Concurrency Utilities Overview
Introduction to Java 6.0 New Features, Part–1
Java SE 6 Features and Enhancements
JSR 250 Wikipedia
Java Architecture for XML Binding Wikipedia
Tutorial: Review of JAX-WS Server Side for the Web Services
JAX-WS Hello World Example – RPC Style
Reference (2)












Java API for XML Web Services Wikipedia
Web Services Metadata for Java Wikipedia
JAX-WS annotations
Mapping Java Objects and XML Documents using JAXB in Ja
Programming With the Java XML Digital Signature API
The Java 6.0 Compiler API
Java & XML Tutorial: StAX
StAX API
StAX the odds with Woodstox
JDBC 4.0 API in Java 6.0
JDBC 4.0 Enhancements in Java SE 6
Reference (3)












Rhino (JavaScript Engine) Wikipedia
Java Scripting Programmer’s Guide
Java SE 7 Features and Enhancements
JDK7: Part 1- The power of java 7 NIO.2
Five ways to maximize Java NIO and NIO.2
What is the difference between symbolic link and hard
link
JSR 292 and the Multi-lingual JVM
An Introduction To Programming Type Systems
Type System Wikipedia
InterfaceDynamic - Da Vinci Machine Project
Q&A

More Related Content

What's hot

Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)choksheak
 
[Java concurrency]01.thread management
[Java concurrency]01.thread management[Java concurrency]01.thread management
[Java concurrency]01.thread managementxuehan zhu
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and ConcurrencyRajesh Ananda Kumar
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS MultithreadingRicha Jain
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Akshay Nagpurkar
 
Java 8 - Stamped Lock
Java 8 - Stamped LockJava 8 - Stamped Lock
Java 8 - Stamped LockHaim Yadid
 
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Sachintha Gunasena
 
Java Threads and Concurrency
Java Threads and ConcurrencyJava Threads and Concurrency
Java Threads and ConcurrencySunil OS
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrencyfeng lee
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javajunnubabu
 
Java Multithreading Using Executors Framework
Java Multithreading Using Executors FrameworkJava Multithreading Using Executors Framework
Java Multithreading Using Executors FrameworkArun Mehra
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Paddy Lock
 
Java multi threading
Java multi threadingJava multi threading
Java multi threadingRaja Sekhar
 
Programming with Threads in Java
Programming with Threads in JavaProgramming with Threads in Java
Programming with Threads in Javakoji lin
 
Multithread Programing in Java
Multithread Programing in JavaMultithread Programing in Java
Multithread Programing in JavaM. Raihan
 

What's hot (20)

Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)
 
[Java concurrency]01.thread management
[Java concurrency]01.thread management[Java concurrency]01.thread management
[Java concurrency]01.thread management
 
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and Concurrency
 
Multithreading in Java
Multithreading in JavaMultithreading in Java
Multithreading in Java
 
Threading in java - a pragmatic primer
Threading in java - a pragmatic primerThreading in java - a pragmatic primer
Threading in java - a pragmatic primer
 
iOS Multithreading
iOS MultithreadingiOS Multithreading
iOS Multithreading
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
Java 8 - Stamped Lock
Java 8 - Stamped LockJava 8 - Stamped Lock
Java 8 - Stamped Lock
 
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
Concurrency Programming in Java - 07 - High-level Concurrency objects, Lock O...
 
Java Threads and Concurrency
Java Threads and ConcurrencyJava Threads and Concurrency
Java Threads and Concurrency
 
Introduction+To+Java+Concurrency
Introduction+To+Java+ConcurrencyIntroduction+To+Java+Concurrency
Introduction+To+Java+Concurrency
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
Effective java - concurrency
Effective java - concurrencyEffective java - concurrency
Effective java - concurrency
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Java Multithreading Using Executors Framework
Java Multithreading Using Executors FrameworkJava Multithreading Using Executors Framework
Java Multithreading Using Executors Framework
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
Programming with Threads in Java
Programming with Threads in JavaProgramming with Threads in Java
Programming with Threads in Java
 
Multithread Programing in Java
Multithread Programing in JavaMultithread Programing in Java
Multithread Programing in Java
 

Similar to Java New Evolution

Javaee intro
Javaee introJavaee intro
Javaee introharis147
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenlissa cidhi
 
Introduction to java ee
Introduction to java eeIntroduction to java ee
Introduction to java eeRanjan Kumar
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youDmitry Buzdin
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Jagadish Prasath
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3Oracle
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012Arun Gupta
 
Creation of a Test Bed Environment for Core Java Applications using White Box...
Creation of a Test Bed Environment for Core Java Applications using White Box...Creation of a Test Bed Environment for Core Java Applications using White Box...
Creation of a Test Bed Environment for Core Java Applications using White Box...cscpconf
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Arun Gupta
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGArun Gupta
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureAllan Huang
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 

Similar to Java New Evolution (20)

Javaee intro
Javaee introJavaee intro
Javaee intro
 
Java se7 features
Java se7 featuresJava se7 features
Java se7 features
 
Jboss
JbossJboss
Jboss
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
JDK1.6
JDK1.6JDK1.6
JDK1.6
 
Introduction to java ee
Introduction to java eeIntroduction to java ee
Introduction to java ee
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Java 5
Java 5Java 5
Java 5
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
JEE5 New Features
JEE5 New FeaturesJEE5 New Features
JEE5 New Features
 
Creation of a Test Bed Environment for Core Java Applications using White Box...
Creation of a Test Bed Environment for Core Java Applications using White Box...Creation of a Test Bed Environment for Core Java Applications using White Box...
Creation of a Test Bed Environment for Core Java Applications using White Box...
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
 
8i r3 nfs
8i r3 nfs8i r3 nfs
8i r3 nfs
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 

More from Allan Huang

Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser ComparisonAllan Huang
 
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System DevelopmentAllan Huang
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New EvolutionAllan Huang
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New EvolutionAllan Huang
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignAllan Huang
 
Boilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementBoilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementAllan Huang
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapAllan Huang
 
HTML5 Multithreading
HTML5 MultithreadingHTML5 Multithreading
HTML5 MultithreadingAllan Huang
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web ApplicationAllan Huang
 
HTML5 Data Storage
HTML5 Data StorageHTML5 Data Storage
HTML5 Data StorageAllan Huang
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script PatternsAllan Huang
 
Weighted feed recommand
Weighted feed recommandWeighted feed recommand
Weighted feed recommandAllan Huang
 
eSobi Site Initiation
eSobi Site InitiationeSobi Site Initiation
eSobi Site InitiationAllan Huang
 
Architecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEArchitecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEAllan Huang
 
J2EE Performance Monitor (Profiler)
J2EE Performance Monitor (Profiler)J2EE Performance Monitor (Profiler)
J2EE Performance Monitor (Profiler)Allan Huang
 
Search is not only search
Search is not only searchSearch is not only search
Search is not only searchAllan Huang
 
Issue tracking workflow in web development and maintenance cycle
Issue tracking workflow in web development and maintenance cycleIssue tracking workflow in web development and maintenance cycle
Issue tracking workflow in web development and maintenance cycleAllan Huang
 

More from Allan Huang (20)

Drools
DroolsDrools
Drools
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser Comparison
 
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System Development
 
Tomcat New Evolution
Tomcat New EvolutionTomcat New Evolution
Tomcat New Evolution
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Boilerpipe Integration And Improvement
Boilerpipe Integration And ImprovementBoilerpipe Integration And Improvement
Boilerpipe Integration And Improvement
 
YQL Case Study
YQL Case StudyYQL Case Study
YQL Case Study
 
Build Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGapBuild Cross-Platform Mobile Application with PhoneGap
Build Cross-Platform Mobile Application with PhoneGap
 
HTML5 Multithreading
HTML5 MultithreadingHTML5 Multithreading
HTML5 Multithreading
 
HTML5 Offline Web Application
HTML5 Offline Web ApplicationHTML5 Offline Web Application
HTML5 Offline Web Application
 
HTML5 Data Storage
HTML5 Data StorageHTML5 Data Storage
HTML5 Data Storage
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
 
Weighted feed recommand
Weighted feed recommandWeighted feed recommand
Weighted feed recommand
 
Web Crawler
Web CrawlerWeb Crawler
Web Crawler
 
eSobi Site Initiation
eSobi Site InitiationeSobi Site Initiation
eSobi Site Initiation
 
Architecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EEArchitecture of eSobi club based on J2EE
Architecture of eSobi club based on J2EE
 
J2EE Performance Monitor (Profiler)
J2EE Performance Monitor (Profiler)J2EE Performance Monitor (Profiler)
J2EE Performance Monitor (Profiler)
 
Search is not only search
Search is not only searchSearch is not only search
Search is not only search
 
Issue tracking workflow in web development and maintenance cycle
Issue tracking workflow in web development and maintenance cycleIssue tracking workflow in web development and maintenance cycle
Issue tracking workflow in web development and maintenance cycle
 

Recently uploaded

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Java New Evolution

  • 1. Java New Evolution Allan Huang @ esobi Inc.
  • 2. Agenda    Java 5 Features Review Java 6 New Features Java 7 New Features
  • 3. Java Versions     Version 1.0 and 1.1 are named as JDK Version 1.2 to 1.4 are named as J2SE Version 1.5 are named as Java 5.0 JSR – Java Specification Request
  • 4. Versions and Naming         JDK 1.0 – 1996 JDK 1.1 – 1997 – JDBC, RMI, Reflection J2SE 1.2 – 1998 – Swing, Collections J2SE 1.3 – 2000 – HotSpot JVM, JavaSound, JNDI J2SE 1.4 – 2002 – assert, NIO, Web Start J2SE 5.0 (1.5) – 2004 – Generic, Autoboxing.. Java SE 6.0 (1.6) – 2006 – Rhino, JDBC 4.0… Java SE 7.0 (1.7) – 2011 – Small language changes, API changes
  • 6. Java 5 Features Review (1)  Generics  Allows a type or method to operate on objects of various types while providing compile-time type safety to the Collections Framework and eliminates the drudgery of casting.
  • 7. Java 5 Features Review (2)  Enhanced for Loop  This new language construct eliminates the drudgery and error-proneness of iterators and index variables when iterating over collections and arrays.
  • 8. Java 5 Features Review (3)  Autoboxing / Unboxing  Eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer).
  • 9. Java 5 Features Review (4)  Typesafe Enums  Allows you to create enumeration types with arbitrary methods and fields, then It provides all the benefits of the Typesafe Enum pattern without the verbosity and the errorproneness.
  • 10. Java 5 Features Review (5)  Varargs  Eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variablelength argument lists.
  • 11. Java 5 Features Review (6)  Static Import  Lets you avoid qualifying static members with class names without the shortcomings of the "Constant Interface Antipattern".
  • 12. Constant Interface Anti-pattern Anti-pattern  Better Pattern Describes the use of an interface solely to define constants, and having classes implement that interface in order to achieve convenient syntactic access to those constants.
  • 13. Java 5 Features Review (7)  Annotations (Metadata)  Lets you avoid writing Boilerplate Codes under many circumstances by enabling tools to generate it from a "declarative" programming style - annotations in the source code.
  • 14. Java 5 Features Review (8)  Java Utility Scanner  A simple text scanner which can parse primitive types and strings using regular expressions. You can provide several resource types to read from.
  • 15. Java 5 Features Review (9)  Java Utility Formatter  An interpreter for printf-style format strings that is like the printf function in C language.
  • 16. Java Features Review (10-1)  Java Utility Concurrent   The concurrency utilities packages provide a powerful, extensible framework of highperformance threading utilities. Advantages      Reduced programming effort Increased performance Increased reliability Improved maintainability Increased productivity
  • 17. Java Features Review (10-2)  Java Utility Concurrent  Task scheduling framework   Fork / join framework   Standardizes invocation, scheduling, execution, and control of asynchronous tasks according to a set of execution policies. Designs to efficiently run a large number of tasks using a pool of worker threads. Concurrent collections  Adds new collections classes and high-performance, concurrent implementations, e.g. Queue, BlockingQueue, BlockingDeque.
  • 18. Java Features Review (10-3)  Java Utility Concurrent  Atomic variables   Synchronizers   General purpose synchronization classes that facilitate coordination between threads. Locks   A small toolkit of classes that support lock-free thread-safe programming on single variables. Provides a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors. Nanosecond-granularity timing  Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds.
  • 21. Java 6 New Features (1)  Pluggable Annotation Processing API (JSR 269)    Annotations aimed in providing a Meta-Data Facility to the Java A Customized Annotation Processor which can be plugged-in to the code to operate on the set of annotations that appear in a source file. Class-Level Annotation   @Target(value = {ElementType.TYPE}) Method-Level Annotation  @Target(value = {ElementType.METHOD})
  • 22. Pluggable Annotation Processing API Examples Class-Level Annotation Method-Level Annotation
  • 23. Java 6 New Features (2-1)  Common Annotations (JSR 250)   Define a set of annotations that address common semantic concepts and therefore can be used by many Java EE and Java SE components. Avoid applications defining their own annotations which will result in having larger number of duplicates.
  • 24. Java 6 New Features (2-2)  Common Annotations (JSR 250)  @Generated   @Resource, @Resources, @DataSourceDefinition, @ManagedBean   Get executed after dependency injection is done or called before the instance is removed @Priority   Declares a reference to one / many resources @PostConstruct, @PreDestroy   Marks sources that have been generated Indicate in what order the classes should be used @DeclareRoles, @RoleAllowed, @PermitAll, @DenyAll, @RunAs  Role Based Annotations about security
  • 25. Java 6 New Features (3)  Java Architecture for XML Binding - JAXB 2.0 (JSR 222)   A Mapping Technology allows developers to map Java classes to XML representations. Two main features are capable of Marshalling Java objects into XML and Un-marshalling XML back into Java objects.
  • 27. Java 6 New Features (4)  Java API for XML Based Web Services – JAX-WS 2.0 (JSR 224)   Define a set of APIs for creating web services in SOAP, and provide many annotation to simplify the development and deployment for both web service clients and web service providers (endpoints). Java-to-WSDL mapping determines which Java method gets invoked and how that SOAP message is mapped to the method’s parameters, and also determines how the method’s return value gets mapped to the SOAP response.
  • 28. JAX-WS Architecture WS Action Flow WS Action in Server-Side
  • 29. JAX-WS Examples Service Endpoint Interface Service Endpoint Publisher Service Endpoint Implementation Web Service Client
  • 30. Java 6 New Features (5-1)  Web Services Metadata for Java (JSR 181)   Annotate a Web Service implementation class or a Web Service interface, and create portable Java Web Services from a simple POJO class by adding annotations Benefits    Provide a simplified model for developing Web Services Abstract the implementation details Achieve robustness, easy maintenance, and high interoperability
  • 31. Java 6 New Features (5-2)  Web Services Metatdata for Java (JSR 181)  @WebService   @WebMethod   Denotes a method that is a Web Service operation @OneWay   Marks a Java class as implementing a Web Service or marks a service endpoint interface (SEI) as implementing a Web Service interface Denotes a method as a Web Service one-way operation that only has an input message and no output message @WebParam  Customizes the mapping of an individual parameter to a Web Service message part and XML element
  • 32. Java 6 New Features (5-3)  Web Services Metatdata for Java (JSR 181)  @WebResult   @HandleChain   Customizes the mapping of a return value to a WSDL part or XML element Associates the Web Service with an externally defined handler chain @SOAPBinding  Specifies the mapping of the Web Service onto the SOAP message protocol
  • 33. Java 6 New Features (6-1)  Streaming API for XML – StAX (JSR 173)       StAX API exposes methods for iterative, eventbased processing of XML documents. StAX is a Pull style API, SAX is a Push style API. StAX can do both XML reading and writing, SAX can only do XML reading. StAX allows Sub-parsing / Delegation StAX has support for XML Writing StAX has not support for Schema Validation
  • 34. Java 6 New Features (6-2)  Streaming API for XML – StAX (JSR 173)  StAX is really two distinct API sets    Iterator API can keep track of the previous event, but Cursor can’t do that.   A Cursor API is likes JDBC ResultSet An Iterator API is likes Iterator interface javax.xml.stream.XMLEventReader Cursor API is more memory-efficient than Iterator API.  javax.xml.stream.XMLStreamReader
  • 36. StAX API Examples Read from XML Write to XML
  • 37. Java 6 New Features (7)  XML Digital Signature (JSR 105)  Digital Signature    A value computed with a cryptographic algorithm and appended to a data object in such a way that any recipient of the data can use the signature to verify the data's origin and integrity. Define a standard set of APIs for generating and validating XML Digital Signatures specified by W3C. It defines a process and a format for generating digital signatures in the XML format, and it can sign arbitrary data, whether it is XML or binary.
  • 39. Java 6 New Features (8)  Java Class File Specification Update (JSR 202)   This JSR will make incremental updates to the Java class file format. This will principally consist of increasing certain class file size limits and adding support for split verification.
  • 40. Java 6 New Features (9-1)  Java Compiler API (JSR 199)   Allow a Java program to select and invoke a Java compiler programmatically, then compile java source files. Web and application servers can depend on this API exhaustively to provide compilation activities of the dynamically created Java source files.
  • 41. Java 6 New Features (9-2)  Java Compiler API (JSR 199)  JavaFileManager    Create output files, scan for the input files, and cache them for better performance. The content of Input files managed may come from a physical file in a hard-disk, in-memory or a remote socket. DiagnosticListener  Report the diagnostics (error, warning or information) that may occur during the compilation process within a program.
  • 42. Java 6 New Features (10-1)  JDBC 4.0 (JSR 221)  Auto-loading of JDBC driver class     No need for Class.forName(“DriverName”) Support Service Provider Mechanism via METAINF/services/java.sql.Driver Find unique JDBC driver via java.util.ServiceLoader RowID data type support     A kind of pseudo column for Oracle and DB2, etc. RowIDs are unique IDs for rows in a given table. RowIDs are the fastest means of accessing particular rows. RowIDs can be used to see how a table is organized.
  • 43. Java 6 New Features (10-2)  JDBC 4.0 (JSR 221)  Connection management enhancements   SQL Exception handling enhancements    Improved connection state tracking New SQLException Sub-Classes: Transient, Recoverable, Non-Transient exceptions Enhanced For-Each Loop in Iterable SQLException SQLXML data type support for SQL:2003   Correspond to the XML data type in the database Use an DOM or SAX representation of XML data
  • 44. Java 6 New Features (10-3)  JDBC 4.0 (JSR 221)  Enhanced Blob / Clob functionality    National Character Set support   New corresponding methods for NCHAR, NVARCHAR, LONGNVARCHAR, NCLOB A bundled Database – Apache Derby   New corresponding methods for BLOB, CLOB, NCLOB A new method free() for release of resource An open source relational database implemented entirely in Java Not support Annotation-Based SQL Queries
  • 45. JDBC 4.0 Examples Service Loader SQLXML
  • 46. Java 6 New Features (11-1)  JavaScript Support – Rhino (JSR 223)   Mozilla Rhino Script Engine that supports various Scripting Languages is integrated into the Java. Rhino converts JavaScript scripts into classes, and it’s intended to be used in server-side apps without built-in support for the Web browser objects.
  • 47. Java 6 New Features (11-2)  JavaScript Support – Rhino (JSR 223)  Convenience   Developing rapid prototypes   Avoid the edit-compile-run cycle and just use edit-run! Application extension/customization   Create new variables without declaring the variable type, and reuse variables to store objects of different types. You can "externalize" parts of your application. "Command line" shells for applications  Admins and deployers frequently prefer command line tools for debugging, runtime / deploy time configuration.
  • 48. Java 6 New Features (11-3)  JavaScript Support – Rhino (JSR 223)   Language Bindings provides mechanisms for establishing communications between the Java code and the script code. ScriptEngineManager class provides mechanisms for Searching and Adding Scripting Engines into the Java Platform.
  • 51. Java 7 New Features (1)  Binary Literals   The types byte, short, int, and long can also be expressed using the binary number system. To specify a binary literal, add the prefix 0b or 0B to the number.
  • 52. Java 7 New Features (2)  Underscores in Numeric Literals  Any number of underscore characters (_) can appear anywhere between digits in a numerical literal.
  • 53. Java 7 New Features (3)  Strings in switch Statements  Use the String class in the expression of a switch statement.
  • 54. Java 7 New Features (4)  Type Inference for Generic Instance Creation   Replace the type arguments required to invoke the constructor of a generic class with an empty set of type parameters (<>). This pair of angle brackets is informally called the diamond.
  • 55. Java 7 New Features (5)  Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods  The complier generates a warning at the declaration site of a varargs method or constructor with a non-reifiable varargs formal parameter.
  • 56. Java 7 New Features (5-1)  Heap Pollution   A non-reifiable type is a type that is not completely available at runtime, and type erasure removes information from parameterized types at compile-time. Heap pollution occurs when a variable of a parameterized type refers to an object that is not of that parameterized type.
  • 57. Java 7 New Features (5-2)  Variable Arguments Methods and Non-Reifiable Formal Parameters   Compiler encounters a varargs method, it translates the varargs formal parameter into an array. Java does not permit the creation of arrays of parameterized types.
  • 58. Java 7 New Features (5-3)  Potential Vulnerabilities of Varargs Methods with Non-Reifiable Formal Parameters  Compiler has generated a warning when it translated the varargs formal parameter to the formal parameter.
  • 59. Java 7 New Features (5-4)  Suppressing Warnings from Varargs Methods with Non-Reifiable Formal Parameters  If you declare a varargs method with parameterized parameters, and you ensure that the method does not throw a ClassCastException or other similar exception, you can suppress the warning that the compiler generates.
  • 60. Suppressing Compiler Warnings    Add @SafeVarargs to the static and non-constructor method declarations Add @SuppressWarnings(“unchecked") to the method declaration Use the compiler non-standard option -Xlint:varargs
  • 61. Java 7 New Features (6)  The try-with-resources Statement   A try statement declare one or more resources and ensures that each resource is automatically closed at the end of the statement. A resource is an object that must be closed after the program is finished with it, and it implements java.lang.AutoClosable.
  • 62. Java 7 New Features (7)  Handling More Than One Type of Exception  A single catch block can handle more than one type of exception that can reduce code duplication and lessen the temptation to catch an overly broad exception.
  • 63. Java 7 New Features (8)  Rethrowing Exceptions with More Inclusive Type Checking  Performs more precise analysis of rethrown exceptions that enables you to specify more specific exception types in the throws clause of a method declaration.
  • 64. Java 7 New Features (9-1)  Java New I/O 2.0 – NIO.2 (JSR 203)  A new file system and path abstraction   Metadata File Attributes   Provides new file system functionalities to perform over a file, a directory, or a link. Provides access to metadata file attributes through the java.nio.file.attribute package. Symbolic Links and Hard Links   Provides support for both hard links and symbolic links (soft link). Each method of the Path class knows how to detect a link and will behave in the default manner.
  • 65. Java 7 New Features (9-2)  Hard Link vs. Symbolic Link (Soft Link)    A hard link is an actual physical entity representing the link. A symbolic link is a pointer to a physical entity. Symbolic links function similar to the short-cuts in a DOS based operating system.
  • 66. Java 7 New Features (9-3)  Java New I/O 2.0 – NIO.2 (JSR 203)  New API for Files and Directories   The FileVisitor Interface   Performs the most common tasks for managing files and directories, such as create, read, write, move, delete. Traverses a file tree via FileVisitor, such as finding, copying, deleting, and moving files. Monitoring via Watch Service API   A thread-safe service that is capable of watching objects for changes and events. Monitors a directory for changes to its content through actions such as create, delete, and modify.
  • 67. Java 7 New Features (9-4)  Java New I/O 2.0 – NIO.2 (JSR 203)  New powerful Random Access Files   Networking with the Sockets APIs   Provides facilities such as mapping a region of the file directly into memory for faster access, locking a region of the file, etc. Updating existing classes with new methods and adding new interfaces/classes for writing TCP/UDP-based applications. The Asynchronous Channel API  A channel that supports asynchronous I/O operations for use by multiple concurrent threads.
  • 68. NIO.2 Examples (1) Selectors Help Multiplex Change Notification
  • 69. NIO.2 Examples (2) Memory Mapping Char Encoding & Searching
  • 70. Java 7 New Features (10-1)  Dynamically Typed Languages Support (JSR 292)  Static Language (Static type-checking)   Dynamic Language (Dynamic type-checking)    The process of verifying the type safety of a program based on analysis of a program's source code. The process of verifying the type safety of a program at runtime. Developers are increasingly using pre-existing runtime environments to host their languages. Allows an easier mix and match approach of dynamic and static languages on the JVM.
  • 71. Java 7 New Features (10-2)   Dynamically Typed Languages Support (JSR 292)  Adds a new bytecode instruction - InvokeDynamic, to allow method invocation relying on dynamic type checking. Three major features  Dynamic Invocation   Method Handle Invocation   This instruction is used to call methods which have linkage and dispatch semantics defined by non-Java languages. A method handle is a typed, directly executable reference to an underlying method, constructor, field, or similar low-level operation, with optional transformations of arguments or return values. Exotic (non-Java) Identifiers  An exotic identifier is introduced by a hash mark (# symbol), which is immediately followed by a string literal.
  • 73. Reference (1)           Java Programming Language Enhancements Constant interface Boilerplate Code Wikipedia Concurrency Utilities Overview Introduction to Java 6.0 New Features, Part–1 Java SE 6 Features and Enhancements JSR 250 Wikipedia Java Architecture for XML Binding Wikipedia Tutorial: Review of JAX-WS Server Side for the Web Services JAX-WS Hello World Example – RPC Style
  • 74. Reference (2)            Java API for XML Web Services Wikipedia Web Services Metadata for Java Wikipedia JAX-WS annotations Mapping Java Objects and XML Documents using JAXB in Ja Programming With the Java XML Digital Signature API The Java 6.0 Compiler API Java & XML Tutorial: StAX StAX API StAX the odds with Woodstox JDBC 4.0 API in Java 6.0 JDBC 4.0 Enhancements in Java SE 6
  • 75. Reference (3)           Rhino (JavaScript Engine) Wikipedia Java Scripting Programmer’s Guide Java SE 7 Features and Enhancements JDK7: Part 1- The power of java 7 NIO.2 Five ways to maximize Java NIO and NIO.2 What is the difference between symbolic link and hard link JSR 292 and the Multi-lingual JVM An Introduction To Programming Type Systems Type System Wikipedia InterfaceDynamic - Da Vinci Machine Project
  • 76. Q&A