Thursday Dec 10, 2009

Java EE 6 and GlassFish v3 Now Available

Today Sun announced the general availability of Java Platform, Enterprise Edition (Java EE) 6 and GlassFish v3. As many of you know, Java EE 5 made it significantly easier to develop web and enterprise applications. However, Java EE 6 pushes the usability envelope even further, adding ease of use improvements in many areas of the platform. For example, you can now use annotations to define web components such as servlets and servlet filters. In addition, Java EE application packaging requirements are much simpler. For example, you can add an enterprise bean directly to a web archive (WAR) file. You no longer need to package an enterprise bean in a Java archive (JAR) file and then put the JAR file in an enterprise archive (EAR) file.

Beyond those improvements, Java EE 6 adds many new features that make the platform more flexible and extensible. Java EE 6 introduces the concept of profiles, configurations of the platform that are designed for specific classes of applications. The first of these profiles, the Web Profile, is now available. It offers a subset of the Java EE platform designed for web application development.

On the extensibility front, Java EE 6 includes more extensibility points and more service provider interfaces than ever before. This allows you to plug in technologies — even frameworks — in your Java EE 6 implementations in a standard way. And with new features such as web fragments, Java EE 6 modularizes deployment descriptors, something that enables web frameworks to self-register, making it easy to incorporate and configure them in an application.

GlassFish v3 is a lightweight, flexible, and open-source application server that is the reference implementation for Java EE 6. But it's much more than that. It also offers a wide range of new productivity features, such as a modular runtime based on OSGi, that makes for extremely fast startup, efficient memory use, and runtime performance. GlassFish v3 also supports a deploy-on-save feature, such that when you update an application and save the changes in an enabled IDE such as NetBeans 6.8, the application is automatically redeployed. Many other enhancements, such as native support for scripting languages and frameworks like JRuby on Rails, make GlassFish v3 an ideal application server for web and enterprise applications.

Learn more about Java EE 6 in the article Introducing the Java EE 6 Platform. Learn more about GlassFish v3 at the GlassFish Community site and The Aquarium blog. Download GlassFish v3.

Friday Oct 30, 2009

Enterprise Tech Tip: Using CDI and Dependency Injection for Java in a JSF 2.0 Application

The next release of the enterprise Java platform, Java EE 6 includes a number of powerful new technologies and well as significant enhancements to existing technologies. Two of the new technologies are JSR 299: Contexts and Dependency Injection (CDI) (referred to in earlier times as Web Beans) and JSR 330: Dependency Injection For Java. One of the significantly enhanced technologies is JSR 314: JavaServer Faces 2.0.

CDI defines a set of services for the Java EE environment that makes applications much easier to develop. Perhaps most significantly, CDI unifies and simplifies the Enterprise JavaBeans (EJB) and JavaServer Faces (JSF) programming models. It allows enterprise beans to act as managed beans in a JSF application.

Until now there has not been a standard approach for annotation-based dependency injection. Dependency Injection For Java changes that by introducing a standard set of annotations that can be used for dependency injection.

If you're involved with creating user interfaces (UIs) for web applications, you're probably familiar with JavaServer Faces. It's a technology that provides a server-side component framework that is designed to simplify the development of UIs for Java EE applications. The latest release of the technology, JSR 314: JavaServer Faces 2.0, makes UI development for Java EE applications even easier through support for annotations and the addition of new features such as Facelets and composite components.

You can get a good idea of how these technologies simplify web application development by reading the Tech Tip Using CDI and Dependency Injection for Java in a JSF 2.0 Application, written by Roger Kitain, the JavaServer Faces co-specification lead. Roger presents a JSF 2.0 application and shows in the source code where CDI components and Dependency Injection for Java annotations play a role.

Tuesday Sep 29, 2009

Enterprise Tech Tip: Locking and Concurrency in Java Persistence 2.0

One of the real success stories behind Java EE 5 is the Java Persistence API, know informally as JPA. The technology has been widely adopted and is recognized as the enterprise standard for Object/Relational (O/R) persistence.

However, one of the shortcomings of JPA 1.0 is that the only type of locking it supports is optimistic locking. Recall that locking is a technique for handling database transaction concurrency. When two or more database transactions concurrently access the same data, locking is used to ensure that only one transaction at a time can change the data.

