SlideShare ist ein Scribd-Unternehmen logo
1 von 57
1Copyright 2015 © Adeppa
J2EE – BuildingJ2EE – Building
Component-based EnterpriseComponent-based Enterprise
Web ApplicationsWeb Applications
09/29/201509/29/2015
2
Copyright 2015 © Adeppa
Agenda
1. Application servers
2. What is J2EE?
 Main component types
 Application Scenarios
 J2EE APIs and Services
1. EJB – a closer look
2. Examples
3Copyright 2015 © Adeppa
1. Application Servers
 In the beginning, there was darkness and
cold. Then, …
Centralized, non-distributed
terminals
mainframe
terminals
4Copyright 2015 © Adeppa
Application Servers
 In the 90’s, systems should be client-
server
5Copyright 2015 © Adeppa
Application Servers
 Today, enterprise applications use
the multi-tier model
6Copyright 2015 © Adeppa
Application Servers
 “Multi-tier applications” have several
independent components
 An application server provides the
infrastructure and services to run such
applications
7Copyright 2015 © Adeppa
Application Servers
 Application server products can be
separated into 3 categories:
 J2EE-based solutions
 Non-J2EE solutions (PHP, ColdFusion,
Perl, etc.)
 And the Microsoft solution (ASP/COM and
now .NET with ASP.NET, VB.NET, C#,
etc.)
8Copyright 2015 © Adeppa
J2EE Application Servers
 Major J2EE products:
 BEA WebLogic
 IBM WebSphere
 Sun iPlanet Application Server
 Oracle 9iAS
 HP/Bluestone Total-e-Server
 Borland AppServer
 Jboss (free open source)
9Copyright 2015 © Adeppa
Web Server and Application Server
Web Server
(HTTP Server)
App Server 1
App Server 2
Internet Browser
HTTP(S)
10Copyright 2015 © Adeppa
2. What is J2EE?
 It is a public specification that
embodies several technologies
 Current version is 1.3
 J2EE defines a model for developing
multi-tier, web based, enterprise
applications with distributed
components
11Copyright 2015 © Adeppa
J2EE Benefits
 High availability
 Scalability
 Integration with existing systems
 Freedom to choose vendors of
application servers, tools, components
 Multi-platform
12
Copyright 2015 © Adeppa
J2EE Benefits
 Flexibility of scenarios and support to several
types of clients
 Programming productivity:
 Services allow developer to focus on business
 Component development facilitates maintenance
and reuse
 Enables deploy-time behaviors
 Supports division of labor
13Copyright 2015 © Adeppa
J2EE Benefits
Don’t forget to say
that Java is cool!
14Copyright 2015 © Adeppa
Main technologies
 JavaServer Pages (JSP)
 Servlet
 Enterprise JavaBeans (EJB)
 JSPs, servlets and EJBs are application
components
15Copyright 2015 © Adeppa
JSP
 Used for web pages with dynamic content
 Processes HTTP requests (non-blocking
call-and-return)
 Accepts HTML tags, special JSP tags, and
scriptlets of Java code
 Separates static content from presentation
logic
 Can be created by web designer using
HTML tools
16Copyright 2015 © Adeppa
Servlet
 Used for web pages with dynamic content
 Processes HTTP requests (non-blocking call-
and-return)
 Written in Java; uses print statements to
render HTML
 Loaded into memory once and then called
many times
 Provides APIs for session management
17Copyright 2015 © Adeppa
EJB
 EJBs are distributed components used to
implement business logic (no UI)
 Developer concentrates on business logic
 Availability, scalability, security,
interoperability and integrability handled by
the J2EE server
 Client of EJBs can be JSPs, servlets, other
EJBs and external aplications
 Clients see interfaces
18Copyright 2015 © Adeppa
J2EE Multi-tier Model
19Copyright 2015 © Adeppa
J2EE Application Scenarios
 Multi-tier typical application
20Copyright 2015 © Adeppa
J2EE Application Scenarios
 Stand-alone client
21Copyright 2015 © Adeppa
J2EE Application Scenarios
 Web-centric application
22Copyright 2015 © Adeppa
J2EE Application Scenarios
 Business-to-business
23Copyright 2015 © Adeppa
J2EE Services and APIs
 Java Message Service (JMS)
 Implicit invocation
 Communication is loosely coupled,
reliable and asynchronous
 Supports 2 models:
 point-to-point
 publish/subscribe
24Copyright 2015 © Adeppa
JMS
 Point-to-point
 Destination is “queue”
25Copyright 2015 © Adeppa
JMS
 Publish-subscribe
 Destination is “topic”
26Copyright 2015 © Adeppa
J2EE Services and APIs
 JNDI - Naming and directory services
 Applications use JNDI to locate objects,
such as environment entries, EJBs,
datasources, message queues
 JNDI is implementation independent
 Underlying implementation varies: LDAP,
DNS, DBMS, etc.
27Copyright 2015 © Adeppa
J2EE Services and APIs
 Transaction service:
 Controls transactions automatically
 You can demarcate transactions explicitly
 Or you can specify relationships between
methods that make up a single transaction
28Copyright 2015 © Adeppa
J2EE Services and APIs
 Security
 Java Authentication and Authorization Service
