Enterprise Java Beans (EJBs) TAKE IT TO THE NTH

Similar documents
Component Middleware. Sophie Chabridon. INT - INF Department - Distributed Systems team 2006

Client-Server Architecture & J2EE Platform Technologies Overview Ahmed K. Ezzat

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

What Is the Java TM 2 Platform, Enterprise Edition?

How To Protect Your Computer From Being Hacked On A J2Ee Application (J2Ee) On A Pc Or Macbook Or Macintosh (Jvee) On An Ipo (J 2Ee) (Jpe) On Pc Or

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

Chapter 4. Architecture. Table of Contents. J2EE Technology Application Servers. Application Models

White paper. IBM WebSphere Application Server architecture

EJB & J2EE. Component Technology with thanks to Jim Dowling. Components. Problems with Previous Paradigms. What EJB Accomplishes

Java EE 7: Back-End Server Application Development

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

Java 2 Platform, Enterprise Edition (J2EE): Enabling Technologies for EAI

OptimalJ Foundation. PSM EJB Model. Roadmap. What is the EJB model? EJB model as a PSM model Mapping the EJB model Model elements and code generation

Sun Microsystems Inc. Java Transaction Service (JTS)

A Flexible Security Architecture for the EJB Framework

WebSphere Training Outline

New Methods for Performance Monitoring of J2EE Application Servers

Java E-Commerce Martin Cooke,

JAVA ENTERPRISE IN A NUTSHELL. Jim Farley and William Crawford. O'REILLY 4 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo.

Distributed Objects and Components

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Glassfish, JAVA EE, Servlets, JSP, EJB

era J2EE Platform and Tool Recommendations

Enterprise Applications

ActiveVOS Server Architecture. March 2009

25 May Code 3C3 Peeling the Layers of the 'Performance Onion John Murphy, Andrew Lee and Liam Murphy

Software Development using MacroMedia s JRun

Java-technology based projects

As you learned about in Chapter 1, WebSphere Application Server V6 supports the

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

CACHÉ: FLEXIBLE, HIGH-PERFORMANCE PERSISTENCE FOR JAVA APPLICATIONS

<Insert Picture Here> Java EE 7. Linda DeMichiel Java EE Platform Lead

Developing Java Web Services

Java OGSI Hosting Environment Design A Portable Grid Service Container Framework

Architectural Overview

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Converting Java EE Applications into OSGi Applications

Chapter 5 Application Server Middleware

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

What is Middleware? Software that functions as a conversion or translation layer. It is also a consolidator and integrator.

<Insert Picture Here> Java EE 7: the New Cloud Platform

