View
212
Download
0
Tags:
Embed Size (px)
Citation preview
The J2EE FrameworkThe J2EE Framework
1
Introduction to
Java 2 Enterprise Edition
Presented by
Communication & Collaboration Technologies
Division of the Chief Information Officer
Rensselaer Polytechnic Institute
Welcome!
The J2EE FrameworkThe J2EE Framework
2
Main Topics
• Introduction– The Goal
– The Problem
– The Solution
• What is J2EE?
• Motivations
• The J2EE Framework
• Case Studies / Examples
The J2EE FrameworkThe J2EE Framework
3
Motivations
Why J2EE?
• Presentation world is web-centric
• Tried other approaches
– Static HTML, CGI, Applets, ASP
• Need integration with campus-wide services
• Capitalize on developer’s strengths
– Programming
– Presentation
– DBM
• Framework is being widely adopted by vendors
The J2EE FrameworkThe J2EE Framework
4
Motivations
• Oracle 9iAS Internet Application Server Enterprise Edition used by SCT for Banner
• 100% compliant J2EE server
Oracle9i Application Serverhttp://www.oracle.com/ip/deploy/ias
The J2EE FrameworkThe J2EE Framework
5
Motivations
• “WebSphere continues the evolution to a single Web services-enabled, Java™ 2 Enterprise Edition (J2EE) application server and development environment that addresses the essential elements needed for an on demand operating environment.”
– http://www-3.ibm.com/software/info1/websphere
• IBM & Globus Project developing grid computing with JBoss and IBM WebSphere
– http://www-1.ibm.com/grid/grid_strategy.shtml
– http://www.javaworld.com/javaworld/jw-09-2002/jw-0906-grid.html
The J2EE FrameworkThe J2EE Framework
7
J2EE Container
Component Based Architecture
• Applications are built from components– Java class files
– Configuration files (usually XML)
– Data files (html, images, directories,…)
• Components are packaged into archives for deployment
– jar : Java Application Resource
– war : Web Application Resource
– ear : Enterprise Application Resource
The J2EE FrameworkThe J2EE Framework
8
J2EE Container
Deploying Applications
• J2EE server specific
– Some provide GUI tools to build and deploy applications (WebSphere, BEA WebLogic)
– Some require editing XML configuration files (JBoss)
• JBoss
– Drop .ear archive files into a “deploy” directory
• Hot deploy & redeploy
The J2EE FrameworkThe J2EE Framework
9
Java Technologies
• JNDI – namespaces, ldap
• JDBC– database connectivity
• JAAS– authentication
• JTA– transactions
• JMX– management & monitoring
• JavaMail– email
• EJB– business logic & data
• JMS– messaging
• CORBA– remote procedure calls
• SOAP– web services
• RMI– remote method invocation
• Servlets– web logic
• JSP– web presentation
• XML– portability
The J2EE FrameworkThe J2EE Framework
10
JNDI
Java Naming & Directory Interface
• Provides namespace support for J2EE
– Beans located by name within container namespace
– Application attributes located by name within application local namespace
• Controlled access from external servers
• Access to LDAP directories
The J2EE FrameworkThe J2EE Framework
11
JDBC
Java DataBase Connectivity
• Java equivalent of ODBC (Open DataBase Connectivity)
• Java API that enables Java programs to execute SQL statements. This allows Java programs to interact with any SQL-compliant database
The J2EE FrameworkThe J2EE Framework
12
JAAS
Java Authentication and
Authorization Service
• Implements a Java version of the standard Pluggable Authentication Module (PAM) framework
• Supports user-based authorization
• Access control at every level
The J2EE FrameworkThe J2EE Framework
13
JTA
Java Transaction API 1 of 2
• Specifies standard interfaces between a transaction manager (e.g. JBoss) and the parties involved in a distributed transaction system:
– the resource manager
– the application server
– and the transactional applications
• Two types of transaction paradigm
– Declarative for entity & session beans
– Programmatic for session beans & servlets
The J2EE FrameworkThe J2EE Framework
14
JTA
Java Transaction API 2 of 2
• Provides “ACID” transaction support
– Atomicity
– Consistency
– Isolation
– Durability
The J2EE FrameworkThe J2EE Framework
15
JMS
Java Message Service
• Point to point messaging
– each message has only one consumer
– used to decouple applications
• Publish/subscribe messaging
– each message may have multiple consumers
The J2EE FrameworkThe J2EE Framework
16
EJB
Enterprise Java Bean
• Bean
– originally a Java class with get() and set() methods
– e.g.: getFirstName(), setFirstName()
• EJBs come in 3 flavors:
The J2EE FrameworkThe J2EE Framework
17
EJB – Entity Bean
Entity Bean
• Represent actual data items (e.g. rows in a result set)
• Two forms of Entity Bean– Container managed persistence:
DB interactions handled by the J2EE environment
– Bean managed persistence: requires that the bean carries out DB interactions itself
• May be called across network connection (RMI)
The J2EE FrameworkThe J2EE Framework
18
Session Bean
• Model a process or task
• Represent resources private to the client
• May update shared data
• Two forms of Session Bean
– Stateful: state maintained between method calls
– Stateless
• One client per session bean instance
EJB – Session Bean
The J2EE FrameworkThe J2EE Framework
19
Message Driven Bean
• Used in conjunction with Java Messaging System
• Activated on JMS message arrival
• No state maintained between activations
APPLICATION
message queue
EJB – Message Driven Bean
*****
*
*session facade
The J2EE FrameworkThe J2EE Framework
20
Servlets
Servlets
• Used for web applications
• Extend functionality of an HTTP server
• Replace CGIs
• Servlet support defined by specification
• Filters are part of the spec
• Consist of get and post methods for requests
The J2EE FrameworkThe J2EE Framework
21
History: Applets
Applets
• Not part of the J2EE framework
• Web-deliverable applications
• Run on client
• Problems
– Require correct JVM on client
– Difficult to write and change
– Presentation and logic combined
The J2EE FrameworkThe J2EE Framework
22
Servlets: JSP
Java Server Pages• Interactive web pages
– <jsp:include page=“/docs/footer.html”/>
– <h2><bean:write property="pageTitle“ name="swfForm"/></h2>
– <% String tempUrl = “http://www.rpi.edu”; %>
• Extension of Servlet technology
• Similar to ASP
• Standard Tag Libraries available– Struts:
• MVC framework
• Industry standard
• Extensible– Can define and implement tag libraries
– Used by numerous vendors, including ColdFusion MX
The J2EE FrameworkThe J2EE Framework
23
Servlets: Filters
Filters
• Transform HTTP requests and responses
filter servlet
request requestrequest
responseresponseresponse
The J2EE FrameworkThe J2EE Framework
24
XSLTstylesheet
Servlets: Filters
Filter Example: The Kiosk
Kiosk
request
XMLXHTML
response
browser
The J2EE FrameworkThe J2EE Framework
25
Examples
Example Applications
• The Kiosk Clones
• Web Forms
• RCS User Profile Manager
• Conference Site Management
The J2EE FrameworkThe J2EE Framework
26
Example: The Kiosk
• Departmental news service
• Role-based content management
• Proof of concept
The J2EE FrameworkThe J2EE Framework
27
Example: The Kiosk
ServletsJSP/XML/XSLT
SessionBeans
EntityBeans
articlearticle
categorycategory
get articleget articleclient view
admin view
restorerestore
utility
The J2EE FrameworkThe J2EE Framework
28
Kiosk Clones
http://j2ee.rpi.edu/helpdesk http://j2ee.rpi.edu/kiosk
http://www.va.rpi.edu
http://www.eng.rpi.edu/frame_news.html
The J2EE FrameworkThe J2EE Framework
29
Example: Web Forms
• Process html & pdf web forms
• Generate email while hiding recipient email addresses from web
• Attach files
• Save values in DB
• Skin switching
• Generated by admin tool or externally
The J2EE FrameworkThe J2EE Framework
31
ServletsJSP/XML/XSLT
SessionBeans
EntityBeans
MessageDriven Beans
Example: Web Forms
client view
admin view
• Form Defs• Form Values• Attachments
mail.rpi.edu
utility
submitsubmit
message queue
message queue
sendmailsendmail
The J2EE FrameworkThe J2EE Framework
32
Example: RCS Profile Manager
• Billing information
• Passwords
• Web mail quota
• Disk usage
• Library passwords
• EZ-Snapshot usage
• General Info
• More to come
The J2EE FrameworkThe J2EE Framework
33
Example: Conference Site
• Self registration
To come:
• Credit-card payment
• Integrated forums
• More user management
• Events scheduling
• News posting
The J2EE FrameworkThe J2EE Framework
34
Vendor Solutions
Purchased Applications
• Many vendors build in the J2EE paradigm
• Can deploy on the same application server
• Example: Jive Forums
– Servlet application– http://www.jivesoftware.com
– http://jiveforums.rpi.edu:8080/jive
The J2EE FrameworkThe J2EE Framework
35
Future Directions
Current & Future Projects
• Web Services
• Calendar Systems
• Directory
• File Services
The J2EE FrameworkThe J2EE Framework
36
Thank you
References and Useful Links• J2EE:
– http://java.sun.com/j2ee/
– http://java.sun.com/j2ee/j2ee_guide.pdf
• JBoss:
– http://www.jboss.org
• Development Tools:
– http://jakarta.apache.org
– http://www.w3.org
• IBM & Grid Computing:
– http://www.javaworld.com/javaworld/jw-09-2002/jw-0906-grid_p.html
• Oracle & Banner:
– http://www.oracle.com/ip/deploy/ias/
– http://technet.oracle.com/oramag/webcolumns/2003/opinion/otn_forms.html
– http://www.sct.com/Education/Products/Solutions/EsTechOracle.html
• Our J2EE presentations:
– http://www.rpi.edu/dept/cct/public/j2ee/