enterprise javabeans
Download
Skip this Video
Download Presentation
Enterprise JavaBeans

Loading in 2 Seconds...

play fullscreen
1 / 87

Enterprise JavaBeans - PowerPoint PPT Presentation


  • 136 Views
  • Uploaded on

Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software. Objectives. Define client-server and multi-tier architecture Discuss the benefits and issues of distributed architectures Define software components

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Enterprise JavaBeans' - adsila


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
objectives
Objectives
  • Define client-server and multi-tier architecture
  • Discuss the benefits and issues of distributed architectures
  • Define software components
  • Discuss server-side component architecture and architecture solutions
  • Define J2EE technologies
  • Define EJB technology
client server and multi tiered architectures
Client-Server andMulti-Tiered Architectures
  • Scalability
  • Extensibility
  • Security
  • Issues concerning distributed architectures
    • Complexity
    • Communication/bandwidth
    • Maintenance costs
software components
SoftwareComponents
  • Component architectures
    • Component development tools
    • Container
    • Maintenance deployment tools
component architecture solutions
ComponentArchitecture Solutions
  • .NET Enterprise Architecture
  • CORBA
  • J2EE
j2ee technologies
EJB

RMI/RMI-IIOP

JNDI

JDBC

JTA/JTS

JMS

JSP

IDL

JavaMail

Connectors

XML

J2EETechnologies
enterprise javabeans1
EnterpriseJavaBeans
  • Differences between JavaBeans and Enterprise JavaBeans
  • EJB development tasks
    • J2EE product provider
    • Bean developer
    • Application assembler
    • Deployer
    • System administrator
    • Tool provider
summary
Summary
  • Define client-server and multi-tier architecture
  • Discuss the benefits and issues of distributed architectures
  • Define software components
  • Discuss server-side component architecture and architecture solutions
  • Define J2EE technologies
  • Define EJB technology
objectives1
Objectives
  • Define an EJB server’s main components
  • Discuss EJB and client interaction
  • Identify EJB container services
  • Describe home objects and EJB objects
  • Compare session beans and entity beans
  • Define a deployment descriptor
  • Identify the EJB-JAR file
ejb architecture
EJBArchitecture
  • Primary components
    • EJB-compliant server
    • EJB-compliant container
    • Home object (bean factory)
    • EJB object (remote interface)
    • EJB
ejb container services
EJBContainer Services
  • Distributed transaction management
  • Persistence
  • Security
  • Component resource and life cycle management
  • Remote accessibility
  • Transparent location of components
  • Identification of components
the ejb home object
The EJBHome Object
  • Location transparency
the ejb object
TheEJB Object

Stubs

Skeletons

types of enterprise javabeans
Types ofEnterprise JavaBeans
  • Session beans
    • Stateful
    • Stateless
  • Entity beans
deployment descriptors
DeploymentDescriptors
  • An XML document that describes the properties of an EJB
the ejb jar file
TheEJB-JAR File
  • Contains the class files for a bean, its home and remote interfaces, and the deployment descriptors
summary1
Summary
  • Define an EJB server’s main components
  • Discuss EJB and client interaction
  • Identify EJB container services
  • Describe home objects and EJB objects
  • Compare session beans and entity beans
  • Define a deployment descriptor
  • Identify the EJB-JAR file
objectives2
Objectives
  • Define the methods of the SessionBean interface
  • Describe the EJBContext and the SessionContext interfaces
  • Contrast stateful and stateless session beans
  • Explain how to write business methods for a session bean
  • Discuss the enterprise bean’s life cycle
objectives cont d
Objectives (cont’d)
  • Create a session bean
  • Define the EJBHome and EJBObject interfaces and their methods
  • Discuss the superclass for the home and remote interfaces
  • Describe system and application exceptions
  • Deploy and connect to a session bean
creating the enterprise bean class
Creating theEnterprise Bean Class
  • ejbCreate methods
  • The SessionBean interface
  • The EJBContext interface
  • The SessionContext interface
stateless and stateful session beans
Stateless andStateful Session Beans
  • Stateless session beans
    • Do not keep track of any information from one method call to the next
  • Stateful session beans
    • Can change their state during a conversation with a client