(JAAS) is the new (J2EE 1.3) standard for J2EE
security
 Authentication via userid/password or digital
certificates
 Role-based authorization limits access of users to
resources (URLs, EJB methods)
 Embedded security realm
29Copyright 2015 © Adeppa
J2EE Services and APIs
 J2EE Connector Architecture
 Integration to non-J2EE systems, such as
mainframes and ERPs.
 Standard API to access different EIS
 Vendors implement EIS-specific resource
adapters
 Support to Corba clients
30Copyright 2015 © Adeppa
J2EE Services and APIs
 JDBC
 JavaMail
 Java API for XML Parsing (JAXP)
 Web services APIs
31Copyright 2015 © Adeppa
3. EJB – a closer look
32Copyright 2015 © Adeppa
Home Interface
 Methods to create, remove or locate
EJB objects
 The home interface implementation is
the home object (generated)
 The home object is a factory
33Copyright 2015 © Adeppa
Remote Interface
 Business methods available to clients
 The remote interface implementation
is the EJB object (generated)
 The EJB object acts as a proxy to the
EJB instance
34Copyright 2015 © Adeppa
35Copyright 2015 © Adeppa
EJB – The Big Picture
36Copyright 2015 © Adeppa
EJB at runtime
Client can be local or remote
37Copyright 2015 © Adeppa
EJB at runtime
38Copyright 2015 © Adeppa
Types of EJB
E J B T a x o n o m y
S ta te fu l
Sta te le ss
S e ssio n B e a n
B M P
C M P
En tity B e a n M e ssa g e D riv e n B e a n
E n te rp rise B e a n
New!
39Copyright 2015 © Adeppa
Session Bean
 Stateful session bean:
 Retains conversational state (data) on
behalf of an individual client
 If state changed during this invocation,
the same state will be available upon the
following invocation
 Example: shopping cart
40Copyright 2015 © Adeppa
Session Bean
 Stateless session bean:
 Contains no user-specific data
 Business process that provides a generic
service
 Container can pool stateless beans
 Example: shopping catalog
41Copyright 2015 © Adeppa
Entity Bean
 Represents business data stored in a
database  persistent object
 Underlying data is normally one row of a
table
 A primary key uniquely identifies each bean
instance
 Allows shared access from multiple clients
 Can live past the duration of client’s session
 Example: shopping order
42Copyright 2015 © Adeppa
Entity Bean
 Bean-managed persistence (BMP): bean
developer writes JDBC code to access the
database; allows better control for the
developer
 Container-managed persistence (CMP):
container generates all JDBC code to access
the database; developer has less code to
write, but also less control
43Copyright 2015 © Adeppa
Message-Driven Bean
 Message consumer for a JMS queue or
topic
 Benefits from EJB container services
that are not available to standard JMS
consumers
 Has no home or remote interface
 Example: order processing – stock
info
44Copyright 2015 © Adeppa
4. Examples
 JSP example
 Servlet example
 EJB example
45Copyright 2015 © Adeppa
JSP example
46Copyright 2015 © Adeppa
JSP example
<%@ page import="hello.Greeting" %>
<jsp:useBean id="mybean" scope="page"
class="hello.Greeting"/>
<jsp:setProperty name="mybean" property="*" />
<html>
<head><title>Hello, User</title></head>
<body bgcolor="#ffffff" background="background.gif">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr>
<td width="150"> &nbsp; </td>
<td width="550">
<h1>My name is Duke. What's yours?</h1>
</td>
</tr>
47Copyright 2015 © Adeppa
JSP example
<tr> <td width="150" &nbsp; </td> <td width="550">
<form method="get">
<input type="text" name="username" size="25"> <br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td> </tr>
</form> </table>
<%
if (request.getParameter("username") != null) {
%>
<%@ include file="response.jsp" %>
<%
}
%>
</body>
</html>
48Copyright 2015 © Adeppa
Servlet example
public class HelloWorldServlet extends HttpServlet {
public void service(HttpServletRequest req,
HttpServletResponse res) throws IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<html><head><title>Hello
World Servlet</title></head>");
out.println("<body><h1>Hello
World!</h1></body></html>");
}
}
49Copyright 2015 © Adeppa
EJB Example
// Shopping Cart example
// Home interface
public interface CartHome extends EJBHome {
Cart create(String person)
throws RemoteException, CreateException;
Cart create(String person, String id)
throws RemoteException, CreateException;
}
50Copyright 2015 © Adeppa
EJB Example
// Remote interface
public interface Cart extends EJBObject {
public void addBook(String title)
throws RemoteException;
public void removeBook(String title)
throws BookException, RemoteException;
public Vector getContents()
throws RemoteException;
}
51Copyright 2015 © Adeppa
EJB Example
// Enterprise bean class
public class CartEJB implements SessionBean {
String customerName, customerId;
Vector contents;
private SessionContext sc;
public void ejbCreate(String person) throws CreateException {
if (person == null) {
throw new CreateException("Null person not allowed.");
}
else {
customerName = person;
}
customerId = "0";
contents = new Vector();
}
52Copyright 2015 © Adeppa
EJB Example
public void ejbCreate(String person, String id)
throws CreateException {
if (person == null) {
throw new CreateException("Null person not allowed.");
}
else {
customerName = person;
}
IdVerifier idChecker = new IdVerifier();
if (idChecker.validate(id)) {
customerId = id;
}
else {
throw new CreateException("Invalid id: " + id);
}
contents = new Vector();
}
53Copyright 2015 © Adeppa
EJB Example
public void addBook(String title) {
contents. addElement(title);
}
public void removeBook(String title) throws BookException {
boolean result = contents.removeElement(title);
if (result == false) {
throw new BookException(title + " not in cart.");
}
}
public Vector getContents() {
return contents;
}
. . .
}
54Copyright 2015 © Adeppa
EJB Example
// EJB client (stand-alone application)
public class CartClient {
public static void main(String[] args) {
try {
CartHome home = (CartHome)initial.lookup("MyCart");
Cart shoppingCart = home.create("Duke DeEarl", "123");
shoppingCart.addBook("The Martian Chronicles");
shoppingCart.addBook("2001 A Space Odyssey");
shoppingCart.remove();
} catch (BookException ex) {
System.err.println("Caught a BookException: "
+ ex.getMessage());
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
}
}
}
55Copyright 2015 © Adeppa
Questions
56Copyright 2015 © Adeppa
Sources & Resources
 Java 2 Platform Enterprise Edition
