Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.

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.
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
6/1/20151 Luca Simone Software Engineering 2 a.a. 2001/2002.
JBoss Seam: Contextual Components Jason Bechtel
1 James Lynn Hewlett-Packard Middleware Division EJB Architecture Design Strategies and Performance Optimizations.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
EJB Development and Support Services. EJB Development and Support Services Topics to be Covered: EJB Design Bean/Container Interaction Java Naming and.
Enterprise Java Beans Adam, Engels, Josh, Marc, Tim.
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.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
1 CS 483 Enterprise and Web Application Programming Week 6 Session Beans JSP Tutorial.
J2EE Security and Enterprise Java Beans Mrunal G. Dhond Department of Computing and Information Sciences Master of Science, Final Defense February 26,
Enterprise Programming By J Pearce. Enterprise Software Sales HR Inventory Customer Support Shipping.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
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)
1 Security Most Java EE applications need to provide identity to users who access them and security for that access. Applications may want to prevent hostile.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Session Beans Overview EJB container Remote Invocation Represent client's access to app Local / Remote speed / flexibility trade-off when to choose local.
Middleware Technology (J2EE/EJB) Entity Bean. 2 Introduction to Entity Beans Persistence Concepts Entity beans are persistent objects that can be stored.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Enterprise JavaBeans Umer Farooq CS6704: Design Patterns & Component FrameworksFebruary 25, 2002.
1 Stateful Session Beans Stateless Session Beans Michael Brockway Sajjad Shami Northumbria University School of Computing, Engineering & Information Sciences.
Overview Of Enterprise Java Bean (EJB) COSC 513 Presentation Mei Li March 17, 2001.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
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.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
TDDD05 EJB Lab (Part of slides reused from Mikhail’s) Lu Li
Java Transaction API Sean C. Sullivan
Topic : JNDI Kaster Nurmukan. JNDI2(c)CDAC(Formerly NCST) What is JNDI? Naming and Directory Services Naming Concepts Issues JNDI Architecture Programming.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
1 Transactions Michael Brockway Sajjad Shami CG0165: Advanced Applications Development in Java Northumbria University School of Computing, Engineering.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Enterprise JavaBeans Session Beans. Session beans are a type of Enterprise JavaBean component designed to implement business logic responsible for managing.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Enterprise JavaBeans 3.0. What is EJB 3.0 -Reusable server-side component framework-technology -Designed to support building demanding enterprise – level.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
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.
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.
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
2 목차 n WebLogic Architecture n J2EE Spec PreView n WebLogic Basic n Weblogic JDBC n Weblogic JNDI n Weblogic EJB Architecture n Weblogic EJB Deployment.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
J2EE Lecture 10: EJB 3.0 Overview
EJB (Enterprise Java Beans)
Enterprise Java Bean. Overview of EJB View of EJB Conversation Roles in EJB, Types of Enterprise Beans Lifecycle of Beans Developing Applications using.
Objectives In this lesson, you will learn to:
Understanding and Designing with EJB
Enterprise Java Beans.
Knowledge Byte In this section, you will learn about:
Presentation transcript:

Enterprise JavaBeans EJB Container Services

EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container manages the execution of enterprise beans for Java EE applications EJB benefit - container is charged with the task of making system services available to EJB components

J2EE Components and Container

EJB container services Container-provided services: Persistence Transactions Security JNDI Distribution Concurrency Multi-threading Component pooling Component life cycle Timer service Interceptors

Persistence Java Persistence public class Account private int id;... public class Customer private int id; private String private List accounts;... }

Transactions A transaction is a group of activities performed as a single unit Transaction demarcation types: Container-managed Declarative, default Bean-managed User transaction API Is applied to bean class Values: CONTAINER or BEAN

public class ShopBean implements Shop { public void setPrice(int prodId, int price){... public int getPrice(int prodId){... }

Transaction Attribute Definitions

public class ShopBean implements Shop UserTransaction EntityManager productMgr; public void setPrice(int prodId, int price){ tx.begin(); productMgr.find(Product.class, prodId).setPrice(price); tx.commit(); }

Security Security is very important in the enterprise environment Authentication Authorization @RunAs

public class HelloEJB implements Hello public String hello1(String msg) { return "1: Hello, " + msg; public String hello2(String msg) { return "2: Hello, " + msg; public String hello3(String msg) { return "3: Hello, " + msg; }

"B"}) public class HelloEJB implements Hello private SessionContext sc; public String hello(String msg) { if (sc.isCallerInRole("A") && !sc.isCallerInRole("B")){... } else {... }

JNDI JNDI = Java Naming and Directory Interface API that provides naming and directory functionality to applications store and retrieve named Java objects of any type associate attributes with objects and search for objects using their attributes A naming service helps organize an enterprise application by acting as a central registry for components

Naming and Directory services JNDI is independent of any specific directory service implementation LDAP, DNS, NIS, RMI, CORBA /jw /jw-02-howto.html /jw /jw-01-howto.html

JNDI functions void bind(String stringName, Object object) Binds a name to an object Object lookup(String stringName) Returns the specified object import javax.naming.Context; import javax.naming.InitialContext; Context ctx = new InitialContext(); Calculator calculatorRemote = (Calculator).lookup("CalculatorBean/remote");

JNDI architecture

Bean pooling To reduce memory consumption and processing, containers pool resources and manage the lifecycles of all the beans very carefully When a bean is not being used, a container will place it in a pool to be reused by another client The container copies data into or out of these pooled instances as necessary The best thing - client application is completely unaware of the resource management activities

Bean pooling benefits Reduces the resource requirements for a single server pooled beans are context switched as required Dynamic growth pool can be expanded/contracted as demand requires Pooled objects are instantiated on startup instead of every time may be expensive to instantiate Fine-grained control of resources able to set max/min beans

Bean lifecycle management Two strategies to perform lifecycle management: instance pooling passivation/activation Passivation is a technique to temporarily serialize a bean and store it to some persistent store Containers free up resources by passivating a bean and then re-activating it when resources are available

Stateless Session bean lifecycle Source: Sun J2EE tutorial

Stateful Session bean lifecycle Source: Sun J2EE tutorial

References Transactions Security J2EE/security_annotation/ JNDI