June 1999 EJB1 EJB and CHAIMS Dorothea Beringer Enterprise Java Beans and how to build a CHAIMS infrastructure using the EJB paradigm.

Slides:



Advertisements
Similar presentations
21 Copyright © 2005, Oracle. All rights reserved. Oracle Application Server 10g Transaction Support.
Advertisements

12 Copyright © 2005, Oracle. All rights reserved. Implementing Business Tasks with Session EJBs.
11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
EJB Entity Beans. Entity Beans Data versus logic Used to represent an instance rather than a collection of data (depending on underlying storage) Represents.
Enterprise JavaBeans Ruslana Svidzinska CSE690. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
1 Softsmith Open Learning - EJB 21-Nov Enterprise Java Beans Introduction –Application ServerApplication Server –Java 2 Enterprise EditionJava.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Enterprise Java Beans Welcome to the world of “Distributed System” Presented By: Sameer Nanda Date: 12/17/03.
Application Server Lecture Paulo Barroso Kris Carver Todd Kitterman Eric Silva.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
July 23 th, 2005 Software Architecture in Practice RiSE’s Seminars Bass’s et al. Book :: Chapter 16 Fred Durão.
SEI/CBS Initiative Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Sponsored by the U.S. Department of Defense © 1999.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
EJB Fundamentals Celsina Bignoli
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
1 Session Bean Chuyên đề Lập trình Java & J2EE Chương 14 Biên soạn: Th.S Nguyễn văn Lành.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
Enterprise Java Beans - (EJB)
Seminar: Enterprise JavaBeans. Agenda Agenda Java™ 2 Platform Java™ 2 Platform Java™ 2 Platform,Enterprise Edition(J2EE) Java™ 2 Platform,Enterprise Edition(J2EE)
© jGuru.com EJB Transactions. Transactions Simple Transaction –Transaction = more than one statement which must all succeed (or all fail) together.
Entity Beans BMP Celsina Bignoli
Middleware Technology (J2EE/EJB) Entity Bean. 2 Introduction to Entity Beans Persistence Concepts Entity beans are persistent objects that can be stored.
Lecture 8 Advanced Topics in Enterprise JavaBeans.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Replication & EJB Graham Morgan. EJB goals Ease development of applications –Hide low-level details such as transactions. Provide framework defining the.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
The Triad of Beans I Oleh: Dini Addiati ( ) Fahrurrozi Rahman ( Y) Irfan Hilmy ( ) Salman Azis A ( ) Aziiz Surahman.
Presented By Pradeep K Sahu. What will be the Contents of the Seminar ? What is EJB ? EJB Architecture Types of EJB Session Entity Why EJB ? Writing a.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Session Beans -) stateless -) stateful. Session Beans A session bean represents a single client inside the J2EE server. To access an application that.
J2EE Overview ver 1.0Page 1 © Wipro Technologies Talent Transformation J2EE Overview.
Enterprise JavaBeans Understanding EJB Components Version 0.1 Kamal Wickramanayake
© jGuru.com Enterprise JavaBeans Fundamentals.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
EJB Overview: Constraint Types and Enforcement in JBoss Elissa Newman Fluid Meeting 6/3/04.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Enterprise Java Bean Technology Briefing Markus Hebach.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
Copyright © 2002 ProsoftTraining. All rights reserved. Enterprise JavaBeans.
13 Copyright © 2004, Oracle. All rights reserved. Managing Persistent Data in the Business Tier Entity EJBs.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Middleware Technology (J2EE/EJB) EJB Fundamentals.
Advanced Java Session 7 New York University School of Continuing and Professional Studies.
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Introduction to J2EE Architecture
Ruslana Svidzinska CSE690
Luca Simone Software Engineering 2 a.a. 2001/2002
Objectives In this lesson, you will learn to:
EJB Types Alessio Bechini June 2002.
Component-based Applications
Understanding and Designing with EJB
Enterprise Java Beans.
Knowledge Byte In this section, you will learn about:
Objectives In this lesson, you will learn about:
Presentation transcript:

June 1999 EJB1 EJB and CHAIMS Dorothea Beringer Enterprise Java Beans and how to build a CHAIMS infrastructure using the EJB paradigm

June 1999 EJB2 EJBs versus Java Beans