Specification, v1.3
 Designing Enterprise Applications with the
Java 2, Enterprise Edition. Nicholas Kassen
and the Enterprise Team
 Does the App Server Maket Still Exist? Jean-
Christophe Cimetiere
 The State of The J2EE Application Server
Market. Floyd Marinescu
57Copyright 2015 © Adeppa
Sources & Resources
 The J2EE Tutorial. Sun Microsystems
 IBM WebSphere Application Server
manuals
 BEA WebLogic Server manuals
 www.java.sun.com/j2ee
 www.theserverside.com

Weitere ähnliche Inhalte

Was ist angesagt?

Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards World
Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards WorldCool Functionality and Workarounds to Make Your Life Easier - JD Edwards World
Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards WorldNERUG
 
Oracle Mobile Cloud / Bot
Oracle Mobile Cloud / BotOracle Mobile Cloud / Bot
Oracle Mobile Cloud / BotMee Nam Lee
 
The Web Framework Dream Team
The Web Framework Dream TeamThe Web Framework Dream Team
The Web Framework Dream TeamJohan Eltes
 
DDS vs DDS4CCM
DDS vs DDS4CCMDDS vs DDS4CCM
DDS vs DDS4CCMRemedy IT
 
2012 year Siebel CRM Strategy and Roadmap (outdated)
2012 year Siebel CRM Strategy and Roadmap (outdated)2012 year Siebel CRM Strategy and Roadmap (outdated)
2012 year Siebel CRM Strategy and Roadmap (outdated)Ilya Milshtein
 
Final business intelligence in the cloud
Final   business intelligence in the cloudFinal   business intelligence in the cloud
Final business intelligence in the cloudHossam Hassanien
 
Lessons learned in building a model driven software factory
Lessons learned in building a model driven software factoryLessons learned in building a model driven software factory
Lessons learned in building a model driven software factoryJohan den Haan
 
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнеса
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнесаSiebel Innovation Pack 2015 - новый инструмент для Вашего бизнеса
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнесаcrm2life
 
Top 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsTop 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsLiz Kensicki
 
Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]Rhapsody Technologies, Inc.
 
OutworX_Presentation_IBM_AIS
OutworX_Presentation_IBM_AISOutworX_Presentation_IBM_AIS
OutworX_Presentation_IBM_AISShubham Jaisawal
 
OOW15 - case study: oracle application management suite for oracle e-business...
OOW15 - case study: oracle application management suite for oracle e-business...OOW15 - case study: oracle application management suite for oracle e-business...
OOW15 - case study: oracle application management suite for oracle e-business...vasuballa
 
OOW15 - managing oracle e-business suite auditing and security
OOW15 - managing oracle e-business suite auditing and securityOOW15 - managing oracle e-business suite auditing and security
OOW15 - managing oracle e-business suite auditing and securityvasuballa
 
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suite
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business SuiteOOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suite
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suitevasuballa
 
Special Purpose Role-Based Clients for PLM using Aras
Special Purpose Role-Based Clients for PLM using ArasSpecial Purpose Role-Based Clients for PLM using Aras
Special Purpose Role-Based Clients for PLM using ArasAras
 

Was ist angesagt? (20)

Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards World
Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards WorldCool Functionality and Workarounds to Make Your Life Easier - JD Edwards World
Cool Functionality and Workarounds to Make Your Life Easier - JD Edwards World
 
Oracle Mobile Cloud / Bot
Oracle Mobile Cloud / BotOracle Mobile Cloud / Bot
Oracle Mobile Cloud / Bot
 
SAP NetWeaver Gateway - Introduction
SAP NetWeaver Gateway - IntroductionSAP NetWeaver Gateway - Introduction
SAP NetWeaver Gateway - Introduction
 
The Web Framework Dream Team
The Web Framework Dream TeamThe Web Framework Dream Team
The Web Framework Dream Team
 
DDS vs DDS4CCM
DDS vs DDS4CCMDDS vs DDS4CCM
DDS vs DDS4CCM
 