There are generally two locking approaches: optimistic and pessimistic. Optimistic locking assumes that there will be infrequent conflicts between concurrent transactions, that is, they won't often try to read and change the same data at the same time. In optimistic locking, the objective is to give concurrent transactions a lot of freedom to process simultaneously, but to detect and prevent collisions. Two transactions can access the same data simultaneously. However, to prevent collisions, a check is made to detect any changes made to the data since the data was last read.

Pessimistic locking assumes that transactions will frequently collide. In pessimistic locking, a transaction that reads the data locks it. Another transaction cannot change the data until the first transaction commits the read.

The next release of JPA, JPA 2.0, which will be offered as part of Java EE 6, adds support for pessimistic locking. Using JPA 2.0, you can lock an entity either optimistically or pessimistically, depending on how often you think transactions will collide.

To learn about the new locking support in JPA 2.0, see the Tech Tip Locking and Concurrency in Java Persistence 2.0 by Carol McDonald.

Tuesday Jul 07, 2009

New JDK 7 Feature: Support for Dynamically Typed Languages in the Java Virtual Machine

Over the years, the Java virtual machine (JVM) has been host to a growing number of languages. Increasingly, JVM implementations of dynamic languages are becoming available, such as JRuby, an implementation of the Ruby programming language, Jython, an implementation of the Python programming language, and the Groovy scripting language.

However, developers of these dynamic languages have faced a troublesome obstacle. When developers write engines for dynamically typed languages that run in the JVM, they have to satisfy the requirements of the Java bytecode that the JVM executes. Until now, that bytecode has been designed exclusively for statically typed languages. This design has been especially painful for developers when generating bytecodes for method invocations.

But help is on the way. JSR 292: Supporting Dynamically Typed Languages on the Java Platform, which is being implemented in JDK 7, introduces a new Java bytecode instruction for the JVM, invokedynamic, and a new method linkage mechanism based on method handles.

Learn more about this new JDK 7 feature in the article Support for Dynamically Typed Languages in the Java Virtual Machine.

Wednesday Aug 13, 2008

Young Developers Series

Programming is not just for adults anymore! The Young Developer Series teaches Java programming to anyone over 10 years of age, using a tool called Greenfoot. Read Wombat Object Basics and Wombat Classes Basics. See the Young Developers page for upcoming articles.

Thursday Jul 31, 2008

Enterprise Tech Tip: Combining Groovy, Grails, MySQL, and the Java Persistence API

With the addition of support for scripting languages in the Java platform, there has been a lot of interest in combining into web applications scripting languages such as Groovy, Java technologies such as the Java Persistence API (JPA), and databases such as MySQL. Read the tip Combining Groovy, Grails, MySQL, and the Java Persistence API and learn how to create an online catalog application using the Groovy language, the Grails framework, the MySQL database, the Java Persistence API, and the GlassFish application server. You'll also learn about the latest NetBeans IDE offering, NetBeans IDE 6.5 Milestone 1 (or M1 for short), which offers many new features including support for Groovy and Grails.

Saturday Jul 12, 2008

Ask the Experts Transcript: Java SE 6 Update 10

Check out the transcript of the Ask the Experts session on Java SE 6 Update 10 that was held the week of July 7, 2008. Danny Coward, Java SE 6 Platform Lead; Ken Russell, Java Plug-In Lead; and Richard Bair, SwingLabs Lead, answered a wide variety questions, covering topics such as a Java Plugin for Mac OSX, Nimbus skins for components, the JKernel, and making a Java app download smaller.

Monday Jun 30, 2008

Ask the Experts: Java SE 6 Update 10 Beta

Java SE 6 Update 10, currently available as a beta release, introduces many new features and enhancements that dramatically improve the developer and user experience. Some of the significant improvements in Java SE 6 result in faster and easier deployment of Java applications and applets, better performance, and an improved look and feel. Got a question about Java SE 6 Update 10? Post it during this session on the Sun Developer Network Ask the Experts page and get answers from three key members of Sun's Java SE Platform team: Danny Coward, Java SE 6 Platform Lead; Ken Russell, Java Plug-In Lead; and Richard Bair, SwingLabs Lead.

Wednesday Jan 16, 2008

Ask the Experts: Developing and Deploying Java SE-Based Applications in Solaris (Jan. 21-25)

Got a questions about developing or deploying Java SE applications in the Solaris Operating System? Get answers from experts in this session.[Read More]



« July 2016