What exactly is a container in J2EE and how does it help?

前端 未结 4 579
余生分开走
余生分开走 2021-01-30 07:30

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:

Containers provid

4条回答
  •  梦谈多话
    2021-01-30 07:47

    The JEE containers provide a wrapper around your source code.

    Typical containers are the classic EJB data bean, and, the message driven bean. To a certain extent servlets and portlets can also be regarded as containers.

    What the container provides a large number of services:-

    • invocation -- your code gets loaded and started when required.
    • transactional context -- most container code occurs in an ACID transaction context.
    • configuration -- things like JDBC connections are passed to you by the container.
    • security -- the container will restrict access to your code and data to authorized users.
    • scalability -- since the container is in charge of scheduling it can automatically fire up extra copies if the load gets heavy, or, can be statically configured to run several instances in parallel.
    • Encapsulation. Your program exposes a single interface to the container. However, externally it may expose this interface in a variety of forms (Corba,WSDL,JSM etc.).
    • Common services. such as logging, services exposed by other EJBs. etc.

提交回复
热议问题