0% found this document useful (0 votes)
72 views39 pages

A Presentation On: Thread Local & Features of JAVA SE6

The document provides information about three main topics: 1. Thread Local - It defines Thread Local as a unique key for every individual thread and discusses how it solves the problem of creating thread-safe classes. 2. Features of Java SE6 - It lists some key features added in Java SE6 like performance improvements, JDBC 4.0 support, GUI improvements in Swing, etc. 3. Enhancements in various areas - It discusses enhancements made in areas like collections framework, I/O, jar/zip files, networking, internationalization etc. in Java SE6.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views39 pages

A Presentation On: Thread Local & Features of JAVA SE6

The document provides information about three main topics: 1. Thread Local - It defines Thread Local as a unique key for every individual thread and discusses how it solves the problem of creating thread-safe classes. 2. Features of Java SE6 - It lists some key features added in Java SE6 like performance improvements, JDBC 4.0 support, GUI improvements in Swing, etc. 3. Enhancements in various areas - It discusses enhancements made in areas like collections framework, I/O, jar/zip files, networking, internationalization etc. in Java SE6.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

A Presentation On

Thread Local & Features Of JAVA SE6


By :Hussain Akhtar Wahid

Thread Local

Definition
A Thread Local is a unique key for every individual thread .Only the Owner owns the right to modify it . Thus it solves the problem of creating Thread-Safe Classes rather making easy classes and then handling the synchronization issue.

A thread-local variable effectively provides a separate copy of its value for each thread that uses it. Each thread can see only the value associated with that thread, and is unaware that other threads may be using or modifying their own copies.

Thread Local Class

Public class ThreadLocal () { public Object get(); public void set(Object newValue); public Object initialValue(); }

Hierarchy
java.lang.Object java.lang.ThreadLocal java.lang.InheritableThread

Constructor ThreadLocal()

Methods
T get() T protected initialValue() Void remove() Void set(T value)

SubClass InheritableThreadLocal

Contains all the parent method T get() T protected initialValue() Void remove() Void set(T value) One Extra Method Protected childValue(T parent value)

Thread Locale

Interface for
org.apache.hivemind.Service

java.util.locale
Interface ThreadLocale Class ThreadLocaleImp (implements ThreadLocale) getLocale(),setLocale()

PROGRAMS

Features Of JAVA SE6

Java SE 6 (december 11, 2006) mustang Beta versions were released in February and June 2006, leading up to a final release that occurred on December 11, 2006. The current revision is update 14 which was released in may 2009.

Java SE 6 is the current major release of the Java SE platform, with full support from NetBeans IDE. Sun endeavors to foster the highest level of transparency and collaboration on the platform with the Java community through Project JDK 6, resulting in the following key features

Featured Added

Support for older win9x versions dropped. Scripting lang support Dramatic performance improvements for the core platform, and swing. Improved web service support through JAX-WS JDBC 4.0 support Java compiler API: an API allowing a java program to select and invoke a java compiler programmatically. GUI improvements:Swing Nimbus http://www.oracle.com/technetwork/java/javase/adoptionguide-137484.html http://www.oracle.com/technetwork/java/javase/adoptionguide-137484.html

Implementations One By One

implementations JVM

1 : client applications -client 2 : server applications server features of Hot Spot JVM
1 : Adaptive compiler 2 : Rapid memory allocation and garbage collection 3 : Thread synchronization (designed to scale readily for use in large, shared-memory multiprocessor servers)

Tool
java [ options ] class [ argument ... ] java [ options ] -jar file.jar [ argument ... ] javaw [ options ] class [ argument ... ] javaw [ options ] -jar file.jar [ argument ... ] options -client -server -agentlib:libname[=options] -agentpath:pathname[=options] -classpath classpath

-cp classpath -verbose -verbose:class Display information about each class loaded. -verbose:gc Report on each garbage collection event. -verbose:jni Report information about use of native methods and other Java Native Interface activity. -version Display version information and exit.

-enableassertions[:<package name>"..." | :<class name> ] -ea[:<package name>"..." | :<class name> ] -Dproperty=value -disableassertions[:<package name>"..." | :<class ; ] -da[:<package name>"..." | :<class name> ] -enablesystemassertions -esa -disablesystemassertions -dsa -javaagent:jarpath[=options] Load a Java programming language agent, see java.lang.instrument. -verbose -verbose:class Display information about each class loaded. -verbose:gc Report on each garbage collection event. -verbose:jni Report information about use of native methods and other Java Native Interface activity. -version Display version information and exit. -showversion

Compaction enhancement Parallel Compaction


Parallel compaction complements the existing parallel collector by performing full GCs in parallel to take advantage of multiprocessor (or multithreaded) hardware. As the name suggests, it is best suited to platforms that have two or more CPUs or two or more hardware threads. It was first made available in JDK 5.0

update 6; the implementation in JDK 6 contains significant performance improvements.

Enabling

-XX:+UseParallelOldGC Concurrent Mark Sweep Collector Enhancements -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent

