120 likes | 261 Vues
Session Beans. February 2010 – August 2010 Eric.gerlofsma@hu.nl www.ericgerlofsma.nl. History. EJB 1.0 released march 1998 EJB 1.1 (J2EE 1.2) 1999 Session Beans ( stateless & stateful), Entity Beans Remote Interface EJB 2.0 (J2EE 1.3) 2001 Message-Driven Beans Entity 2.x and EJB QL
E N D
Session Beans February 2010 – August 2010 Eric.gerlofsma@hu.nl www.ericgerlofsma.nl
History • EJB 1.0 released march 1998 • EJB 1.1 (J2EE 1.2) 1999 • Session Beans ( stateless & stateful), Entity Beans • Remote Interface • EJB 2.0 (J2EE 1.3) 2001 • Message-Driven Beans • Entity 2.x and EJB QL • Local and Remote interfaces • EJB 2.1 (J2EE 1.4) 2003 • EJB Timer Service • Minor EJB QL enhancements • EJB 3.0 (J2EE 1.5) 2005
Contents • Why do we need a SessionBean? • What is a Stateless SessionBean? • What is a Stateful SessionBean? • What was wrong with the 2.1 architecture?
We created JSF Web Applications. Browser JBOSS ABC-BANK Browser ABC-Library Internet Browser ABC-Pizza
JSP library Deployment files JSP JSP JSP JSP JSP JSP web.xml faces-config.xml jboss-web.xml Security module JAAS Backing Bean library Domain module JSP JSP JSP JSP JSP Bean ABC-BANK.jar A Web Applications looks like this.
Are we completely satisfied? • The domain module is integrated by JBoss in the JSF Web Application. • The domain module is self supporting for: • Security, • Queueing Banking Transactions, • Maintaining Database Transactions
Or do you prefer a container that: • Separates the domain module from the JSF Web Application. • And supports service for: • Security, • Queuing Banking Transactions, • Maintaining Database Transactions
How do you separate front-end from back end? MySQL JBoss HTTP: 8080 JNDI : 1099 JMS : JBoss HTTP: 8080 Browser Internet Internet ABC-BANK JSF ABC-BANK DOMAIN Session Beans Entity Beans In JBoss the EJB Container JSP’s Backing Beans In Tomcat the Servlet Container RMI
Why a physical separation of front-end and back end? MySQL JBoss HTTP: 8080 JNDI : 1099 JMS : Browser Internet ABC-BANK JSF ABC-BANK DOMAIN Session Beans Entity Beans JSP’s Backing Beans RMI
What is a SessionBean? • SessionBeans are general remote RMI Servers implementing the business logic and providing an interface to the business tier. • SessionBeans are transaction managers for accessing Entity Beans. • SessionBeans are called by the EJB-Container if it is allowed by the Security Manager. • Session Beans are automatically registered in a JNDI (Java Naming and Directory Interface); this is some kind of rmiregistry. • There are 2 kinds of SessionBeans, Stateless and Stateful. • SessionBeans have nothing to do with HTTP-Sessions.