June 1999 EJB3 EJB framework EJB server and container Bean B (EJB Instance) A: home interface A: remote interface B: home interface B: remote interface A:Home Object A: EJB Object B: Home Object B: EJB Object Bean A (EJB Instance) creates calls creates Transaction Naming Persistence Deployment Descriptor ClientProgramClientProgram RMI or CORBA or IIOP or HTTP or … other beans or (other) databases or remote services or … coded (extending EJB interfaces and classes) generated at deployment time

June 1999 EJB4 Session Beans: Interfaces and Instance ChaimsMegamodule extends EJBHome {interface} EJBMetaData getEJBMetaData() void remove (Handle h) void remove (Object key) ChaimsConnection create (String megamodulename) is home interface, is home to all connections to all megamodules residing in this EJB server, better name is ChaimsConnectionHome Wrapper implements SessionBean {class} void ejbcreate (String mmname) void ejbActivate() void ejbPassivate() void ejbRemove() void setSessionContext (…) … GETPARAM (…) … SETPARAM (…) … ESTIMATE (…) … INVOKE (…) … EXAMINE(…) … EXTRACT (…) … TERMINATE (…) … TERMINATEALL () is bean instance, one instance per connection, implement all important methods SETUP is replaced by create()

June 1999 EJB5 Session Beans: Interfaces and Instance Wrapper implements SessionBean {class} void ejbcreate (String mmname) void ejbActivate() void ejbPassivate() void ejbRemove() void setSessionContext (…) … GETPARAM (…) … SETPARAM (…) … ESTIMATE (…) … INVOKE (…) … EXAMINE(…) … EXTRACT (…) … TERMINATE (…) … TERMINATEALL () is bean instance, one instance per connection, implement all important methods ChaimsConnection extends EJBObject {interface} EJBHome getEJBHome() Object getPrimaryKey() Handle getHandle() void remove() boolean isIdentical(EJBObject o) … GETPARAM (…) … SETPARAM (…) … ESTIMATE (…) … INVOKE (…) … EXAMINE(…) … EXTRACT (…) … TERMINATE (…) … TERMINATEALL () is remote interface, handles all connections to all megamodules

June 1999 EJB6 Deployment Descriptor (1) Describes for each bean: »names of all classes and interfaces involved, name for JNDI »ACL »environment properties »stateless / stateful (only session beans) »session timeout (only session beans) »list of container managed fields (only entity beans) »primary key class names for finder methods (only entity beans) Describes for each method: »transaction attributes: - TX_NOT_SUPPORTED (existing transactions are suspended) - TX_SUPPORTS, TX_REQUIRES_NEW, TX_MANDATORY - TX_REQUIRED (transaction context needed, either new or existing one) - TX_BEAN_MANAGED (bean demarks its own transaction boundaries) »transaction isolation level

June 1999 EJB7 Deployment Descriptor (2) ==> describing instead of programming (similarities to aspect-oriented programming?) ==> framework has control, bean provider and deployer just provide plug-ins Packaging of beans: All files inclusive deployment descriptor are put in a jar file by bean provider with a manifest just containing the name of the deployment descriptor. Deployment descriptor provides the full description of all the files in the jar that together define the enterprise bean. This jar file is acquired by deployer and read by server.

June 1999 EJB8 Session Beans Entity Beans

June 1999 EJB9 Entity Bean Order order 4 Entity Bean Order order 5 Entity Bean Order order 6 Session Beans Entity Beans Session Bean A instance 1 client 1 Session Bean A instance 2 client 2 Entity Bean Order order 1 Entity Bean Order order 2 Entity Bean Order order 3 Database

June 1999 EJB10 Tasks of the EJB Framework (1) The server/container are responsible for: Managing beans »creation, initialization, removal of beans »offering JNDI naming service Resource management: »e.g. swapping stateful session beans and entity beans: uses ejbPassivate() and ejbActivate() to inform bean before and after it is swapped out of memory and written to disk Persistence management: »defined in deployment descriptor »using ejbLoad() and ejbStroe() to inform entity bean about start of transaction or commit »1) server loads and stores (container managed persistence), entity beans created by mapping defined in deployment descriptor (fields to columns) or automatically generated by special tool for object-relational mapping ==> no programming of load and store »2) bean loads and stores data itself (bean managed persistence) and server only handles locks on underlying database