writing business methods for an enterprise bean
Writing Business Methods for an Enterprise Bean
  • Each EJB must declare the business methods that define the work that the EJB is designed to perform
the home interface
The Home Interface
  • Extends EJBHome
  • Provides mechanisms to create and remove EJB components
the ejb object1
The EJB Object
  • Extends the EJBObject interface
exceptions in ejb
Exceptions in EJB
  • System exceptions
  • Application exceptions
example a session bean
Example:A Session Bean
  • The Teller bean class
  • The Teller remote interface
  • The Teller home interface
the library application
The LibraryApplication
  • The Book entity bean
  • The Patron entity bean
  • The CheckOutRecord entity bean
  • The CheckOut session bean
  • The CheckIn session bean
introduction to ejb deployment
Introduction toEJB Deployment
  • The deployment descriptor
    • DD XML tags
  • Environment data
    • Environment property XML tags
    • Accessing environment data
  • Using bean references
    • EJB reference XML tags
    • Using the EJB reference
  • Using resource factories
    • Factory resource XML tags
additional deployment concepts
AdditionalDeployment Concepts
  • Assembler/deployer roles with the deployment descriptor
  • EJB deployment in an EJB server
summary2
Summary
  • Define the methods of the SessionBean interface
  • Describe the EJBContext and the SessionContext interfaces
  • Contrast stateful and stateless session beans
  • Explain how to write business methods for a session bean
  • Discuss the enterprise bean’s life cycle
summary cont d
Summary (cont’d)
  • Create a session bean
  • Define the EJBHome and EJBObject interfaces and their methods
  • Discuss the superclass for the home and remote interfaces
  • Describe system and application exceptions
  • Deploy and connect to a session bean
objectives3
Objectives
  • Discuss entity beans and their persistence management techniques
  • Identify the methods of the EntityBean and EntityContext interfaces
  • Define primary keys and their use
  • Describe the mechanics involved in entity beans
  • Use finder methods
  • Write an entity bean and its required interfaces
what is an entity bean
What Is an Entity Bean?
  • The EntityBean interface
  • The EntityContext interface
  • Primary keys
entity bean architecture
Entity BeanArchitecture
  • Creating entity beans
  • Invoking business methods on entity beans
  • Swapping entity beans
  • Invoking remove( ) on an entity bean
  • Life cycle of an entity bean instance
bean managed persistence
Bean-ManagedPersistence
  • Using JDBC
  • Using a resource factory to connect to a database
entity bean methods
Entity Bean Methods
  • The ejbCreate( ) method
  • The ejbPostCreate( ) method
  • The ejbRemove( ) method
  • The ejbLoad( ) method
  • The ejbStore( ) method
using finder methods
UsingFinder Methods
  • The ejbFindByPrimaryKey( ) method
  • Multiple row finders
the remote interface
The Remote Interface
  • All remote interfaces extend javax.ejb.EJBObject
the home interface1
The Home Interface
  • The Account entity bean
summary3
Summary
  • Discuss entity beans and their persistence management techniques
  • Identify the methods of the EntityBean and EntityContext interfaces
  • Define primary keys and their use
  • Describe the mechanics involved in entity beans
  • Use finder methods
  • Write an entity bean and its required interfaces
objectives4
Objectives
  • Use JNDI to obtain a reference to the home object
  • Instantiate an EJB instance using the home object
  • Call an enterprise bean\'s business methods
  • Remove an enterprise bean
  • Write an EJB client
creating an ejb instance
Creatingan EJB Instance
  • Invocation of business methods
summary4
Summary
  • Use JNDI to obtain a reference to the home object
  • Instantiate an EJB instance using the home object
  • Call an enterprise bean\'s business methods
  • Remove an enterprise bean
  • Write an EJB client
objectives5
Objectives
  • Discuss entity beans and CMP
  • Explain the benefits and disadvantages of using CMP
  • Describe the primary key as it relates to CMP
  • Define an ejbCreate() method that uses CMP
  • Write the requisite methods for an entity bean to use CMP
