Transcript Sockets

Application Server Lecture
Paulo Barroso
Kris Carver
Todd Kitterman
Eric Silva
Today: An Application Server
 Overview



What is an Application Server?
Why would it be used?
How is it implemented?
 Our Project: Enterprise JavaBeans
Application Server


Enterprise JavaBeans
Container/Deployer
CS377
2
What Is an Application Server?
 A program in a distributed network
 Provides business logic for an application
program
 Supports thousands of simultaneous clients
 Works in a three tier networking architecture
CS377
3
Three Tier Application
CS377
4
Why an Application Server?
 Makes distributed applications programming
easier


Programmers do not have to be concerned with
distributed computing (e.g. resource
management, etc.)
Application server does this
 Many simultaneous clients
 Security for all clients
CS377
5
Implementation of an Enterprise
JavaBeans Application Server
 Three Major Parts

Beans


Container


Perform the business logic
The “Operating System” of the Application Server
Deployer

Installs Beans and web components on the Application
Server
CS377
6
Enterprise JavaBeans
 Enterprise JavaBeans is an architecture for
setting up program components
 Components are Beans
 Beans run on a server as part of client/server
model
 Can be deployed across all major operating
systems
CS377
7
Container: Introduction
 What does the container do?




Runtime Support for Beans
Lifecycle Management of Beans
Transaction & Security Management
Scalable Management of Resources
CS377
8
Client View of Container
container
EJBOjects
EJBHome
Bean 2
client
EJBOjects
EJBHome
CS377
Bean 1
EJB Spec 2.0
9
Session Bean Lifecycle
ejbcreate()
does not
exist
timeout
ejbPassivate()
ready
passive
ejbActivate()
afterBegin()
afterCompletion()
ready in
TX
CS377
EJB Spec 2.0
10
Container Implementation
 Implemented in Java



Multiple instances of a Java Bean may be
instantiated
Running or active Java Beans are managed in a
thread pool
Passive or waiting beans are managed separately
CS377
11
Deployer: Introduction
 What does the deployer do?



Installs/uninstalls enterprise applications onto the
server
Manages installed applications
Can be either a command-line based or graphical
tool
CS377
12
Responsibilities of the
Deployer
 For each enterprise bean, the deployer:





Reads bean properties from deployment descriptor
Generates and compiles RMI stubs/skeletons
Sets up the bean's security environment
Sets up the bean's transaction environment
Registers the bean in JNDI space (see next slide)
CS377
13
What Is JNDI?
 JNDI: Java Naming and Directory Interface
CS377
14
What is JNDI? (cont'd)
 JNDI: Java Naming and Directory Interface


API that provides a standard for connection and
use of various naming services (e.g. DNS, LDAP)
Used in a Java Application Server to locate
Enterprise JavaBeans' home and remote interfaces

Implemented our own naming service to accomplish this.
CS377
15
Deployer Implementation
 Makes use of standard Java tools




Generates Java source files
Uses javac and rmic to compile, create stubs
and skeletons
Binds remote and home interfaces using JNDI
service provider
Support for security, transactions not yet
implemented
CS377
16