June 1999 EJB11 Tasks of the EJB Framework (2) Transaction Management »1) automatic transaction management: the EJB server/container maintains the transactions on behalf of the beans, beans just describe how they participate in transactions in deployment descriptor ==> no programming of transactions »for entity beans and stateless session beans: participation in transaction is all implicit »for stateful session beans: can implement SessionSynchronization interface in order to be informed about transaction begin and commit (methods afterBegin(), beforeCompletion(), afterCompletion(boolean rollback_or_commit) »all beans get setRollBackOnly() method through their EJBcontext for requesting rollback of the transaction they participate in »2) bean and client managed transactions: the bean or the client calls methods of JTS (interface UserTransaction contains methods for begin(), rollback(), commit(); transaction attribute set to TX_BEAN_MANAGED for all methods, this makes sure bean gets reference of JTS in its EJBContext) Distributed Transaction Support

June 1999 EJB12 Tasks of the EJB Framework (3) Integration with databases »beans not allowed to communicate directly with database concerning transactions, this has to be done by server Interfaces to CORBA, http, and other access protocols »generation of all necessary stubs and skeletons Security services Scalability ==> services are transparent to beans provider as well as client program writers (higher level as in CORBA yet OTS compliant)

June 1999 EJB13 Portability A note about portability: »enterprise beans are portable across servers from different vendors »legacy code has to be changed in order to be used in beans (e.g. changing all transaction related things, no autocommit, no commit or rollback by the bean on the connection to the database) »EJB-server requires special JDBC drivers for databases (for transaction management) »how portable is client code? slight differences in how to get home object over JNDI? differences in access over http or CORBA?

June 1999 EJB14 Roles in EJB Development EJB Developer »writes business objects as enterprise beans for specific problem domain, sells these business objects »defines certain deployment requirements (e.g. concerning transaction control, security, environment properties) and makes first version of deployment descriptor EJB Server vendor »develops and sells an EJB server (e.g. WebLogic, Oracle) EJB Deployer »enhances and fills out deployment descriptor (e.g. ACLs, databases used, access protocols, external names of bean) »takes enterprise beans and installs them into a specific EJB server installation which reads deployment descriptor and installs bean in name space Application developer »writes business application using services of business objects

June 1999 EJB15 EJB’s and CHAIMS (1) Difference in access: »client has remote reference of both, home-object and bean, SETUP replaced by create(mmname) »client sends messages directly to an object that represents one connection, instead of to a megamodule object that dispatches it to a connection object Advantages of EJB’s: »automatic transaction control within one connection, simpler / alternative implementation for megamodules, connection level based transaction control has not to be coded by megamodule provider Session Bean Connection for Megamodule BookHotel client 1 INVOKE(findHotel) INVOKE(getPrices) INVOKE(book) database access for findHotel database access for getPrices database access for book Entity Beans create(megamdodulenam)

June 1999 EJB16 EJB’s and CHAIMS (2) Automatic transaction control across several connections?: »split up setup into contacting EJB server (create on a session bean that encompasses all connections from same client to all megamodules of that server, only once per megaprogram) and setting up connection to megamodule (create on a connection session bean) »allows having different parameter sets for different megamodules (instead of merging all megamodules of same server in one) while still having transaction control across these megamodules client 1 findHotel getPrices book Entity Beans INVOKE(findFlight, …) getPrices book Session Bean Connection for Megamodule BookHotel Session Bean Megaprogram- session create() Session Bean Connection for Megamodule BookFlight create() SETUP(BookFlight) SETUP(BookHotel)

June 1999 EJB17 EJB’s and CHAIMS (3) Transaction control across whole megaprogram?: »use JTS in client program (client demarcated transactions), let the rest of the transaction management be done by the EJB servers »requires that EJB server supports client demarcated transactions all megamodules are implemented in such EJB servers

June 1999 EJB18 Components versus Frameworks If applications are hard to design, and toolkits are harder, then frameworks are hardest of all!

June 1999 EJB19 Customization of Frameworks Special methods (presetting of properties) additional parameters in methods external description in text files as in deployment descriptor setting of properties in other kind of tools at development/composition time at using/execution time

June 1999 EJB20 Challenges in Developing Frameworks (and Components) Architecture / design of framework »three application rule »second design rule »consistency in environment and basic requirements »ROI Complexity ease of use and maintenance »framework designer: cover all cases »application developer: ease of use »how much customizability? »guessing future requirements and isolating necessary changes