How To Develop A Web Service In A Microsoft J2Ee (Java) 2.5 (Oracle) 2-Year Old (Orcient) 2Dj (Oracles) 2E (Orca) 2Gj (J

DEPLOYMENT ARCHITECTURE FOR JAVA ENVIRONMENTS

Introduction to Sun ONE Application Server 7

WEB SERVICES. Revised 9/29/2015

Performance Comparison of Java Application Servers

Open Source SOA with Service Component Architecture and Apache Tuscany. Jean-Sebastien Delfino Mario Antollini Raymond Feng

Reusing Existing * Java EE Applications from Oracle SOA Suite

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

Introduction to CORBA. 1. Introduction 2. Distributed Systems: Notions 3. Middleware 4. CORBA Architecture

Core J2EE Patterns, Frameworks and Micro Architectures

SAP Web Application Server 6.30: Learning Map for Development Consultants

Enterprise Application Integration

How To Create A C++ Web Service

PERFORMANCE MONITORING OF JAVA COMPONENT-ORIENTED DISTRIBUTED APPLICATIONS

3-Tier Architecture. 3-Tier Architecture. Prepared By. Channu Kambalyal. Page 1 of 19

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

JBI and OpenESB. Introduction to Technology. Michael Czapski Advanced Solutions Architect, SOA/BI/Java CAPS Sun Microsystems, ANZ

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology Fall 2007

Enterprise JavaBeans Fundamentals

Transactionality and Fault Handling in WebSphere Process Server Web Service Invocations. version Feb 2011

The Enterprise Java Internet Provider

WebSphere Application Server - Introduction, Monitoring Tools, & Administration

The webmethods ESB. The Foundation of your SOA. Jean-Michel Ghyoot, Principal Solution Architect, March 28, 2013

Solutions for detect, diagnose and resolve performance problems in J2EE applications

rpaf KTl enterprise EJB 3.1 Cookbook I I flv* IV I I professional expertise distilled

Oracle Application Server 10g Web Services Frequently Asked Questions Oct, 2006

WebSphere Server Administration Course

Das Spring Framework - Einführung in leichtgewichtige J2EE Architektur. Jürgen Höller. Organized by:

Distributed Database Design

<Insert Picture Here> Java EE 7: the New Cloud Platform

Rice University 6100 Main Street, MS-132 Houston, TX, 77005, USA

Service Oriented Architectures

IBM InfoSphere MDM Server v9.0. Version: Demo. Page <<1/11>>

UDDI v3: The Registry Standard for SOA

WebSphere Portal, Portlets and Web Services

SCA-based Enterprise Service Bus WebSphere ESB

Enterprise Integration Architectures for the Financial Services and Insurance Industries

IBM Rational Rapid Developer Components & Web Services

Exam Name: IBM InfoSphere MDM Server v9.0

Oracle Identity Analytics Architecture. An Oracle White Paper July 2010

enterprise^ IBM WebSphere Application Server v7.0 Security "publishing Secure your WebSphere applications with Java EE and JAAS security standards

An Oracle White Paper October Maximize the Benefits of Oracle SOA Suite 11g with Oracle Service Bus

Chapter 6. CORBA-based Architecture. 6.1 Introduction to CORBA 6.2 CORBA-IDL 6.3 Designing CORBA Systems 6.4 Implementing CORBA Applications

JavaPolis 2004 Middleware and Web Services Security

Flux Software Component

Client/server is a network architecture that divides functions into client and server

Designing an Enterprise Application Framework for Service-Oriented Architecture 1

JSLEE and SIP-Servlets Interoperability with Mobicents Communication Platform

Enterprise JavaBeans 3.1

Oracle Application Server 10g

PROGRESS Portal Access Whitepaper

Managing Complexity in Mobile Application Deployment Using the OSGi Service Platform

ON-LINE BOOKING APPLICATION NEIL TAIT

Infrastructure that supports (distributed) componentbased application development

IBM WebSphere Server Administration

Web Services. Mark Volkmann Partner Object Computing, Inc. What Are Web Services?

Service Oriented Architecture 1 COMPILED BY BJ

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

Transcription:

Enterprise Java Beans (EJBs) TAKE IT TO THE NTH

TAKE IT TO THE NTH Andrew Gilbert andrew.gilbert@sun.com www.sun.com/developers/evangcentral Senior Software Engineer Sun Microsystems

Agenda EJB Architecture EJB 2.0 EJB 2.1 Roadmap

EJB Architecture TAKE IT TO THE NTH

Resources and Summary TAKE IT TO THE NTH

EJB Goals Provide standard component architecture for building distributed applications in Java Easy to write applications by eliminating need to write services code Applications follow "Write Once, Run Anywhere" philosophy Address development, deployment and runtime aspects of distributed application's lifecycle

EJB Architecture

EJB Architectural Roles Defines six distinct roles in the application development and deployment life cycle EJB Bean Provider Application Assembler Deployer EJB Server Provider Container Provider System Administrator to add an outline

Types of Beans EJB 2.0 defines Session Beans Entity Beans Message Driven Beans

Session Beans Exhibits following characteristics Does work on behalf of client Can be transactional Is not persistent and hence relatively short lived Does not represent data in data store, although can access/update such data Bean class implements javax.ejb.sessionbean interface Two subtypes viz. Stateful and stateless

Entity Beans Exhibits following characteristics Provides object view of data in data store Allows shared access for multiple, concurrent users Lives as long as data exists in database i.e. Long lived Bean class implements javax.ejb.entitybean interface Persistent state can be either managed by container i.e. CMP or can be managed by bean provider him/herself i.e. BMP

EJB Architecture Contracts Client view contract Contract between client and container Component contract Contract between an Enterprise Bean and its Container

Client View Contract Client of an EJB can be Another EJB in same or different container A Java application / applet / servlet / JSP A non-java client such as CORBA client Provides development model for clients using EJB services

Client View Contract (Contd.) Client view contract comprises of Home interface For local or remote clients Remote interface For local or remote clients Object identity Metadata interface Handle

Component Contract Enabling EJB method invocations from clients Managing life cycle and related notifications Defining and implementing home and remote interfaces Provide persistence for CMP entity beans Making bean class instances context aware Managing transactions, security, exceptions, etc... Implementing callbacks and receiving notifications

EJB Contracts Client view contract Client Enterprise bean instances Container Component contract EJB server

EJB Transactions Support Supports distributed transactions Containers implement low level Transaction Protocols such as two phase commit, distributed two phase commit, transaction context propagation Specifies two types of transaction demarcation Bean managed using javax.transaction.usertransaction Container managed by declaring transaction attributes Supports Flat transaction model Supports resource adapter specific isolation levels

EJB Transactions: JTA and JTS Java Transaction API (JTA) Specification of interfaces between transaction manager and other parties involved in a distributed transaction such as client, container, RM, etc. Java Transaction Service (JTS) Java binding of CORBA's OTS 1.1 specification Provides transaction interoperability across servers if IIOP is supported by both of them

EJB Transactions A sample scenario of updating multiple databases Client X Y Database A Database B Database C

EJB Transactions A sample scenario of updating through multiple EJB servers EJB Server EJB Server Client X Y Database A Database B

EJB Transactions A sample scenario of updates in client demarcated transactions Client Begin X Commit Database A Y Database B

EJB Transactions A sample scenario of updates from a non-transactional client EJB Server Client Begin Commit X Y Database A Database B

EJB Exception Handling Types Two types of exceptions, as defined by EJB specification Application Exceptions Exceptions defined in throws clause of methods defined on Home and Remote interfaces, other than RemoteException For example, javax.ejb.createexception, javax.ejb.finderexception, javax.ejb.removeexception System Exceptions Unexpected exceptions that prevent business methods or container callbacks from executing successfully either due to JVM errors or RemoteException resulting from invocation of other enterprise beans or unexpected RuntimeException and so on

EJB Exception Handling Goals The EJB specification for Exception Handling is designed to meet following goals Application Exception thrown by enterprise bean instance should be reported to client as is Application Exception thrown by enterprise bean instance should not automatically rollback a client's transaction System exceptions that may have left instance's state variables and/or underlying persistent data in an inconsistent state can be handled safely

Support for Distribution EJB specification makes it possible for containers to use RMI-IIOP as object distribution protocol No mandate on containers to use RMI-IIOP though The communication stubs used at the client-side to communicate with server-side objects are considered standard if container uses RMI-IIOP as object distribution protocol, otherwise they are considered to be container-proprietary

EJB Security Model Client1 Principal used: User1 Manager EJB Server Invokes TAHome.create() Client2 Principal used: User 2 Caller Principal mapping to J2EE security roles All X Invokes TAHome.find() Mapping typically done by Deployer Mapping typically done by Application Assembler either Bean Provider

EJB Security Styles Declarative Bean Provider, Assembler and Deployer handles security completely by declaring various settings Programmatic Code against security API exposed via javax.ejb.ejbcontext getcallerprincipal() iscallerinrole(string rolename) getcalleridentity () - deprecated iscallerinrole(java.security.identity identity) - deprecated

EJB Security Concepts Security Domain Principal Mapping Principal Delegation System Principal Runtime Security Enforcement Audit Trail

Ejb-jar file Standard format for packaging enterprise beans Used to package un-assembled and assembled enterprise beans Must contain deployment descriptor For each enterprise bean ejb-jar file must contain following class files Enterprise bean class Enterprise bean home and remote interface Primary key class if the bean is entity bean

Ejb-client JAR file Ejb-jar file producer can create ejb-client JAR file for ejb-jar file Consists of all classes that client program needs to use client view of enterprise beans contained in ejbjar file Can be specified in deployment descriptor of ejbjar file Deployer should ensure that specified ejb-client JAR file is accessible to client program's class loader

Deployment Descriptor Defines contract between producer and consumer of ejb-jar file It is an XML document that must be well formed in XML sense and must be valid with respect to the DTD given in specification Must be stored with the name META-INF/ejbjar.xml in the ejb-jar file Captures two basic kinds of information viz. Structural and Application assembly information

Deployment Descriptor Structural Information Describes structural and external dependencies of enterprise bean Mandate on ejb-jar producer to provide structural information Should not be changed since it may break the enterprise bean's function Example Fully qualified class name of Enterprise bean class, home interface and remote interface State management type of session bean, etc.

Deployment Descriptor Application Assembly Information Describes how enterprise bean(s) in ejb-jar file can be composed into a larger application deployment unit Can be optionally provided by ejb-jar producer Changes may not break functionality of enterprise bean, however doing so may change its behavior Examples Transaction attributes Re-entrancy indication, etc.

EJB 2.0 New Features Integrated support for JMS Support for local interfaces Improved architecture for Container Managed Persistence Support for container managed relationships among entity beans Enterprise JavaBeans TM Query Language (EJB QL) Home methods for entity beans Network interoperability

EJB 2.0 EG Community Allaire Art Technology Group BEA Bluestone Forte Fujitsu Gemstone IBM Inline Software Inprise Iona iplanet Luna Information Systems Oracle Persistence Progress Software Secant Siemens Silverstream Software AG Sun Microsystems Sybase The Object People Tibco Vitria

JMS Support By adding new enterprise bean type called "MessageDrivenBean" Stateless bean without home and remote interface Activated upon message arrival Bean implements javax.jms.messagelistener interface onmessage() method implementation should contain business logic Configured as listener for queue or topic

JMS and EJB JMS APIs for sending messages available to all enterprise beans Use in point-to-point configurations a.k.a Reliable Queuing Use within pub/sub configurations

Local Interfaces For both Entity beans Session beans Enables local call semantics for inprocess calls to EJBs

Container Managed Persistence Goals Allow for scalable, high-performance implementations Allow wide range of modeling options Allow leverage of object-relational mapping technology Completely re-architected in EJB TM 2.0 Feedback from our experts/partners on limitations of EJB 1.1 container managed persistence Support for EJB 1.1 container managed persistence is required

Building blocks of CMP Remote entities Relatively coarse-grained business objects Local entities Finer-grained business objects Value classes Provide a client view of persistent state

Container Managed Relationshps 1-1, 1-N, M-N associations Among local entities Allow transparent navigation Unidirectional or bidirectional navigability Foundation for path expressions in queries

Global View of CMP/CMR Bean operates in a managed environment Persistence Manager provides services to the bean Management of persistent state Relationship management, including Referential integrity Collection management Query service (for finder methods) Deployment descriptor embodies semantic contract between Bean and Persistence Manager Abstract Persistence Schema

Managed entity state access protocol Bean Provider defines abstract entity bean class with abstract get and set methods Persistence manager provides implementation Getters and setters return persistent state (cmpfields) and related objects (cmr-fields). Restrictions on what the Bean Provider can expose through the remote interface No local entity

Persistence Manager Implementation View Persistence manager handles persistent state management of fields and relationships getters/setters and lifecycle methods (e.g., ejbcreate, ejbload, ejbstore,...) provide hooks Referential integrity management of relationships is persistence manager responsibility

Abstract Persistence Schema Defined in Deployment Descriptor Defines Managed State: cmp-fields Managed Relationships: cmr-fields

EJB Query Language Queries defined at logical, abstract schema level in deployment descriptor SQL-like typed language with SELECT, FROM, and WHERE clauses Query domain consists of all entity beans (local and remote) in a logical ejb-jar file Queries based on navigability over abstract schema types Supports parameterized queries

Query Types Two kinds of query methods ejbfind ejbselect Persistence Manager provides implementation based on Bean Provider's declarative query specification in deployment descriptor

Home Methods Additional methods on Home interface for entity beans with both bean and container managed persistence Business methods that are not specific to an entity bean instance Implementation provided by Bean Provider Useful for bulk updates or other aggregate operations

Network Interoperability Three scenarios for invocations across J2EE servers: Server to server over EJB components Application clients to EJB components Web clients (JSP/Servlet) to EJB components RMI/IIOP Transaction context propagation based on OTS 1.2 Interoperable naming based on CORBA CosNaming Security context propagation based on CSIv2

Resources http://java.sun.com/products/ejb http://java.sun.com/j2ee/blueprints http://www.theserverside.com Send your feedback about specification at ejb-spec-comments@eng.sun.com

Call for Action! Download J2EE 1.3 Reference Implementation Start developing EJBs today!

www.sun.com/developers/evangcentral In pursuit of the best software in the universe All presentations Audiocasts Codecamp materials Technology briefings code/articles/links/chats/resources

TAKE IT TO THE NTH Andrew Gilbert andrew.gilbert@sun.com