Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between an embedded container vs a managed container in Java EE 6?

I have read that embedded containers are worse than managed containers, which are in turn less reliable than remote containers.

Arquillian allows you to write 'real' tests, but I do not know the difference between these container types, mainly the embedded vs managed.

If I use Jboss within Eclipse, is that an embedded or managed container?

If I start Jboss from the command line, without eclipse, is that embedded or managed, or remote?

For bonus points, how does the word 'standalone' container fit in with these terms?

like image 811
user798719 Avatar asked Apr 09 '13 19:04

user798719


People also ask

What is an embedded container?

Container technology is fundamentally changing how systems are developed, tested, deployed, and managed. The main functions of embedded containers are to wrap up applications and services with all their dependencies and to isolate multiple software components running on the same hardware.

What is the difference between web container and EJB container?

Enterprise JavaBeans (EJB) container: Manages the execution of enterprise beans for Java EE applications. Enterprise beans and their container run on the Java EE server. Web container: Manages the execution of web pages, servlets, and some EJB components for Java EE applications.

What are containers in Java EE?

Containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before a web, enterprise bean, or application client component can be executed, it must be assembled into a Java EE module and deployed into its container.


1 Answers

The Target container varieties documentation linked by Max provide the conceptual background and terminology:

Arquillian recognizes three container interaction styles:

  1. A remote container resides in a separate JVM from the test runner; Arquillian binds to the container to deploy and undeploy the test archive and invokes tests via a remote protocol (typically HTTP)

  2. An embedded container resides in the same JVM as the test runner; lifecycle managed by Arquillian; tests are executed via a local protocol for containers without a web component (e.g., Embedded EJB) and via a remote protocol for containers that have a web component (e.g., Embedded Java EE)

  3. A managed container is the same as a remote container, but in addition, its lifecycle (startup/shutdown) is managed by Arquillian and is run as a separate process

Now I'll try to answer your questions.

I have read that embedded containers are worse than managed containers, which are in turn less reliable than remote containers.

Each type of container will have it's appropriate use case. The "worse" or "better" depends what you are trying to do.

For example, most of the time I am writing some code my container is running, so I prefer to test with a remote container, since it saves up a lot of start/stop time.

Arquillian allows you to write 'real' tests, but I do not know the difference between these container types, mainly the embedded vs managed.

The difference is explained in the documentation linked above.

If I use Jboss within Eclipse, is that an embedded or managed container?

It is remote, because Arquillian doesn't have any control over it. It is a totally separated process from the Arquillian lifecycle.

If I start Jboss from the command line, without eclipse, is that embedded or managed, or remote?

Still a remote container. Eclipse starts up JBoss pretty much in the same way you do it using command line, and Arquillian does not have any control over it.

For bonus points, how does the word 'standalone' container fit in with these terms?

Standalone means that the server is not part of centralized management control, meaning that any changes made to one node are not coordinated to other nodes.

For example, if you create a data source on a standalone node 1, it will not be replicated to node 2.

That is why a Domain configuration is much preferable since you'll managed the entire cluster in a centralized manner (Reference: Operating modes).

like image 98
Evandro Pomatti Avatar answered Oct 07 '22 01:10

Evandro Pomatti