Deployment Enhancements in Java SE 6

Java Web Start and Java Plug-in Common Enhancements Cache and System Format
The format of the cache is completely changed and should never be assumed. Any existing code using the previous cache format for Java Web Start or Java Plug-in will no longer work. Existing applications in the Java Web Start cache will be upgraded and converted to the new cache format the first time you run a Java Web Start application, or if you launch the cache viewer using

javaws -viewer.

The system cache will be upgraded and converted to the new format the first time you launch Java Web Start in system mode, or if you just

javaws -system. Java.io.File


launch

java.io Enhancements

New Class java.io.Console NewMethods getTotalSpace() getFreeSpace() getUsableSpace() setWritable(boolean writable, boolean ownerOnly) setWritable(boolean writable) setReadable(boolean readable, boolean ownerOnly) setReadable(boolean readable) setExecutable(boolean executable, boolean ownerOnly)setExecutable(boolean executable) canExecute()

IOException supports exception chaining via the addition of the new constructors IOException(String, Throwable) and IOException(Throwable) . The behavior of the following method was modified: The File.isFile() Windows implementation has been modified to always return false for reserved device names such as CON, NUL, AUX, LPT, etc. Previously it returned true, which customers considered a bug because it was inconsistent with behavior for devices on Unix.

Jar and Zip Enhancements

API changes java.util.zip.DeflaterInputStream java.util.zip.InflaterOutputStream

: Data read from this stream is compressed.

: Data written to this stream is

decompressed. Implementation changes On all platforms, zip files can contain more than 64k entries. On Windows, some limitations have been removed: File names longer than 256 characters are now supported. The limitation of just over 2,000 simultaneously open zip files has been removed.

Java RMI Release Notes


TM

java.rmi.MarshalledObject now generic The class MarshalledObject now has a type parameter representing the type of the contained serialized object. Bug fix: Explicit TCP ports freed after remote objects unexported (4457683 ) Bug fix: Garbage collection of client socket factories (4486732 ) Default GC interval lengthed to one hour (6200091 )

Internationalization Support

With the addition of localization data, the same executable can run worldwide. Textual elements, such as status messages and the GUI component labels, are not hardcoded in the program. Instead they are stored outside the source code and retrieved dynamically. Support for new languages does not require recompilation. Culturally-dependent data, such as dates and currencies, appear in formats that conform to the end user's region and language. It can be localized quickly.

Collections Framework Enhancements

New interfaces Deque - a double ended queue, supporting element insertion and removal at both ends. Extends the Queue interface. BlockingDeque - a Deque with operations that wait for the deque to become nonempty when retrieving an element, and wait for space to become available in the deque when storing an element. Extends both the Deque andBlockingQueue interfaces. (This interface is part of java.util.concurrent .) NavigableSet - a SortedSet extended with navigation methods reporting closest matches for given search targets. A NavigableSet may be accessed and traversed in either ascending or descending order. This interface is intended to supersede the SortedSet interface. NavigableMap - a SortedMap extended with navigation methods returning the closest matches for given search targets. A NavigableMap may be accessed and traversed in either ascending or descending key order. This interface is intended to supersede the SortedMap interface. ConcurrentNavigableMap

New concrete class

- efficient resizable-array implementation of the Deque interface. ConcurrentSkipListSet - concurrent scalable skip list implementation of the NavigableSet interface. ConcurrentSkipListMap - concurrent scalable skip list implementation of the ConcurrentNavigableMap interface. LinkedBlockingDeque - concurrent scalable optionally bounded FIFO blocking deque backed by linked nodes. AbstractMap.SimpleEntry - simple mutable implementation of Map.Entry AbstractMap.SimpleImmutableEntry - simple immutable implementation of Map.Entry

ArrayDeque

These class now also implement new interfaces LinkedList - retrofitted to implement the Deque interface. TreeSet - retrofitted to implement the NavigableSet interface. TreeMap - retrofitted to implement the NavigableMap interface. New methods added newSetFromMap(Map) - creates a general purpose Set implementation from a general purpose Map implementation. There is no IdentityHashSet class, but instead, just use Set<Object> identityHashSet= Collections.newSetFromMap( new IdentityHashMap<Object, Boolean>()); asLifoQueue(Deque) - returns a view of a Deque as a Last-in-firstout (Lifo) Queue. The Arrays utility class now has methods copyOf and copyOfRange that can efficiently resize, truncate, or copy subarrays for arrays of all types. Before:

Networking

HttpURLConnection sets Content-Type to application/x-www-formurlencoded Description Formerly, the HTTP protocol handler set a default Content-Type field. This caused problems for applications that were not expecting a Content-Type to be set. However, applications that depend on the default setting of Content-Type, will have to explicitly set it now.

2.2.3 Java compiler

Description By default, the compiler will generate class files using the new class file format (seehttp://jcp.org/en/jsr/detail?id=202). In rare cases, some programs will fail to compile because limitations in the class file format are exceeded.

PROGRAMS

You might also like