J2EE中的容器到底是什么?它有什么帮助? [英] What exactly is a container in J2EE and how does it help?

查看:65
本文介绍了J2EE中的容器到底是什么?它有什么帮助?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在阅读J2EE 1.4规范,有很多我不明白的术语会做什么. 这来自容器的规范:

I'm reading J2EE 1.4 spec right now and there are lot of terms that I do not understand do what. This is from the specs for containers:

容器为J2EE应用程序组件提供运行时支持. 容器为应用程序提供了底层J2EE API的联合视图 成分. J2EE应用程序组件永远不会与其他J2EE直接交互 应用程序组件.他们将容器的协议和方法用于 彼此以及与平台服务进行交互.插入容器 在应用程序组件和J2EE服务之间可以使容器 透明地注入由组件的部署定义的服务 描述符,例如声明式事务管理,安全检查,资源 池和状态管理.

Containers provide the runtime support for J2EE application components. Containers provide a federated view of the underlying J2EE APIs to the application components. J2EE application components never interact directly with other J2EE application components. They use the protocols and methods of the container for interacting with each other and with platform services. Interposing a container between the application components and the J2EE services allows the container to transparently inject the services defined by the components’ deployment descriptors, such as declarative transaction management, security checks, resource pooling, and state management.

由于我来自Web开发领域,因此我无法掌握它的确切作用以及容器的用途.提供运行时支持是什么意思?就其可扩展性,体系结构而言,它如何使J2EE成为更好的系统?

Since I come from web development world, I'm not able to grasp, what exactly does this do and what is the purpose of a container. What is meant by providing run time support? How does it make a J2EE a better system in terms or scalability, architecture?

推荐答案

J2EE/Java EE应用程序不是自包含的.为了执行,需要在容器中部署.换句话说,容器在JVM之上提供了一个执行环境.

J2EE/Java EE applications aren't self contained. In order to be executed, they need to be deployed in a container. In other words, the container provides an execution environment on top of the JVM.

此外,应用程序依赖于几个API,例如JPA,EJB,Servlet,JMS,JNDI等.EE兼容容器的作用是为所有或某些API提供标准实现.这意味着从理论上讲,只要依赖标准API,您就可以在任何容器的顶部运行应用程序.

Also, applications rely on several APIs like JPA, EJB, servlet, JMS, JNDI, etc. The role of the EE compliant container is to provide a standard implementation of all or some of these APIs. This means you can theoretically run your application on top of any container as long as it relies on standard APIs.

从技术角度来看,容器只是具有main()方法的另一个Java SE应用程序.另一方面,EE应用程序是service/beans/servlets/etc的集合.容器找到这些组件并运行它们,从而提供API实现,监视,可伸缩性,可靠性等.

From a technical perspective, a container is just another Java SE application with a main() method. EE applications on the other hand are a collection of services/beans/servlets/etc. The container finds these components and runs them, providing API implementations, monitoring, scalability, reliability and so on.

这篇关于J2EE中的容器到底是什么?它有什么帮助?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