KBACE Applied OBIEE
KBACE Applied OBIEEKBACE Applied OBIEE
KBACE Applied OBIEE
 
Notes
NotesNotes
Notes
 
2012 year Siebel CRM Strategy and Roadmap (outdated)
2012 year Siebel CRM Strategy and Roadmap (outdated)2012 year Siebel CRM Strategy and Roadmap (outdated)
2012 year Siebel CRM Strategy and Roadmap (outdated)
 
NetWeaver Gateway- Service Builder
NetWeaver Gateway- Service BuilderNetWeaver Gateway- Service Builder
NetWeaver Gateway- Service Builder
 
Final business intelligence in the cloud
Final   business intelligence in the cloudFinal   business intelligence in the cloud
Final business intelligence in the cloud
 
Lessons learned in building a model driven software factory
Lessons learned in building a model driven software factoryLessons learned in building a model driven software factory
Lessons learned in building a model driven software factory
 
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнеса
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнесаSiebel Innovation Pack 2015 - новый инструмент для Вашего бизнеса
Siebel Innovation Pack 2015 - новый инструмент для Вашего бизнеса
 
Top 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud FinancialsTop 10 Reasons to Choose Oracle ERP Cloud Financials
Top 10 Reasons to Choose Oracle ERP Cloud Financials
 
Crm web 8182
Crm web 8182Crm web 8182
Crm web 8182
 
Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]Oracle Fusion applications 101 [2010 OAUG Collaborate]
Oracle Fusion applications 101 [2010 OAUG Collaborate]
 
OutworX_Presentation_IBM_AIS
OutworX_Presentation_IBM_AISOutworX_Presentation_IBM_AIS
OutworX_Presentation_IBM_AIS
 
OOW15 - case study: oracle application management suite for oracle e-business...
OOW15 - case study: oracle application management suite for oracle e-business...OOW15 - case study: oracle application management suite for oracle e-business...
OOW15 - case study: oracle application management suite for oracle e-business...
 
OOW15 - managing oracle e-business suite auditing and security
OOW15 - managing oracle e-business suite auditing and securityOOW15 - managing oracle e-business suite auditing and security
OOW15 - managing oracle e-business suite auditing and security
 
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suite
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business SuiteOOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suite
OOW15 - Simplified and Touch-Friendly User Interface in Oracle E-Business Suite
 
Special Purpose Role-Based Clients for PLM using Aras
Special Purpose Role-Based Clients for PLM using ArasSpecial Purpose Role-Based Clients for PLM using Aras
Special Purpose Role-Based Clients for PLM using Aras
 

Andere mochten auch

Architectural Rendering - 3D Applications to Real Estate
Architectural Rendering - 3D Applications to Real EstateArchitectural Rendering - 3D Applications to Real Estate
Architectural Rendering - 3D Applications to Real EstateAutocad Drafting India
 
Components of a building kritika heda
Components of a building kritika hedaComponents of a building kritika heda
Components of a building kritika hedadezyneecole
 
Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)
 Neha Assudani B.Sc.Interior Design ( Building Construction Assignment) Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)
Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)dezyneecole
 
Architectural Rendering
Architectural RenderingArchitectural Rendering
Architectural RenderingJeff Moore
 
Sketching and rendering
Sketching and renderingSketching and rendering
Sketching and renderingPaula Te
 
Architectural drawing
Architectural drawingArchitectural drawing
Architectural drawingLwj Welson
 
Architectural planning and design of buildings pune university se civil bscoe...
Architectural planning and design of buildings pune university se civil bscoe...Architectural planning and design of buildings pune university se civil bscoe...
Architectural planning and design of buildings pune university se civil bscoe...aniruudha banhatti
 
Quality control of concrete
Quality control of concreteQuality control of concrete
Quality control of concreteGaurang Kakadiya
 
Project 1 - Architectural Drawing
Project 1 - Architectural DrawingProject 1 - Architectural Drawing
Project 1 - Architectural DrawingYen Min Khor
 
Architectural Drawing
Architectural DrawingArchitectural Drawing
Architectural DrawingLea Alberto
 
Quality control of concrete
Quality control of concreteQuality control of concrete
Quality control of concreteGaurang Kakadiya
 
002 ADG I: Building Components and Materials
002 ADG I: Building Components and Materials002 ADG I: Building Components and Materials
002 ADG I: Building Components and Materialsindiracad
 
Inrto to Architectural Drawing and Graphics I
Inrto to Architectural Drawing and Graphics IInrto to Architectural Drawing and Graphics I
Inrto to Architectural Drawing and Graphics Iindiracad
 
Architectural drawings
Architectural drawingsArchitectural drawings
Architectural drawingsSomnath Bhui
 

Andere mochten auch (20)

Rendering
RenderingRendering
Rendering
 
Architectural Rendering - 3D Applications to Real Estate
Architectural Rendering - 3D Applications to Real EstateArchitectural Rendering - 3D Applications to Real Estate
Architectural Rendering - 3D Applications to Real Estate
 
Components of a building kritika heda
Components of a building kritika hedaComponents of a building kritika heda
Components of a building kritika heda
 
ITD & ICI
ITD & ICIITD & ICI
ITD & ICI
 
Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)
 Neha Assudani B.Sc.Interior Design ( Building Construction Assignment) Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)
