Monday, November 8, 2010

Whats new in Java Open JDK 7

Whats new in Java Open JDK 7


Open JDK 7

In addition to enhanced API's JDK7 highlights 5 new feature...

* Modularity
* Multi-Language Support
* New Garbage Collector
* NIO.2 New File System API
* Additional Swing API

Virtual Machine Level Features

Compressed 64-bit object pointers

A technique for compressing 64-bit pointers to fit into 32 bits, which decreases memory and memory bandwidth consumption and thereby improves performance

Garbage-First GC (G1)
A new garbage collector that promises to achieve lower pause times and better predictability than the current CMS collector

VM support for non-Java languages (InvokeDynamic)
VM extensions to support the implementation of non-Java languages at performance levels near to that of the Java language itself (JSR 292)

Language

Annotations on Java types

An extension to the Java annotation syntax to permit annotations on any occurrence of a type(JSR 308)

Language enhancements (Project Coin)
A set of small language changes intended to simplify common, day-to-day programming tasks

Language and VM support for modular programming
Enhancements to the Java language and virtual-machine specifications to support modular programming, at both compile time and run time(JSR 294)

Core

Modularization (Project Jigsaw)
An implementation-specific, simple, low-level module system focused upon the goal of modularizing the JDK, and the application of that system to the JDK itself

Upgrade class-loader architecture
Modifications to the ClassLoader API and implementation to avoid deadlocks in non-hierarchical class-loader topologies

Method to close a URLClassLoader
A method that frees the underlying resources, such as open files, held by a URLClassLoader

Unicode 5.1
Upgrade the supported version of Unicode to 5.1

Concurrency and collections updates (jsr166y)
A lightweight fork/join framework, generalized barriers and queues, a concurrent-reference HashMap, and fences to control fine-grained read/write ordering

More new I/O APIs for the Java platform (NIO.2)
New APIs for filesystem access, scalable asynchronous I/O operations, socket-channel binding and configuration, and multicast datagrams(JSR 203)

SCTP (Stream Control Transmission Protocol)
An implementation-specific API for the Stream Control Transmission Protocol on Solaris

SDP (Sockets Direct Protocol)
Implementation-specific support for reliable, high-performance network streams over Infiniband connections on Solaris

Elliptic-curve cryptography (ECC)
A portable implementation of the standard Elliptic Curve Cryptographic (ECC) algorithms, so that all Java applications can use ECC out-of-the-box

Client

XRender pipeline for Java 2D
A new Java2D graphics pipeline based upon the X11 XRender extension, which provides access to much of the functionality of modern GPUs

Forward-port 6u10 deployment features
Forward-port implementation-specific deployment features from the 6u10 release: The new Java Plug-In, Java Kernel, Quickstarter, and related installer features

Create new platform APIs for 6u10 graphics features
Create new platform APIs for features originally implemented in the 6u10 release: Translucent and shaped windows, heavyweight/lightweight mixing, and the improved AWT security warning

Nimbus look-and-feel for Swing
A next-generation cross-platform look-and-feel for Swing

Swing updates
Small additions to the Swing API including the JXLayer component decorator, JXDatePicker, and possibly CSS-based styling

Web

Update the XML stack
Upgrade the JAXP, JAXB, and JAX-WS APIs to the most recent stable versions

more info......
https://jdk7.dev.java.net/
http://java.sun.com/developer/media/deepdivejdk7.jsp

Java Technologies for Web Applications

Java Technologies for Web Applications

 

 
You can find web applications everywhere on the Internet. Many of these web applications are used to process online forms, tally voting polls, take orders within online stores, allow users to book a flight for their next business trip, or simply to display the user's login name. Which Java technologies do you need to create a web application and which packages do you need to import? The answer depends on what kind of application you're building and what it does.
This article provides an overview of the Java technologies involved in creating various types of web applications, tells you when you might decide to use them, and provides links to get you started. Future articles will cover how to use these technologies in building web applications. To use the technologies described in this article, download Java Development Kit (JDK) 5.0 Update 9 with Java Platform, Enterprise Edition (Java EE) or later and install it on your computer.
Before you begin coding, you need to understand what a web application is, what Java technologies are available for use, and what development tools can save you time and make creating applications easier.
Contents
What Is a Web Application?
Java Technologies to Use in Web Applications
Other Technologies to Consider
Development Tools

