Showing posts with label appservers. Show all posts
Showing posts with label appservers. Show all posts

Thursday, July 25, 2013

Java EE and application servers, part five

Java EE is a set of specifications that are implemented by many application servers. The server that you choose to run your applications in a production environment depends on factors such as pricing, familiarity, performance, support options, and so on. If you plan to run your Java EE applications on the cloud, you can choose your cloud service provider based on the application server offered by their cloud platform.

If you develop your applications using standard Java EE APIs, you will have more flexibility when choosing an application server or a cloud platform, since your applications will run in any Java EE-compliant server.

The following list contains links to some of the most popular Java EE application servers:

GlassFish Server - An open-source application server sponsored by Oracle
WebLogic Server - A commercial application server sold by Oracle
WildFly - An open-source application server sponsored by RedHat
JBoss - A commercial application server sold by RedHat
TomEE - An open-source application server sponsored by the Apache Foundation
WebSphere - A commercial application server sold by IBM

We will use mostly the GlassFish server in future posts, but we may cover using some other application servers from time to time.

Wednesday, July 24, 2013

Java EE and application servers, part four

Application servers provide a variety of administration interfaces that enable you to:

  • Submit Java EE applications to run in the application server
  • Configure server parameters
  • Create resources such as connection pools, thread pools, and messaging queues

Each application server provides its own tools to perform these tasks. Most application servers provide a web-based administration console and a set of command-line tools. For example, the following figure shows the web administration console for GlassFish, a Java EE application server:

GlassFish web console

We will use administration interfaces for different application servers in future posts.

Tuesday, July 23, 2013

Java EE and application servers, part three

The application server provides applications with a range of services, as illustrated in the following figure:

Main services provided by an application server

The web server handles HTTP requests and responses from and to clients. Your application only needs to indicate at which URLs its web pages and web services should be made available to clients.

The messaging service enables applications to produce and consume messages to communicate between them.

The thread management service provides and manages new threads for applications to execute work. The application server maintains a pool of threads that can be reused, which increases the scalability of applications by using server resources more efficiently.

The injection service enables applications to obtain resources and dependencies automatically at run time. The application server creates and manages the lifecycle of these dependencies (objects), so the application does not have to.

The transaction management service enables applications to define transactional operations and restores the resources associated with a transaction to their original state automatically if an operation cannot be completed entirely.

The authentication service enables applications to manage users and groups and to grant access to some parts of an application only to some users or groups.

The connection pooling service maintains a pool of active connections to a resource (such as a database or a legacy system) that can be reused by applications. Connection pooling improves the performance of applications that use these connections.

The naming directory service enables administrators and applications to register resources (such as connection pools or message queues) in the application server and to access them by their name.

We will learn how to use these services in future posts.

Monday, July 22, 2013

Java EE and application servers, part two

From the previous post, we now understand that a Java EE application cannot run except inside a Java EE application server, and that the application server is a Java program that provides functionality and services to Java EE applications. This scenario is illustrated in the following figure:

Java EE application server

The system administrator starts the application server. As an application developer, you will run an application server in your development machine for testing your applications. While you need to learn the basics of running and configuring an application server, you do not need to become an expert on it. You can subscribe to a Java EE service on the cloud and submit your applications to it, as we will see in future posts.

You can deploy several Java EE applications to an application server. Deploying a Java EE application is like installing that application into the application server and activating it so that it can respond to requests from clients. The configuration settings included in each application tell the application server at what URLs the application should be accessible to clients, among other things.

Sunday, July 21, 2013

Java EE and application servers, part one

Java EE consists of a set of specifications which define:

- The services and functionality that the platform provides to applications
- The APIs that applications use to access these features
- How application servers must implement these features

The Java EE platform defines services and functionality that most web and enterprise applications need; it would not make sense for each application to reinvent the wheel. For example, a social networking site and an online store both need a web server, an authentication framework, a database connectivity engine, and so on.

An application server is a Java program that implements the services and functionality defined by the Java EE specifications. There are many Java EE application servers on the market, some of them available for free. Although some application servers provide additional proprietary functionality, a Java EE application that uses standard features should run in any application server with minor or no modifications.

An important distinction between a Java SE application and a Java EE application is the following: a Java SE application controls the main loop of execution, while a Java EE application does not. 

Java EE applications do not have a main() method and can only run within an application server, which controls the main loop of execution and invokes the application as required.