Neha Assudani B.Sc.Interior Design ( Building Construction Assignment)
 
Architectural Rendering
Architectural RenderingArchitectural Rendering
Architectural Rendering
 
Sketching and rendering
Sketching and renderingSketching and rendering
Sketching and rendering
 
Architectural drawing
Architectural drawingArchitectural drawing
Architectural drawing
 
Architectural planning and design of buildings pune university se civil bscoe...
Architectural planning and design of buildings pune university se civil bscoe...Architectural planning and design of buildings pune university se civil bscoe...
Architectural planning and design of buildings pune university se civil bscoe...
 
Quality control of concrete
Quality control of concreteQuality control of concrete
Quality control of concrete
 
Project 1 - Architectural Drawing
Project 1 - Architectural DrawingProject 1 - Architectural Drawing
Project 1 - Architectural Drawing
 
Various elements of building
Various elements of buildingVarious elements of building
Various elements of building
 
Architectural Drawing
Architectural DrawingArchitectural Drawing
Architectural Drawing
 
Quality control of concrete
Quality control of concreteQuality control of concrete
Quality control of concrete
 
002 ADG I: Building Components and Materials
002 ADG I: Building Components and Materials002 ADG I: Building Components and Materials
002 ADG I: Building Components and Materials
 
Inrto to Architectural Drawing and Graphics I
Inrto to Architectural Drawing and Graphics IInrto to Architectural Drawing and Graphics I
Inrto to Architectural Drawing and Graphics I
 
Components of a building
Components of a buildingComponents of a building
Components of a building
 
Principle of architecture
Principle of architecturePrinciple of architecture
Principle of architecture
 
Architectural drawings
Architectural drawingsArchitectural drawings
Architectural drawings
 
types of drawing
types of drawingtypes of drawing
types of drawing
 

Ähnlich wie j2ee Building components

Mho Web Dynpro Abap
Mho Web Dynpro AbapMho Web Dynpro Abap
Mho Web Dynpro Abapthomas_jung
 
3983 cics java real life projects
3983   cics java real life projects3983   cics java real life projects
3983 cics java real life projectsnick_garrod
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to PostgresEDB
 
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...CA Technologies
 
Sap fundamentals overview_for_sap_minors
Sap fundamentals overview_for_sap_minorsSap fundamentals overview_for_sap_minors
Sap fundamentals overview_for_sap_minorsCenk Ersoy
 
Modernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsModernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsApigee | Google Cloud
 
DevOps monitoring: Feedback loops in enterprise environments
DevOps monitoring: Feedback loops in enterprise environmentsDevOps monitoring: Feedback loops in enterprise environments
DevOps monitoring: Feedback loops in enterprise environmentsJonah Kowall
 
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535Ahmad Gohar
 
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptxGangTingFan
 
Deliver Secure SQL Access for Enterprise APIs - August 29 2017
Deliver Secure SQL Access for Enterprise APIs - August 29 2017Deliver Secure SQL Access for Enterprise APIs - August 29 2017
Deliver Secure SQL Access for Enterprise APIs - August 29 2017Nishanth Kadiyala
 
Flex360 Milan 2008 - Flex & Webservices
Flex360 Milan 2008 - Flex & WebservicesFlex360 Milan 2008 - Flex & Webservices
Flex360 Milan 2008 - Flex & Webservicesivascucristian
 
So we've done APM. Now what?
 So we've done APM. Now what? So we've done APM. Now what?
So we've done APM. Now what?SL Corporation
 
AD404 - Extend your Social Business by integrating SAP Solutions
AD404 - Extend your Social Business by integrating SAP SolutionsAD404 - Extend your Social Business by integrating SAP Solutions
AD404 - Extend your Social Business by integrating SAP SolutionsChristian Holsing
 
NetApp Integrated EVO:RAIL Solution Frank Sowin
NetApp Integrated EVO:RAIL Solution Frank SowinNetApp Integrated EVO:RAIL Solution Frank Sowin
NetApp Integrated EVO:RAIL Solution Frank Sowinfsowin
 
Java on zSystems zOS
Java on zSystems zOSJava on zSystems zOS
Java on zSystems zOSTim Ellison
 
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...eG Innovations
 
Cloud native Microservices using Spring Boot
Cloud native Microservices using Spring BootCloud native Microservices using Spring Boot
Cloud native Microservices using Spring BootSufyaan Kazi
 

Ähnlich wie j2ee Building components (20)

Mho Web Dynpro Abap
Mho Web Dynpro AbapMho Web Dynpro Abap
Mho Web Dynpro Abap
 
3983 cics java real life projects
3983   cics java real life projects3983   cics java real life projects
3983 cics java real life projects
 
J2ee
J2eeJ2ee
J2ee
 
J2EE.ppt
J2EE.pptJ2EE.ppt
J2EE.ppt
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...
Hands-On Lab: Increase Velocity with the CA Performance Management OpenAPI ...
 
Sap fundamentals overview_for_sap_minors
Sap fundamentals overview_for_sap_minorsSap fundamentals overview_for_sap_minors
Sap fundamentals overview_for_sap_minors
 
Modernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIsModernizing an Existing SOA-based Architecture with APIs
Modernizing an Existing SOA-based Architecture with APIs
 