introduction to container managed persistence cmp
Introduction to Container-Managed Persistence (CMP)
  • Benefits
    • Less code needed
    • Optimization techniques
    • More portable
    • Fewer bugs
  • Disadvantages
    • Less flexibility
    • Inaccessible code
the primary key
ThePrimary Key
  • Primary key class
    • Must be serializable
    • Must be of a legal value type in RMI-IIOP
ejb methods and cmp
EJBMethods and CMP
  • ejbCreate()
  • ejbRemove()
  • ejbLoad()
  • ejbStore()
  • Other methods
  • Finder methods
the deployment descriptor
TheDeployment Descriptor
  • EJB requirements
  • DD XML tags
the deployment descriptor and cmp
The Deployment Descriptor and CMP
  • Example: A CMP entity bean
    • The EmployeeEJB bean class
    • The home interface
    • The remote interface
summary5
Summary
  • Discuss entity beans and CMP
  • Explain the benefits and disadvantages of using CMP
  • Describe the primary key as it relates to CMP
  • Define an ejbCreate() method that uses CMP
  • Write the requisite methods for an entity bean to use CMP
objectives6
Objectives
  • Define transactions and explain their use
  • Distinguish transaction participants
  • Define transaction properties
  • Explain the EJB transactional model
  • Describe distributed transactions
  • Define transaction isolation levels
  • Discuss EJB transaction attributes
what are transactions
What Are Transactions?
  • Operations or series of operations that are treated as single units of work
  • Transactional management
participants in transactions
Participantsin Transactions
  • Transactional objects or applications
  • Transaction managers
  • Resources
  • Resource managers
properties of transactions
Propertiesof Transactions
  • Atomicity
  • Consistency
  • Isolation
  • Durability
ejb transactional models
EJBTransactional Models
  • Flat transactional model
  • Nested transactional model
distributed transactions
DistributedTransactions
  • Two-phase commits
  • Transparent transaction control
    • Transaction context
isolation levels
Isolation Levels
  • Strict
    • Each concurrent transaction is isolated from all other transactions
  • Nonstrict
    • Increased transactional performance
    • Possibility of corrupted data
transactions in ejb
Transactions in EJB
  • Transaction demarcation
  • Container-managed transactions
    • Attributes
  • Defining CMT in the DD
  • Setting CMT in Deploytool
container managed transactions
Container-Managed Transactions
  • Container-managed transaction attributes
  • Which methods require transaction attributes?
  • The setRollbackOnly( ) and getRollbackOnly( ) methods
  • Defining CMT in the DD
  • Setting CMT in Deploytool
bean managed transactions
Bean-ManagedTransactions
  • UserTransaction interface
    • Properties
    • Methods
  • Setting BMT in the DD
  • BMT and stateful session beans
  • BMT and stateless session beans
summary6
Summary
  • Define transactions and explain their use
  • Distinguish transaction participants
  • Define transaction properties
  • Explain the EJB transactional model
  • Describe distributed transactions
  • Define transaction isolation levels
  • Discuss EJB transaction attributes
objectives7
Objectives
  • Define users in EJB security
  • Discuss principals in EJB security
  • Identify roles in EJB security
  • Describe the DD’s role in EJB security
  • Explain the EJB container’s role in EJB security
defining users principals and roles
Defining Users,Principals and Roles
  • Overview of EJB security
    • Authentication
    • Authorization
  • Authorization in EJB code
security and the deployment descriptor
Security and the Deployment Descriptor
  • The bean developer and the DD
  • The application assembler and the DD
  • The deployer and the DD
summary7
Summary
  • Define users in EJB security
  • Discuss principals in EJB security
  • Identify roles in EJB security
  • Describe the DD’s role in EJB security
  • Explain the EJB container’s role in EJB security
enterprise javabeans2
Enterprise JavaBeans
  • Introduction to Server-Side Component Software
  • Overview of the Enterprise JavaBeans Framework
  • Creating Session Beans
  • Entity Beans
enterprise javabeans3
EnterpriseJavaBeans
  • Enterprise JavaBeans Clients
  • Container-Managed Persistence
  • Transactions in Enterprise JavaBeans
  • Enterprise JavaBeans Security
ad