This page describes a Java EE sample application and explains how it
can be easily deployed in a PaaS environment using GlassFish 4.0.
The application allows conference organizers to publish details about
their conference such as tracks, sessions, and speakers. It also allows
attendees to register for the conference and prepare their schedule. The application is built as a typical 3-tier Java EE
6 application using JavaServer Faces (with PrimeFaces widgets) for the
front-end, Enterprise JavaBeans for the middle tier business logic, and
Java Persistence API for connectivity with the database.
Deploying this application to GlassFish 4.0 highlights the following
Dynamic Service Provisioning: The service
dependencies are discovered by introspecting the application
archive and the required services such as Java EE, Database,
and Load Balancer are provisioned. These services may be
provisioned as part of an application deployment as is the
case here, or a deployment can use pre-provisioned services
that could be shared by different apps.
Elasticity using Auto-scaling: The Java EE
cluster is automatically resized to meet the growing demands
using auto-scaling. The decision to dynamically grow or
shrink is based upon metrics that are collected during the
application flow (see also
this other demonstration for more details on
Highly Available Cluster: The Java EE cluster is
highly available with session failover capabilities.
GlassFish 4.0 is a release in development that will allow for PaaS environments in the native and
virtualized mode. The native mode provisions all the services on a
non-virtualized environment such as a laptop/desktop and easy-to-replicate
development and debugging mode. The virtualized mode allows a PaaS
administrator to provision all the
services in a private or public cloud, in an IaaS-agnostic manner, and provides
for scalable deployments by supporting Elasticity to scale up (vertically) or
scale out (horizontally) and to scale down to meet the changing needs.
The Service Provisioning and Elasticity functionalities can be
automatically done by the system or allow for manual action.
Follow the instructions to deploy this application in the native mode:
Configure GlassFish for the native mode as: asadmin create-ims-config-native
Create a template for load balancer as: asadmin create-template --indexes ServiceType=LB,VirtualizationType=Native
Follow the instructions in the video below (starting at 5:24) to
deploy the application using PaaS Console. Make sure to pick javaone-sf-2011.sql for database initialization such that JavaOne San Francisco 2011 conference data is loaded. Pick devoxx-2011.sql if Devoxx 2011 conference data needs to be loaded.
Applications not using database functionality or not relying upon a SQL for the database
initialization can be deployed using CLI as: asadmin deploy --availabilityenabled=true
Enjoy the video below for a more detailed explanation of the installation
steps, application flow, dynamic service provisioning, high
availability and session failover, and auto-scaling using elasticity in
the virtualized mode.