Search code examples
ejb-3.0ejb-3.1openejb

what is the difference between an embedded EJB container Vs actual server container


What is the clear difference between embedded EJB containers Vs the actual server containers which are used in production.

I can find 2 sceanrios.

  1. For eg. glassfish-embedded-static-shell.jar - which does not have any implementation and depends on the local installation of a glassfish server.
  2. Like OpenEJB - which requires just the jar to be added to the classpath and no installation as such.

AFAIK, both are called embedded containers. So, what is the real meaning of it?

Also, does an embedded container have all the features supported by the EJB specification?


Solution

  • A server EJB container is launched as part of an application server application and usually has deeper integration with other services and technologies included with the application server. An embeddable EJB container is launched by your application when you get control (e.g., because your class has a main method, and you want to have EJBs). For this reason, an embeddable EJB container is convenient for unit testing.

    An embeddable EJB container may but is not required to have all the features supported by the EJB specification. Table 27 (section 21.1) of the EJB 3.1 spec lists the features required by an embeddable EJB container. In particular, an embeddable EJB container is not required to support:

    • Remote EJBs (as a client or as a server).
    • Webservices
    • Timers
    • MDBs and Entity beans