Web applications are by nature distributed applications, meaning that they are programs that run on more than one computer and communicate through a network or server. Specifically, web applications are accessed with a web browser and are popular because of the ease of using the browser as a user client. For the enterprise, the ability to update and maintain web applications without deploying and installing software on potentially thousands of client computers is a key reason for their popularity. Web applications are used for web mail, online retail sales, discussion boards, weblogs, online banking, and more. One web application can be accessed and used by millions of people.
Like desktop applications, web applications are made up of many parts and often contain miniprograms, some of which have user interfaces, and some of which do not require a graphical user interface (GUI) at all. In addition, web applications frequently require an additional markup or scripting language, such as HTML, CSS, or JavaScript programming language. Also, many applications use only the Java programming language, which is ideal because of its versatility.
A web application can be as simple as a page that shows the current date and time or as complex as a set of pages on which you can look up and book the most convenient flight, hotels, and car rentals for your next vacation.
The Java technologies you'll use to create web applications are a part of the Java EE platform, in addition to many of the Java Platform, Standard Edition (Java SE) classes and packages. In order for many of these technologies to work on a server, the server must have a container, or web server, installed that recognizes and runs the classes you create. For development and testing of these technologies, you can use the tools detailed in this article, but when you deploy, make sure that the server has Java server software installed to run Java technology-based web applications. If you don't have access to this information, ask the server administrator.
There are too many Java technologies to list in one article, so this article will describe only the ones most frequently used. The number of technologies listed here can appear overwhelming. Keep in mind that you will not need to use them all. In fact, a web application often consists of nothing more than one page created with the JavaServer Pages (JSP) technology. Sometimes you will combine three or more such technologies. No matter how many you end up using, it's good to know what is available to you and how you can use each one in a web application.
Java Servlet API
The Java Servlet API lets you define HTTP-specific classes. A servlet class extends the capabilities of servers that host applications that are accessed by way of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. For instance, you might use a servlet to get the text input from an online form and print it back to the screen in an HTML page and format, or you might use a different servlet to write the data to a file or database instead. A servlet runs on the server side -- without an application GUI or HTML user interface (UI) of its own. Java Servlet extensions make many web applications possible.
Figure 1 shows clients talking to Java Servlet extensions. Clients may range in complexity from simple HTML forms to sophisticated Java technology-based applets.
Figure 1: Servlet Model
Figure 1: Servlet Model
The javax.servlet and javax.servlet.http packages provide the classes and interfaces to define servlets. HTML servlet classes extend the javax.servlet.http.HttpServlet abstract class, which provides a framework for handling HTTP protocol.
Learn more about Java Servlet extensions and navigating with servlets.
JavaServer Pages Technology
JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic web content. JSP technology enables rapid development of web-based applications that are server- and platform-independent. JSP technology lets you add snippets of servlet code directly into a text-based document. Typically, a JSP page is a text-based document that contains two types of text:
  • Static data, which can be expressed in any text-based format, such as HTML, Wireless Markup Language (WML), or XML
  • JSP technology elements, which determine how the page constructs dynamic content
