EE 6 (GlassFish): how many containers? How many singletons?

Ok, still trying to understand the basic concepts of EE 6 here. I hope someone here can help me.

I am running Kukla GlassFish v3 server with one domain. I am deploying MyEEApp.ear that contain MyEEWebApp.war, MyEJBs.jar and MyUtilityLibrary.jar. My EJB banner contains an @Singleton bean called MySingleton.

Then I set up another server called Fran and deployed the same EAR. I am doing the same for a third server called Ollie.

Three identical EAR files deployed to three identical (except for names and IP addresses) servers.

So here are my questions:

  • On this server, say, Doll, how many “containers” do I have? Is there only one container for an EAR? Or do WAR and EJB have their own containers?
  • What are the practical implications of the first answer?
  • In this regard, what exactly is a container?
  • Can classes in my WAR use @ EJB injection to access beans in an EJB, as they are both part of the same EAR?
  • In this case, can old Java classes use @EJB injection, or does this only work for other EJBs?
  • How many instances of a singleton bean will be created? One per server? Or just one thing? If one is on the server, is there a way to guarantee a “true” singleton for the entire cluster?
  • Where and how, in GlassFish, configure JNDI to search for resources? Is it possible for me, for example, to move an EJB jar from one machine to another and find web applications automatically?
  • Can I set load balancing for EJB beans? If so, how?
  • WAR? , , , ?

, . !

!     

+5
1

, , , ""? EAR? WAR EJB ?

"" - , : Java- EE, GlassFish, -, EJB. EAR WAR (-) -, EJB EJB. ( Java EE Tutorial):

alt text

- - , - EAR () , Java EE- EAR Java EE EAR.   Java EE EJB 3 .

?

, ... :

  • (, - EJB)
  • EAR (WAR 1, 2 EJB-JAR 3, 4, 5, 6)

, ?

, - , . Tomcat (Web), OpenEJB (EJB), Spring (IoC).

"Java EE" Java EE Containers Java EE.

WAR @EJB- beans EJB, EAR?

, .

, Java @EJB EJB?

Java EE 6 , EJB, Servlets, Filters, JSF Managed beans . Java EE 6 bean CDI (Java C ontexts D ependency I njection). :

@Inject MyEJB service

POJO CDI beans.

singleton bean ? ? ? , "" ?

, , , , Sessionful Session beans ( ). .

, Java EE 6 (, GlassFish 3.1 , Milestone 1, GF 3.1 , ).

, GlassFish, JNDI ? , , , EJB - ?

InitialContext, jndi.properties. GlassFish ( jndi-properties.jar), .

EJB beans? , ?

EJB-, EJB, Round Robin. , (, , ). , GlassFish .

, GlassFish 3.1 Milestone, .

WAR? , , , ?

, ( , ). Apache mod_jk. , Apache mod_jk , :

  • B (): .
  • R (): ,
  • T (): ,

() Ressources

+17

All Articles