如果能说清楚容器怎么管理ejb,servlet的话,俺自己就能写个ejb服务器了,哈哈如果真的很想搞明白的,建议看jboss的源代码去,它用的什么mbean来管理各种东东的

解决方案 »

  1.   

    就是给你的ejb提供一些额外的功能,如事务处理,安全,并发处理等,这些你不用通过程序实现,只要配置一下就可以了.这些东西最好反复看几遍,慢慢领悟!
      

  2.   

    What is a Container?
    There are many different types of containers. There are EJB Containers, Web Containers, servlet containers, and so on. In general, containers provide a hosting environment for software components to run in. Containers provide general services that can be used by the components within the environment, without the need or worry of being required by the component developer. A Web Container allows servlets, JSP components, and other Java classes to be deployed and executed within the container. Services like JNDI, connection pooling, and transaction services, can be configured at the container level, and the component developers don’t have to worry about the management of these resources; similar to the way in which EJB containers manages security, transactions, and bean pooling. When using the services provided by a container, component developers may have to give up some control of the environment to the container, in trade for important services that the developers don’t have to worry about building. Third-party vendors, who must follow certain guidelines that are explicitly laid out in public specifications, build these containers. Although each vendor is allowed to implement certain portions of the container in a proprietary manner, they must follow the specification to ensure that portability can be achieved by the developer.
    [Copy from TheServerSide book review Chapter 2]
      

  3.   

    EJB容器为组件提供运行空间,管理运行在其中的组件(Enterprise JavaBean)
    还有一个概念是EJB服务器,服务器是用来管理EJB容器的,一个服务器中可以有多个容器在运行。
    EJB的生成,销毁等等工作,已经运行的环境,都是EJB容器提供的。
    目前,EJB容器和EJB服务器之间没有明显的区别。