DevOps monitoring: Feedback loops in enterprise environments
DevOps monitoring: Feedback loops in enterprise environmentsDevOps monitoring: Feedback loops in enterprise environments
DevOps monitoring: Feedback loops in enterprise environments
 
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535
EJB 3.2/JPA 2.1 Best Practices with Real-Life Examples - CON7535
 
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
!GDSC NYUST Infrastructure and Application Modernization with Google Cloud .pptx
 
Deliver Secure SQL Access for Enterprise APIs - August 29 2017
Deliver Secure SQL Access for Enterprise APIs - August 29 2017Deliver Secure SQL Access for Enterprise APIs - August 29 2017
Deliver Secure SQL Access for Enterprise APIs - August 29 2017
 
Flex360 Milan 2008 - Flex & Webservices
Flex360 Milan 2008 - Flex & WebservicesFlex360 Milan 2008 - Flex & Webservices
Flex360 Milan 2008 - Flex & Webservices
 
So we've done APM. Now what?
 So we've done APM. Now what? So we've done APM. Now what?
So we've done APM. Now what?
 
AD404 - Extend your Social Business by integrating SAP Solutions
AD404 - Extend your Social Business by integrating SAP SolutionsAD404 - Extend your Social Business by integrating SAP Solutions
AD404 - Extend your Social Business by integrating SAP Solutions
 
NetApp Integrated EVO:RAIL Solution Frank Sowin
NetApp Integrated EVO:RAIL Solution Frank SowinNetApp Integrated EVO:RAIL Solution Frank Sowin
NetApp Integrated EVO:RAIL Solution Frank Sowin
 
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
 
Java on zSystems zOS
Java on zSystems zOSJava on zSystems zOS
Java on zSystems zOS
 
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...
Enterprise Monitoring 2018: Converged Application & Infrastructure Monitoring...
 
Cloud native Microservices using Spring Boot
Cloud native Microservices using Spring BootCloud native Microservices using Spring Boot
Cloud native Microservices using Spring Boot
 

Kürzlich hochgeladen

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 

