Is Tomcat enterprise ready?

[复制链接]
查看11 | 回复9 | 2017-9-26 13:06:30 | 显示全部楼层 |阅读模式
When Java developers start talking about application servers, Tomcat is often thrown into the mix. After all, it's one of the most popular options for lightweight development scenarios, and in many cases meets the need for an application server, even though it is technically a Web server. In this article Jeff Hanson engages the question of whether Tomcat is an app server, first by explaining what differentiates application servers, Web servers, and Java EE containers, and then by evaluating Tomcat's suitability to a variety of common Java enterprise development scenarios.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
Confusion over whether Tomcat is an application server tends to result in heated discussion among Java developers -- some claiming it absolutely is and some that it definitely is not. In truth, Tomcat often is used as an app server, and for some scenarios it is perfectly suited to that role. For developers using Tomcat as an app server, it makes sense to classify it as such, regardless of formal definition.
In this article I tackle the question of whether Tomcat is an application server. I start by explaining the distinctions between app servers, Web servers, and Java EE containers, and then look at some scenarios where a Web server like Tomcat could be used appropriately as an app server. I show a scaled architecture, starting with the sort of lightweight implementation where Tomcat shines, and concluding with a complex service-oriented architecture, where you would be better off with a full-fledged Java EE application server.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
Java EE as a point of reference
Java Platform, Enterprise Edition, or Java EE, is the de facto standard for developing server-side Java applications. As such it is the foundation on which all other server-side Java technologies, including app servers, must rest. Java EE compliance is an essential factor when evaluating the difference between Web servers and application servers.
Java EE extends Java Platform, Standard Edition (Java SE) to support Web services, an enterprise component model, management APIs, and communication protocols for designing and implementing service-oriented architectures, distributed applications, and Web applications. (Note that Web applications are only one sector that Java EE seeks to support.)
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
A compliant Java EE application server must support features such as an Enterprise JavaBeans (EJB) server and container; JNDI capabilities; a Java Message Service (JMS) framework; a Java Transaction API (JTA) framework; and J2EE Connector Architecture. Java EE servers usually support a hierarchical classloader architecture enabling such functionality as EJB loading/reloading, WAR loading/reloading, manifest-specified utilities, and so on.
Java EE defines containers for client applications, servlets, and EJB components. These containers provide structure and functionality that facilitate the deployment, persistence, and execution of supported components.
Java EE also defines a standard architecture for connecting Java EE applications and application servers to heterogeneous Enterprise Information Systems, such as ERP systems, mainframes, database systems, and non-Java legacy applications. The J2EE Connector Architecture enables a provider of an enterprise system to expose the system using a standard interface known as a resource adapter. The resource adapter allows an application server or enterprise application to use the same interface for different enterprise system vendors. Resource adapters operate within the address space of a host application server.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
Figure 1 shows the tiers and components of a typical Java EE application architecture.



Figure 1. A typical Java EE application architecture (click to enlarge)
AJava EE application server is needed to support some, but not all, ofthe components shown in Figure 1. Using a Java EE server gives you theconvenience of hosting a system in a pre-tested environment that offersall of the Java enterprise development services. In some cases,however, the Java EE server brings unnecessary overhead to an executionenvironment that only requires one or two of these services.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
For instance, many Java-based Web applications are deployed to environments that only support the technologies found in a Web server/container, such as servlets, JSPs, and JDBC. In these scenarios you might choose to construct a system piecemeal, using sundry frameworks and providers. Some developers would choose to use Tomcat in place of the Java EE application server given these environmental constraints.
Oftentimes the decision of whether to use an application server or Web server depends on the type of communication needed between application components, so let's consider those options next.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
EARs, WARs, JARs, and Java EE
A Java EE application may contain one or more Java EE components such as EJBs, Web modules, resource adapters, or J2EE application client modules. Each Java EE component can have an associated deployment descriptor -- an XML file that describes the component. Java enterprise components are deployed using the Java Archive (JAR) file format, which branches into additional formats to handle various component types.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
The Java Archive (JAR) file format is based on the ZIP file format and enables you to bundle multiple Java EE components into a single file. A JAR file can contain Java class files, XML descriptor files, auxiliary resources, static HTML files, and other files associated with each Java EE component. A standard Java Web application is deployed in a Web Application Archive (WAR) file, which is a JAR file with the extension of .war. A standard Java EE application is deployed in an Enterprise Application Archive (EAR) file, which is a JAR file with an extension of .ear.
A WAR file is a specialized JAR file containing Web application components such as servlets, JSP files, HTML files, deployment descriptors, utility JAR files, etc. A WAR file can be deployed to a Web server such as Tomcat.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
An EAR file is a specialized JAR file containing Java EE application components such as Web applications (WAR files), EJBs, resource adapters, etc. An EAR file can be deployed to a Java EE application server such as JBoss, WebLogic, or WebSphere. Java EE application servers load EAR files at runtime and deploy the components found within each file as Web applications, resource adapters, EJBs, and so on, based on the instructions found in each component's deployment descriptor.
回复

使用道具 举报

千问 | 2017-9-26 13:06:30 | 显示全部楼层
Figure 2 illustrates the components found in many typical Java EE application server deployments.

Figure 2. Components of a typical Java EE application server deployment
AnEAR file can contain multiple Web applications along with otherresources and auxiliary components. Deploying an application as an EARfile within the structure of a Java EE application server environmentenables the app server to isolate each Web application within aseparate class-loading and resource-loading context. Web applicationsin the Java EE app server environment can share resources in common,such as utility class files.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行