The packages involved in creating JSP pages are javax.el, javax.servlet.jsp, javax.servlet.jsp.el, and javax.servlet.jsp.tagext, though you will rarely have to import these directly. A JSP page can be as simple as a bit of HTML with one snippet of JSP code and the .jsp extension of the page name.
For instance, you can create a web site of JSP technology pages that use one snippet of code to include the header.html file, which contains the site navigation. This way, when you change a link to a button in the navigation, you make the change in only one file, and that file loads into all the pages on the site that have this code snippet:
<%@ include file="header.html" %>
That line of code works very much like a server-side include, if you are familiar with those. Because this web page is now a JSP page, you could also go on to add more Java technology code to create dynamic web content, such as polls, forms, ways to enter or retrieve data from a database, and so forth.
Take a look at two helpful documents about creating JSP pages:
JavaServer Pages Standard Tag Library
The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP technology-based applications. Instead of mixing tags from numerous vendors in your applications, you employ a single standard set of tags. This standardization allows you to deploy your applications on any JSP container that supports JSTL and makes it more likely that the implementation of the tags is optimized.
JSTL has iterator and conditional tags for handling flow control, tags for manipulating XML documents, internationalization tags, tags for accessing databases using SQL, and tags for commonly used functions.
The packages you can access for using JSTL are javax.servlet.jsp.jstl.core, javax.servlet.jsp.jstl.fmt, javax.servlet.jsp.jstl.sql, and javax.servlet.jsp.jstl.tlv.
Learn more about JSTL.
JavaServer Faces Technology
JavaServer Faces technology is a UI framework for building web applications. The main components of JavaServer Faces technology involve a GUI component framework, a flexible model for rendering components in various markup languages and technologies, and a standard RenderKit for generating HTML markup.
This functionality is available through standard Java APIs and XML-based configuration files. In addition, Sun Java Studio Creator IDE leverages JavaServer Faces technology in its drag-and-drop GUI tools, allowing you to use the technology without having to write or understand the underlying code. See also "Getting Started With Sun Java Studio Creator."
Java Message Service API
Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility. In other words, a messaging client can send messages to and receive messages from any other client. Each client connects to a messaging agent that provides facilities for creating, sending, receiving, and reading messages. By combining Java technology with enterprise messaging, the Java Message Service (JMS) API provides a powerful tool for solving enterprise computing problems.
Enterprise messaging provides a reliable, flexible service for the exchange of business data throughout an enterprise. The JMS API adds to this a common API and provider framework that enables the development of portable message-based applications in the Java programming language. An example of how JMS might be used is an application that keeps track of inventory for an auto manufacturer.The inventory component can send a message to the factory component when the inventory level for a product goes below a certain level, so the factory can make more cars. The factory component can send a message to the parts components so that the factory can assemble the parts it needs.The parts components in turn can send messages to their own inventory and order components to update their inventories and to order new parts from suppliers and so forth.
The JMS API improves programmer productivity by defining a common set of messaging concepts and programming strategies that all JMS technology-compliant messaging systems will support.
Learn more about the JMS API.
JavaMail API and the JavaBeans Activation Framework
Web applications can use the JavaMail API to send email notifications. The API has two parts: an application-level interface that the application components use to send email and a service provider interface. Service providers implement particular email protocols, such as SMTP. Several service providers are included with the JavaMail API package, and others are available separately. The Java EE platform includes the JavaMail extension with a service provider that allows application components to send email.
In conjunction with the JavaMail extension, you might use the JavaBeans Activation Framework (JAF) API. This API provides standard services to determine the type of an arbitrary piece of data, encapsulate access to it, discover the operations available on it, and create the appropriate component based on JavaBeans component architecture (JavaBeans component) to perform those operations.
The JavaMail API is now open source. See the GlassFish Project -- JavaMail home page.
Learn more about the JavaMail API and the JAF.
Java API for XML Processing
The Java API for XML Processing (JAXP), part of the Java SE platform, supports the processing of XML documents using the Document Object Model (DOM), the Simple API for XML (SAX), and Extensible Stylesheet Language Transformations (XSLT). JAXP enables applications to parse and transform XML documents independent of a particular XML-processing implementation.
JAXP also provides namespace support, which lets you work with schemas that might otherwise have naming conflicts. Designed to be flexible, JAXP lets you use any XML-compliant parser or XSL processor from within your application and supports the W3C schema.
Learn more about JAXP.
The Java API for XML Web Services (JAX-WS) is now an open-source project at java.net and is also a key part of the GlassFish project. See also Introducing JAX-WS 2.0 With the Java SE 6 Platform, Part 1.
JDBC API
The JDBC API allows you invoke database SQL commands from Java programming language methods. You can use the JDBC API in a servlet, JSP technology page, or an enterprise bean when you need to access the database.
The JDBC API has two parts: an application-level interface that application components use to access a database and a service provider interface to attach a JDBC driver to the Java EE platform.
The left side of Figure 2 shows how a client makes a direct call to the application server, usually through a servlet or JSP page, and that data is then sent to the database management system (DBMS) server. The right side of Figure 2 shows how a driver translates JDBC calls into the middleware vendor's protocol.
Figure 2: Browser to Database Model
Figure 2: Browser to Database Model
Learn more about the JDBC API.
Java Persistence API
The Java Persistence API is a Java technology standards-based solution for persistence. Persistence uses an object-relational mapping approach to bridge the gap between an object-oriented model and a relational database. Java technology persistence consists of three areas:
  • The Java Persistence API
  • The query language
  • Object-relational mapping metadata
