Definition of a Java Container

2019-01-16 11:24发布

I've read\heard many times about java containers such as a servlet container, however, I can't seem to find a good definition of what a container is in the enterprise java world.

Does anyone know of a good definition of an enterprise java container?

8条回答
放荡不羁爱自由
2楼-- · 2019-01-16 11:38

"Containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before a web component, enterprise bean, or application client component can be executed, it must be assembled into a Java EE module and deployed into its container." here is my source : http://docs.oracle.com/javaee/1.4/tutorial/doc/Overview3.html

查看更多
Deceive 欺骗
3楼-- · 2019-01-16 11:42

It is responsible for maintaining the individual components on the server side, which include Java servlets, Java server pages and Java server faces.

查看更多
女痞
4楼-- · 2019-01-16 11:42

Container- in the context of Java development, refers to a part of the server that is responsible for managing the lifecycle of Web applications. The Web applications specify the required lifecycle management with the help of a contract presented in XML format. The Web container cannot be accessed directly by a client. Rather, the server manages the Web container, which in turn manages the Web application code.

Ref- https://www.techopedia.com/definition/4252/container-java

查看更多
聊天终结者
5楼-- · 2019-01-16 11:49

A container is execution environment that brings dynamism. It creates HTTP response, converts HTTP request to an object and creates and manages servlet life cycle.

Java EE is the collection of the specification that are used to solve enterprise problems like security, scalability, robustness, availability etc.

A container that manages every specification of Java EE is known as Java enterprise container. Eg. glassfish, JBoss etc. (BTW Tomcat is not EE container it is web container)

查看更多
闹够了就滚
6楼-- · 2019-01-16 11:53

Java EE Containers

Normally, thin-client multitiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent Java EE architecture makes Java EE applications easy to write because business logic is organized into reusable components. In addition, the Java EE server provides underlying services in the form of a container for every component type. Because you do not have to develop these services yourself, you are free to concentrate on solving the business problem at hand.

http://download.oracle.com/javaee/5/tutorial/doc/bnabo.html

查看更多
Anthone
7楼-- · 2019-01-16 11:53

The key notion behind a container is inversion of control, where application components inside the container can be loosely coupled with other application components as well as lower-level resources they depend upon. For Java these resources are usually things like database connections, network connections, JNDI, etc.

Different tiers of containers support different specifications for instance a web/servlet container like tomcat does not support some application level specifications like EJB3, therefore tomcat cannot wire together ejb's for injection into your application.

查看更多
登录 后发表回答