Monday, February 17, 2014

Java EE 7 is here! What’s New in Java EE 7

          The most important goal of the Java EE 7 platform is to simplify development by providing a common foundation for the various kinds of components in the Java EE platform. Developers benefit from productivity improvements with more annotations and less XML configuration, more Plain Old Java Objects (POJOs), and simplified packaging. The Java EE 7 platform includes the following new features,

The main features of the new specifications :

  • Java API for WebSocket - WebSocket is an application protocol that provides full-duplex communications between two peers over TCP. The Java API for WebSocket enables Java EE applications to create endpoints using annotations that specify the configuration parameters of the endpoint and designate its lifecycle callback methods.
  • Java API for JSON Processing - JSON is a text-based data exchange format derived from JavaScript that is used in web services and other connected applications. The Java API for JSON Processing (JSON-P) enables Java EE applications to parse, transform, and query JSON data using the object model or the streaming model.JSON-P is new to the Java EE 7 platform. The Java EE 7 platform requires JSON-P 1.0.
  • Batch Applications for Java Platform - Allows for description of a Batch Job using Job Specification Language defined by an XML schema. It defines a complete execution sequence of the jobs.
  • Concurrency Utilities for Java EE - The Concurrency Utilities for Java EE is a standard API for providing asynchronous capabilities to Java EE application components through the following types of objects: managed executor service, managed scheduled executor service, managed thread factory, and context service.

The main features of the updated specifications :

  • Java API for RESTful Web Services - The Java API for RESTful Web Services (JAX-RS) defines APIs for the development of web services built according to the Representational State Transfer (REST) architectural style. A JAX-RS application is a web application that consists of classes packaged as a servlet in a WAR file along with required libraries.
  • Java Message Service - The Java Message Service (JMS) API is a messaging standard that allows Java EE application components to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.
  • Expression Language - This chapter introduces the Expression Language (also referred to as the EL), which provides an important mechanism for enabling the presentation layer (web pages) to communicate with the application logic (managed beans). The EL is used by both JavaServer Faces technology and JavaServer Pages (JSP) technology. The EL represents a union of the expression languages offered by JavaServer Faces technology and JSP technology.
  • Enterprise JavaBeans - Support for EJB 2.1, EJB QL, and JAX-RPC-based Web Service endpoints and client view is now optional.
  • Servlets - Defines a standard mechanism to upgrade existing HTTP connection to a different protocol using HttpUpgradeHandler, Offers nonblocking request and response processing for async servlets, Defines rules for which HTTP methods are covered by <security-constraint>
  • JavaServer Faces - Faces Flow provides an encapsulation of related views/pages with application defined entry and exit points.
  • Java Persistence - The Java Persistence API provides Java developers with an object/relational mapping facility for managing relational data in Java applications.
  • Interceptors - Interceptors are used in conjunction with Java EE managed classes to allow developers to invoke interceptor methods on an associated target class, in conjunction with method invocations or lifecycle events. Common uses of interceptors are logging, auditing, and profiling.
  • Contexts and Dependency Injection - Contexts and Dependency Injection for Java EE (CDI) is one of several Java EE features that help to knit together the web tier and the transactional tier of the Java EE platform.
  • Bean Validation - Validating input received from the user to maintain data integrity is an important part of application logic.
  • Java Transaction - 
  • @Transactional provides the application to declaratively control transaction boundaries on CDI-managed beans, as well as classes defined as managed beans by the Java EE specification, at both the class and method level where method-level annotations override those at the class level.
  • JavaMail - @MailSessionDefinition and @MailSessionDefintions defines MailSession to be registered with JNDI
  • Java EE Connector Architecture - Provides @AdministeredObjectDefinition , @AdministeredObjectDefintions , @ConnectorFactoryDefinition , and @ConnectorFactoryDefinitions to define a connector-administered object and factory to be registered in JNDI

         You can find the Java EE7 sample in Java GitHub site. Go to javaee7-samples

Sunday, February 2, 2014

Install nodejs and Grunt in Ubuntu 13.10

You can install the nodejs, bower and Gruntjs using below commands.


  • Install nodejs
      sudo apt-get install npm
  • Install Grunt 
     npm install -g grunt-cli
  • Install bower
 npm install -g bower

After install above libraries run the grunt command.  If you see an error you can run the below commands to overcome in ubuntu 13.10.
sudo apt-get install nodejs 
sudo ln -s /usr/bin/nodejs /usr/bin/node 
curl https://npmjs.org/install.sh | sudo sh