Read the Java Persistence API FAQ.
Java Naming and Directory Interface
The Java Naming and Directory Interface (JNDI) provides naming and directory functionality, enabling applications to access multiple naming and directory services. It provides applications with methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a web application can store and retrieve any type of named Java technology object, allowing applications to coexist with many legacy applications and systems.
Naming services provide application clients, enterprise beans, and web components with access to a JNDI naming environment. A naming environment allows the developer to customize a component without having to access or change the component's source code. A container implements the component's environment and provides it to the component as a JNDI naming context.
Learn more about JNDI.
You might want to consider using the following other technologies in your web application, depending on the application's complexity:
Integrated development environments (IDEs) can speed the process of developing and testing web applications. It's no wonder that developers move to an IDE, but which one is right for you? Which features do you need? Sun Microsystems supports three IDEs for the Java platform: NetBeans IDE, Sun Java Studio Creator IDE, and Sun Java Studio Enterprise IDE.
NetBeans IDE
NetBeans IDE is free and open source. This IDE is written in the Java programming language and provides the services common to desktop applications, such as window and menu management, settings storage, and so forth. It is also the first IDE to fully support JDK 5.0 features. In addition, it supports web tools, including the NetBeans IDE Enterprise Pack, which adds everything you need to immediately start writing, testing, and debugging Java technology-based web applications.
The pack provides visual design tools for Unified Modeling Language (UML) modeling, XML schema creation, modification, and visualization, as well as development of secure, identity-enabled web services.
Sun Java Studio Creator IDE
Sun Java Studio Creator IDE is great for quick and easy web application development. In addition, this IDE is built on the NetBeans IDE, starting with a subset of the functionality and extending it.
Sun Java Studio Creator IDE allows you to build applications visually. The programming part is cleanly separated from the UI. With Sun Java Studio Creator IDE, the IDE takes care of a lot of the repetitive coding behind the UI.
The rapid visual drag-and-drop features are based on JavaServer Faces technology, which is a framework for building UIs for web applications. A GUI is used for manipulating JavaServer Faces components, as well as visually defining page flow. There's also graphical support for easily working with databases and web services.
Sun Java Studio Enterprise IDE
Sun Java Studio Enterprise IDE is a powerful set of tools that provides an integrated framework for enterprise-grade, rapid web application development. It offers enhanced debugging and development support for web services and for development of Java EE technology-based applications.
Sun Java Studio Enterprise IDE is built on and extends the NetBeans IDE. It also enables smart code editing, such as completing your code for you, with refactoring, renaming objects throughout an application. It also enables performance tuning -- ensuring better use of memory and so forth -- of applications with an optimal end- user experience.
Sun Java Studio Enterprise IDE provides a model-driven analysis, design, and development environment that leverages UML. This integrated feature reduces complexity and increases visual clarity across software development projects, ensuring that a sound architecture is established and communicated throughout the enterprise.
Now that you are familiar with the many Java technologies that you use in web applications, you are ready to develop your own application. In an upcoming series of articles, you will learn to create web applications using Sun Java Studio Creator IDE, which you can download for free, and learn how to use the Java technologies mentioned in this article. You will first create small simple applications, then work up to more complex programs. In the meantime, follow the links in this article to learn more about the Java technologies discussed in this article.

List of Java IDEs

List of Java IDEs

Here is a useful list of Java IDEs. They are in NO specific order!

Eclipse
This is a very good and open source IDE. It is used a lot commercially and personally. It was made in Java so it's cross-platform. It has a lot of support for additional plug-ins to extend your developing needs. What I love about Eclipse is that it compiles your code as you type. It highlights compiling errors and mistakes like how MS Word does for mis-spelled words.

Netbeans
This is a very good IDE also. It has a built-in GUI Builder for those you like that R.A.D. . It is used a lot commercially too. It was made in Java so it's cross-platform like Eclipse.

BlueJ
This is an IDE developed towards first time Java developers. It teaches you a lot of programming concepts in Java and has a nice UML tool.

JCreator
This is my first Java IDE I used. It is very good and very easy to use. This IDE was made in C++ unlike the ones above, which were all made in Java. Only runs on Windows platform.

IntelliJ IDEA
IntelliJ IDEA is an intelligent Java IDE intensely focused on developer productivity that provides a robust combination of enhanced development tools.

Borland JBuilder
This is a great commerial IDE for Java. It does have a price but some developers believe it's worth it. It also has a built-in Java GUI Builder.

Dr. Java
Dr. Java is a lightweight development environment for writing Java programs. It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users.