Book Image

WildFly: New Features

By : Filippe C Spolti
Book Image

WildFly: New Features

By: Filippe C Spolti

Overview of this book

Table of Contents (13 chapters)
WildFly: New Features
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

What is WildFly?


WildFly, better known as JBoss Application Server, is a Java EE application developed entirely in Java, and thus can be run on any operating system, both 32 -bit and 64-bit. Some readers may wonder why JBoss had its name changed after so many years. This is due to a lot of confusion that was generated between the names of the products in their portfolio, and not only the JBoss application server, explains Jason Andersen, Director of Red Hat products. The name WildFly was selected by a vote initiated in October 2012, which was formally presented to the public in JUDCon Brazil 2013. The name WildFly was among other top-rated potential names such as basejump, Petasos, Jocron, and JBeret. But what really matters is its performance and ease of use. More details on the vote held by the company is available at http://www.jboss.org/vote.

The new WildFly has a highly optimized boot process; its services are started at the same time in order to eliminate the waiting time between the start of one service to the start of another, and all services that are not required at the time of startup are kept on standby until the time of first use. The main characteristics that it emphasizes on are connectivity, responsiveness, and scalability, and the main factor behind the improvements on these fronts is a new web server called Undertow,which is more powerful than its competitors such as Jetty Web Server. Its memory management is very aggressive in order to minimize the maximum allocation of heap memory. All the services used by WildFly use common indexed metadata cached to avoid the duplication of metadata. They also have modular load that prevents the loading of duplicate classes and has to be loaded over the system required for booting. All these factors not only reduce the overhead of heap memory but dramatically reduce the pauses made by the garbage collector (GC, this pause may be eliminated using the JVM settings) and also allow WildFly to run on devices with limited physical resources. WildFly implements the latest Java EE 7 specification that improve developer productivity by providing an easier way to develop modern Java EE applications, without requiring a combination of various existing frameworks, allowing a development team to operate with focus on the business of a company.

Hierarchical classloading often causes several problems, mainly library conflicts between different versions of the same library, but this ended in WildFly thanks to its modular structure that only links the JAR file to your application when it needs it.

Unlike most previous versions of JBoss, WildFly has all your settings centralized in a single file that is divided into subsystems that can be changed according to your needs; this becomes very useful if we are using a domain with multiple servers. In such cases, we have a centralized configuration in a single file. All the settings are based not only on edition of files; all management features are exposed through a Command Line Interface (that will be discussed in greater detail throughout this book), a web management interface, a native Java API, and through the Rest API-based HTTP / JSON and JMX. WildFly offers two execution modes: standalone and domain. The main difference between them is on the basis of scalability; the standalone mode works alone and the domain mode works with one or more servers.

WildFly practically supports all current Java EE 7 standards of web development and also features support for standards including JAX-RS, Java API, and it is also highly tolerant of server failures that give us support for clustering, session replication, and other services. WildFly also has a very large reduction in management and service ports, but is now going to have only two, application and management ports. The following screenshot gives a list of protocols that are supported along with the ports they utilize:

Downloading WildFly

In addition to the final version, WildFly has several other alpha and beta versions mainly intended for testers whose primary purpose is to perform tests such as stress, load, response time, and so on. Furthermore, these versions allow the users to identify errors and bugs that are fixed in the next release.

Before starting the download, we must prepare the environment. For this book, the environment used will be as follows:

With the operating system installed, we will download and install Java later. I advise you to always perform a manual installation and configuration of the latest available version. The Java SDK can be downloaded from http://www.oracle.com/technetwork/pt/java/javase/downloads/index.html.

In this case, I will be choosing to download the RPM version because we are using a RedHat-like operating system, as in an OS, which is based on the Red Hat Linux operating system, where the RPM is the native package manager. After the download, we will install and configure Java.

Installing Java

After you download Java and have already copied the file to our test server, we can now begin the Java installation.

  1. Use the following command on the CentOS cmd:

    [root@wfly-book ~]# rpm -ivh jdk-7u45-linux-x64.rpm
    Preparing...            ########################################### [100%]
       1:jdk                ########################################### [100%]
    Unpacking JAR files...
            rt.jar...
            jsse.jar...
            charsets.jar...
            tools.jar...
            localedata.jar...
           jfxrt.jar...
    
  2. After installation, we must set the JAVA_HOME environment variable:

  3. Add the location of your Java installation under/etc/profile:

    Example:
    #Java configuration
    export JAVA_HOME="/usr/java/jdk1.7.0_45"
    export PATH="$PATH:$JAVA_HOME/bin"
    
  4. Run the command below to apply the new configuration:

    [root@wfly_book ~]# source /etc/profile
    
  5. To check the integrity of the installation, just run a simple Java command to verify:

    [root@wfly_book ~]# java -version
    java version "1.7.0_45"
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
    

With the Java installation completed successfully, we are now able to go to the next topic.