Kürzlich hochgeladen (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 

j2ee Building components

  • 1. 1Copyright 2015 © Adeppa J2EE – BuildingJ2EE – Building Component-based EnterpriseComponent-based Enterprise Web ApplicationsWeb Applications 09/29/201509/29/2015
  • 2. 2 Copyright 2015 © Adeppa Agenda 1. Application servers 2. What is J2EE?  Main component types  Application Scenarios  J2EE APIs and Services 1. EJB – a closer look 2. Examples
  • 3. 3Copyright 2015 © Adeppa 1. Application Servers  In the beginning, there was darkness and cold. Then, … Centralized, non-distributed terminals mainframe terminals
  • 4. 4Copyright 2015 © Adeppa Application Servers  In the 90’s, systems should be client- server
  • 5. 5Copyright 2015 © Adeppa Application Servers  Today, enterprise applications use the multi-tier model
  • 6. 6Copyright 2015 © Adeppa Application Servers  “Multi-tier applications” have several independent components  An application server provides the infrastructure and services to run such applications
  • 7. 7Copyright 2015 © Adeppa Application Servers  Application server products can be separated into 3 categories:  J2EE-based solutions  Non-J2EE solutions (PHP, ColdFusion, Perl, etc.)  And the Microsoft solution (ASP/COM and now .NET with ASP.NET, VB.NET, C#, etc.)
  • 8. 8Copyright 2015 © Adeppa J2EE Application Servers  Major J2EE products:  BEA WebLogic  IBM WebSphere  Sun iPlanet Application Server  Oracle 9iAS  HP/Bluestone Total-e-Server  Borland AppServer  Jboss (free open source)
  • 9. 9Copyright 2015 © Adeppa Web Server and Application Server Web Server (HTTP Server) App Server 1 App Server 2 Internet Browser HTTP(S)
  • 10. 10Copyright 2015 © Adeppa 2. What is J2EE?  It is a public specification that embodies several technologies  Current version is 1.3  J2EE defines a model for developing multi-tier, web based, enterprise applications with distributed components
  • 11. 11Copyright 2015 © Adeppa J2EE Benefits  High availability  Scalability  Integration with existing systems  Freedom to choose vendors of application servers, tools, components  Multi-platform
  • 12. 12 Copyright 2015 © Adeppa J2EE Benefits  Flexibility of scenarios and support to several types of clients  Programming productivity:  Services allow developer to focus on business  Component development facilitates maintenance and reuse  Enables deploy-time behaviors  Supports division of labor
  • 13. 13Copyright 2015 © Adeppa J2EE Benefits Don’t forget to say that Java is cool!
  • 14. 14Copyright 2015 © Adeppa Main technologies  JavaServer Pages (JSP)  Servlet  Enterprise JavaBeans (EJB)  JSPs, servlets and EJBs are application components
  • 15. 15Copyright 2015 © Adeppa JSP  Used for web pages with dynamic content  Processes HTTP requests (non-blocking call-and-return)  Accepts HTML tags, special JSP tags, and scriptlets of Java code  Separates static content from presentation logic  Can be created by web designer using HTML tools
  • 16. 16Copyright 2015 © Adeppa Servlet  Used for web pages with dynamic content  Processes HTTP requests (non-blocking call- and-return)  Written in Java; uses print statements to render HTML  Loaded into memory once and then called many times  Provides APIs for session management
  • 17. 17Copyright 2015 © Adeppa EJB  EJBs are distributed components used to implement business logic (no UI)  Developer concentrates on business logic  Availability, scalability, security, interoperability and integrability handled by the J2EE server  Client of EJBs can be JSPs, servlets, other EJBs and external aplications  Clients see interfaces
  • 18. 18Copyright 2015 © Adeppa J2EE Multi-tier Model
  • 19. 19Copyright 2015 © Adeppa J2EE Application Scenarios  Multi-tier typical application
  • 20. 20Copyright 2015 © Adeppa J2EE Application Scenarios  Stand-alone client
  • 21. 21Copyright 2015 © Adeppa J2EE Application Scenarios  Web-centric application
  • 22. 22Copyright 2015 © Adeppa J2EE Application Scenarios  Business-to-business
  • 23. 23Copyright 2015 © Adeppa J2EE Services and APIs  Java Message Service (JMS)  Implicit invocation  Communication is loosely coupled, reliable and asynchronous  Supports 2 models:  point-to-point  publish/subscribe
  • 24. 24Copyright 2015 © Adeppa JMS  Point-to-point  Destination is “queue”
  • 25. 25Copyright 2015 © Adeppa JMS  Publish-subscribe  Destination is “topic”
  • 26. 26Copyright 2015 © Adeppa J2EE Services and APIs  JNDI - Naming and directory services  Applications use JNDI to locate objects, such as environment entries, EJBs, datasources, message queues  JNDI is implementation independent  Underlying implementation varies: LDAP, DNS, DBMS, etc.
  • 27. 27Copyright 2015 © Adeppa J2EE Services and APIs  Transaction service:  Controls transactions automatically  You can demarcate transactions explicitly  Or you can specify relationships between methods that make up a single transaction
  • 28. 28Copyright 2015 © Adeppa J2EE Services and APIs  Security  Java Authentication and Authorization Service (JAAS) is the new (J2EE 1.3) standard for J2EE security  Authentication via userid/password or digital certificates  Role-based authorization limits access of users to resources (URLs, EJB methods)  Embedded security realm
  • 29. 29Copyright 2015 © Adeppa J2EE Services and APIs  J2EE Connector Architecture  Integration to non-J2EE systems, such as mainframes and ERPs.  Standard API to access different EIS  Vendors implement EIS-specific resource adapters  Support to Corba clients
  • 30. 30Copyright 2015 © Adeppa J2EE Services and APIs  JDBC  JavaMail  Java API for XML Parsing (JAXP)  Web services APIs
  • 31. 31Copyright 2015 © Adeppa 3. EJB – a closer look
  • 32. 32Copyright 2015 © Adeppa Home Interface  Methods to create, remove or locate EJB objects  The home interface implementation is the home object (generated)  The home object is a factory
  • 33. 33Copyright 2015 © Adeppa Remote Interface  Business methods available to clients  The remote interface implementation is the EJB object (generated)  The EJB object acts as a proxy to the EJB instance
  • 35. 35Copyright 2015 © Adeppa EJB – The Big Picture
  • 36. 36Copyright 2015 © Adeppa EJB at runtime Client can be local or remote
  • 37. 37Copyright 2015 © Adeppa EJB at runtime
  • 38. 38Copyright 2015 © Adeppa Types of EJB E J B T a x o n o m y S ta te fu l Sta te le ss S e ssio n B e a n B M P C M P En tity B e a n M e ssa g e D riv e n B e a n E n te rp rise B e a n New!
  • 39. 39Copyright 2015 © Adeppa Session Bean  Stateful session bean:  Retains conversational state (data) on behalf of an individual client  If state changed during this invocation, the same state will be available upon the following invocation  Example: shopping cart
  • 40. 40Copyright 2015 © Adeppa Session Bean  Stateless session bean:  Contains no user-specific data  Business process that provides a generic service  Container can pool stateless beans  Example: shopping catalog
  • 41. 41Copyright 2015 © Adeppa Entity Bean  Represents business data stored in a database  persistent object  Underlying data is normally one row of a table  A primary key uniquely identifies each bean instance  Allows shared access from multiple clients  Can live past the duration of client’s session  Example: shopping order
  • 42. 42Copyright 2015 © Adeppa Entity Bean  Bean-managed persistence (BMP): bean developer writes JDBC code to access the database; allows better control for the developer  Container-managed persistence (CMP): container generates all JDBC code to access the database; developer has less code to write, but also less control
  • 43. 43Copyright 2015 © Adeppa Message-Driven Bean  Message consumer for a JMS queue or topic  Benefits from EJB container services that are not available to standard JMS consumers  Has no home or remote interface  Example: order processing – stock info
  • 44. 44Copyright 2015 © Adeppa 4. Examples  JSP example  Servlet example  EJB example
  • 45. 45Copyright 2015 © Adeppa JSP example
  • 46. 46Copyright 2015 © Adeppa JSP example <%@ page import="hello.Greeting" %> <jsp:useBean id="mybean" scope="page" class="hello.Greeting"/> <jsp:setProperty name="mybean" property="*" /> <html> <head><title>Hello, User</title></head> <body bgcolor="#ffffff" background="background.gif"> <%@ include file="dukebanner.html" %> <table border="0" width="700"> <tr> <td width="150"> &nbsp; </td> <td width="550"> <h1>My name is Duke. What's yours?</h1> </td> </tr>
  • 47. 47Copyright 2015 © Adeppa JSP example <tr> <td width="150" &nbsp; </td> <td width="550"> <form method="get"> <input type="text" name="username" size="25"> <br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </td> </tr> </form> </table> <% if (request.getParameter("username") != null) { %> <%@ include file="response.jsp" %> <% } %> </body> </html>
  • 48. 48Copyright 2015 © Adeppa Servlet example public class HelloWorldServlet extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("<html><head><title>Hello World Servlet</title></head>"); out.println("<body><h1>Hello World!</h1></body></html>"); } }
  • 49. 49Copyright 2015 © Adeppa EJB Example // Shopping Cart example // Home interface public interface CartHome extends EJBHome { Cart create(String person) throws RemoteException, CreateException; Cart create(String person, String id) throws RemoteException, CreateException; }
  • 50. 50Copyright 2015 © Adeppa EJB Example // Remote interface public interface Cart extends EJBObject { public void addBook(String title) throws RemoteException; public void removeBook(String title) throws BookException, RemoteException; public Vector getContents() throws RemoteException; }
  • 51. 51Copyright 2015 © Adeppa EJB Example // Enterprise bean class public class CartEJB implements SessionBean { String customerName, customerId; Vector contents; private SessionContext sc; public void ejbCreate(String person) throws CreateException { if (person == null) { throw new CreateException("Null person not allowed."); } else { customerName = person; } customerId = "0"; contents = new Vector(); }
  • 52. 52Copyright 2015 © Adeppa EJB Example public void ejbCreate(String person, String id) throws CreateException { if (person == null) { throw new CreateException("Null person not allowed."); } else { customerName = person; } IdVerifier idChecker = new IdVerifier(); if (idChecker.validate(id)) { customerId = id; } else { throw new CreateException("Invalid id: " + id); } contents = new Vector(); }
  • 53. 53Copyright 2015 © Adeppa EJB Example public void addBook(String title) { contents. addElement(title); } public void removeBook(String title) throws BookException { boolean result = contents.removeElement(title); if (result == false) { throw new BookException(title + " not in cart."); } } public Vector getContents() { return contents; } . . . }
  • 54. 54Copyright 2015 © Adeppa EJB Example // EJB client (stand-alone application) public class CartClient { public static void main(String[] args) { try { CartHome home = (CartHome)initial.lookup("MyCart"); Cart shoppingCart = home.create("Duke DeEarl", "123"); shoppingCart.addBook("The Martian Chronicles"); shoppingCart.addBook("2001 A Space Odyssey"); shoppingCart.remove(); } catch (BookException ex) { System.err.println("Caught a BookException: " + ex.getMessage()); } catch (Exception ex) { System.err.println("Caught an unexpected exception!"); } } }
  • 55. 55Copyright 2015 © Adeppa Questions
  • 56. 56Copyright 2015 © Adeppa Sources & Resources  Java 2 Platform Enterprise Edition Specification, v1.3  Designing Enterprise Applications with the Java 2, Enterprise Edition. Nicholas Kassen and the Enterprise Team  Does the App Server Maket Still Exist? Jean- Christophe Cimetiere  The State of The J2EE Application Server Market. Floyd Marinescu
  • 57. 57Copyright 2015 © Adeppa Sources & Resources  The J2EE Tutorial. Sun Microsystems  IBM WebSphere Application Server manuals  BEA WebLogic Server manuals  www.java.sun.com/j2ee  www.theserverside.com

Hinweis der Redaktion

  1. The Web Server (also called HTTP Server) serves only static content, typically HTML pages. The Application server serves dynamic content and contains and environment to execute Java components. Usually there is a plug-in that must be installed in the web server in order to communicate with the AppServer. Typically, if the web server is IIS, the communication with the app server is via ISAPI, if it is Apache the communication is via NSAPI, and so on.
  2. Actually, an HTTP servlet processes HTTP requests. APIs for maintaining session data throughout a web application and interacting with the user request  overcomes the limitation of the stateless nature of HTTP.
  3. J2EE servers are not obliged to implement JTS. The transaction manager must support distributed transaction, what is typically done with XA.
  4. JAXP was added to J2EE v1.3 J2EE v1.3 determines that J2EE products must be capable of exporting enterprise beans using the IIOP protocol. This is required to enable interoperability and to make EJB appear as Corba objects.
  5. The type of the session bean (stateless or stateful) is declared in the DD.
  6. stateless session beans can have non-client specific state, for example, an open database connection.
  7. Other servlet examples implement the doPost() and/or doGet() methods. These methods reply only to POST or GET requests; if you want to handle all request types from a single method, your servlet can simply implement the service() method. (However, if you choose to implement the service() method, you will not be able to implement the doPost() or doGet() methods, unless you call super.service() at the beginning of the service() method.)
  8. Many details are omitted in the source code examples.