SlideShare a Scribd company logo
J2EE Overview Ian Cole Orlando Java User’s Group February 28, 2002
Presentation Overview Introduction to J2EE Explain the major technologies within the J2EE designation J2EE applications J2EE servers
The Java 2 Platform Platform introduced June, 1999 J2SE – Java 2 Standard Edition Java for the desktop / workstation http://java.sun.com/j2se J2ME – Java 2 Micro Edition Java for the consumer device http://java.sun.com/j2me J2EE - Java 2 Enterprise Edition Java for the server  http://java.sun.com/j2ee
The Java 2 Platform http://java.sun.com/java2/
J2EE Technologies Java Servlets JSP EJB JMS JDBC JNDI JTA / JTS JavaMail JAAS XML …
J2EE Components http://java.sun.com/j2ee/overview3.html
Java Servlets Servlets are the Java platform technology of choice for extending and enhancing web servers.  Servlets provide a component-based, platform-independent method for building web-based applications, without the performance limitations of CGI programs.  http://java.sun.com/products/servlets/index.html
Java Servlets Servlets have access to the entire family of Java APIs, including the  JDBC TM  API  to access enterprise databases.  Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection http://java.sun.com/products/ servlets /index.html
Anatomy of a Servlet init() – the init() function is called when the servlet is initialized by the server. This often happens on the first doGet() or doPut() call of the servlet. destroy() – this function is called when the servlet is being destroyed by the server, typically when the server process is being stopped. http://java.sun.com/docs/books/tutorial/ servlets /lifecycle/index.html
Anatomy of a Servlet doGet() – the doGet() function is called when the servlet is called via an HTTP GET. doPost() – the doPost() function is called when the servlet is called via an HTTP POST. POSTs are a good way to get input from HTML forms http://java.sun.com/docs/books/tutorial/ servlets /lifecycle/index.html
Anatomy of a Servlet HTTPServletRequest object Information about an HTTP request Headers Query String Session Cookies HTTPServletResponse object Used for formatting an HTTP response Headers Status codes Cookies
Sample  Servlet   import  java.io.*;  //Apache Tomcat sample code import  javax.servlet.*;  import  javax.servlet.http.*;  public class  HelloWorld  extends  HttpServlet  {   public void  doGet(HttpServletRequest request, HttpServletResponse response)  throws  IOException, ServletException  {  response.setContentType(&quot; text/html &quot;);  PrintWriter out = response.getWriter(); out.println(&quot; <html> &quot;);  out.println(&quot; <body> &quot;);  out.println(&quot; <head> &quot;);  out.println(&quot; <title>Hello World!</title> &quot;);  out.println(&quot; </head> &quot;);  out.println(&quot; <body> &quot;);  out.println(&quot; <h1>Hello World!</h1> &quot;);  out.println(&quot; </body> &quot;);  out.println(&quot; </html> &quot;);  }   }
JSP – JavaServer Pages JavaServer Pages technology uses XML-like tags and scriptlets written in the Java programming language to encapsulate the logic that generates the content for the page.  Any and all formatting (HTML or XML) tags are passed directly back to the response page.  By separating the page logic from its design and display and supporting a reusable component-based design, JSP technology makes it faster and easier than ever to build web-based applications. http://java.sun.com/products/jsp/index.html
Sample JSP <html> <!- Apache Tomcat Samples -> <!--  Copyright (c) 1999 The Apache Software Foundation.  All rights reserved.--> <body bgcolor=&quot;white&quot;> <jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type=&quot;dates.JspCalendar&quot; /> <font size=4><ul> <li> Day of month: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;dayOfMonth&quot;/> <li> Year: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;year&quot;/> <li> Month: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;month&quot;/> <li> Time: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;time&quot;/> <li> Date: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;date&quot;/> <li> Day: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;day&quot;/> <li> Day Of Year: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;dayOfYear&quot;/> <li> Week Of Year: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;weekOfYear&quot;/> <li> era: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;era&quot;/> <li> DST Offset: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;DSTOffset&quot;/> <li> Zone Offset: is  <jsp:getProperty name=&quot;clock&quot; property=&quot;zoneOffset&quot;/> </ul> </font> </body> </html>
EJB – Enterprise Java Beans Enterprise JavaBeans TM  is the server-side component architecture for the  J2EE TM  platform .  EJB TM  enables rapid and simplified development of distributed, transactional, secure and portable Java applications.  Current Specification: 2.0 – 4/16/2001 http://java.sun.com/products/ejb/index.html
EJB – Enterprise Java Beans Enterprise Java Beans are components that are deployed into containers The container provides services Loading / Initialization Transactions Persistence Communication with EJB clients Enterprise Naming Context (JNDI name space)
Anatomy of an EJB Remote Interface Methods that can be accessed by the outside world. Extends javax.ejb.EJBObject Remote Home Interface Life-cycle methods (create, findByPrimaryKey) Extends javax.ejb.EJBHome which extends java.rmi.Remote Bean class The class performing the actual business process Implements an interface based on type of bean
Anatomy of an EJB EJB 2.0 New Interfaces New Interfaces allow bean to bean method calls within the same container Local Interface Similar to the remote interface, but without RMI Extends javax.ejb.EJBLocalObject Local Home Interface Similar to the remote home interface, but without RMI Extends javax.ejb.EJBLocalHome
Client / EJB Relationship How does a client application (Java class) utilize EJBs? Lookup  - JNDI ENC Network protocol - RMI EJB container creates object with RemoteHome and Home interfaces – this object passes calls to the bean class
EJB – Enterprise Java Beans Entity Beans  Session Beans  Message Beans New in EJB 2.0
EJB – Entity Beans Entity beans are classes that map to individual entities – typically, an Entity bean references a row in a database table, providing an object representation of that database object. For example, an entity bean could represent a customer, and changing the values in that entity bean would cause updates to that database row Entity beans provide an abstraction layer so that working with the entity is not specific to the storage mechanism for that entity.
Entity Beans - Persistence Container Managed Persistence (CMP) The EJB container automatically persists the EJB objects, usually to a relational database where each type of object is represented as a table, and each instance of the object is a row in that table Bean Managed Persistence (BMP) The EJB container calls bean methods when it is appropriate for the bean to load, save or update data, enforcing transactions without transaction code written by the bean developer
EJB – Session Beans Session beans perform work for a client application For example, a session bean could charge a credit card for a specific transaction.
Session Beans – State Stateful – A stateful bean maintains a conversational state with a client. The client perceives that it is only talking to one bean, and that bean maintains information between calls Stateless – A stateless bean maintains no client information between method calls – the container can substitute beans as necessary between method calls
EJB – Session Bean Example package org.jboss.docs.interest; import javax.ejb.EJBObject; import java.rmi.RemoteException; /** This interface defines the `Remote' interface for the `Interest' EJB. Its single method is the only method exposed to the outside world. The class InterestBean implements the method. */  public interface Interest extends EJBObject  {  /** Calculates the compound interest on the sum `principle', with interest rate per period `rate' over `periods' time periods. This method also prints a message to standard output; this is picked up by the EJB server and logged. In this way we can demonstrate that the method is actually being executed on the server, rather than the client. */  public double calculateCompoundInterest(double principle, double rate, double periods) throws RemoteException;  }
EJB – Session Bean Example package org.jboss.docs.interest;  import java.io.Serializable;  import java.rmi.RemoteException;  import javax.ejb.CreateException;  import javax.ejb.EJBHome;  /** This interface defines the 'home' interface for the 'Interest' EJB. */  public interface InterestHome extends EJBHome  {   /** Creates an instance of the `InterestBean' class on the server, and returns a remote reference to an Interest interface on the client. */  Interest create() throws RemoteException, CreateException;  }
EJB – Session Bean Example package org.jboss.docs.interest;  import java.rmi.RemoteException;  import javax.ejb.SessionBean;  import javax.ejb.SessionContext;  /** This class contains the implementation for the 'calculateCompoundInterest' method exposed by this Bean. It includes empty method bodies for the methods prescribe by the SessionBean interface; these don't need to do anything in this simple example. */  public class InterestBean implements SessionBean  {  public double calculateCompoundInterest(double principle, double rate, double periods) {   System.out.println(&quot;Someone called `calculateCompoundInterest!'&quot;);    return principle * Math.pow(1+rate, periods) - principle;  }  public void ejbCreate() {}  public void ejbPostCreate() {}  public void ejbRemove() {}  public void ejbActivate() {}  public void ejbPassivate() {}  public void setSessionContext(SessionContext sc) {}  }
EJB – Session Bean Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <ejb-jar>      <description>JBoss Interest Sample Application</description>      <display-name>Interest EJB</display-name>      <enterprise-beans>        <session>          <ejb-name>Interest</ejb-name>          <home>org.jboss.docs.interest.InterestHome</home>          <remote>org.jboss.docs.interest.Interest</remote>          <ejb-class>org.jboss.docs.interest.InterestBean</ejb-class>          <session-type>Stateless</session-type>          <transaction-type>Bean</transaction-type>        </session>      </enterprise-beans> </ejb-jar>
EJB – Session Bean Example package org.jboss.docs.interest; import javax.naming.InitialContext;  import javax.rmi.PortableRemoteObject;  class InterestClient  {   /** This method does all the work. It creates an instance of the Interest EJB on the EJB server, and calls its `calculateCompoundInterest()' method, then prints the result of the calculation. */  public static void main(String[] args)  {  try {    InitialContext jndiContext = new InitialContext();    ref = jndiContext.lookup(&quot;interest/Interest&quot;);    InterestHome home = (InterestHome) PortableRemoteObject.narrow(ref, InterestHome.class);  Interest interest = home.create();  //Create an Interest object from the Home interface    System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2));    }  catch(Exception e)    {    System.out.println(e.toString());    }   } }
EJB – Message Beans Message beans are classes that receive asynchronous notification from a Java Message Service server For example, a message bean could be activated when vendor sends a purchase order to a JMS queue.
JMS – Java Message Service Enterprise messaging provides a reliable, flexible service for the asynchronous exchange of critical business data and events throughout an enterprise. The JMS API adds to this a common API and provider framework that enables the development of portable, message based applications in the Java programming language. http://java.sun.com/products/jms/index.html
JMS – Java Message Service JMS Queue JMS Topic
JMS – Java Message Service The JMS API in the J2EE 1.3 platform has the following new features:  A new kind of enterprise bean, the message-driven bean, enables the asynchronous consumption of messages. Message sends and receives can participate in  Java Transaction API (JTA)  transactions. http://java.sun.com/products/jms/index.html
JMS – Java Message Service Why should I use JMS? Loosely-coupled systems Connectionless Removes dependence on client and server platform / programming language / version  Publish / Subscribe metaphor Send / receive information with many, unknown clients Integration with other messaging systems IBM MQ-Series Microsoft Message Queue http://java.sun.com/products/jms/index.html
JDBC – Data Access API JDBC TM  technology is an API that lets you access virtually any tabular data source from the Java TM  programming language.  Cross-DBMS connectivity to a wide range of SQL databases Access to other tabular data sources, such as spreadsheets or flat files.  http://java.sun.com/products/jdbc/index.html
JDBC – Driver Types Level 1 - A  JDBC-ODBC bridge  provides JDBC API access via one or more ODBC drivers. Level 2 - A  native-API partly Java technology-enabled driver  converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Level 3 - A  net-protocol fully Java technology-enabled driver  translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. Level 4 - A  native-protocol fully Java technology-enabled driver  converts JDBC technology calls into the network protocol used by DBMSs directly.  http://java.sun.com/products/ jdbc / driverdesc .html
JNDI – Java Naming and Directory Interface JNDI is an API specified in Java tm  that provides naming and directory functionality to applications written in Java. It is designed especially for Java by using Java's object model.  Using JNDI, Java applications can store and retrieve named Java objects of any type.  JNDI provides methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes.  JNDI allows Java applications to take advantage of information in a variety of existing naming and directory services, such as LDAP, NDS, DNS, and NIS(YP), and allows Java applications to coexist with legacy applications and systems.  http://java.sun.com/products/ jndi /overview.html
JNDI - Layers
JNDI – Common Uses JNDI ENC – “enterprise naming context” EJB lookup within a J2EE app server LDAP integration Dynamic registration of services and clients Peer to Peer computing
JNDI – Session Bean Example package org.jboss.docs.interest; import javax.naming.InitialContext;  import javax.rmi.PortableRemoteObject;  class InterestClient  {   /** This method does all the work. It creates an instance of the Interest EJB on the EJB server, and calls its `calculateCompoundInterest()' method, then prints the result of the calculation. */  public static void main(String[] args)  {  try {    InitialContext jndiContext = new InitialContext();    ref = jndiContext.lookup(&quot;interest/Interest&quot;);     InterestHome home = (InterestHome) PortableRemoteObject.narrow(ref, InterestHome.class);  Interest interest = home.create();  //Create an Interest object from the Home interface    System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2));    }  catch(Exception e)    {    System.out.println(e.toString());    }   } }
JTA / JTS – Transactions The Java Transaction API (JTA) and the Java Transaction Service (JTS) allow J2EE application servers to take the burden of transaction management off of the component developer.  Developers can define the transactional properties of Enterprise JavaBeans TM  technology based components during design or deployment using declarative statements in the deployment descriptor. The application server takes over the transaction management responsibilities.  http://java.sun.com/j2ee/transactions.html
JavaMail The JavaMail TM  1.2 API provides a set of abstract classes that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology-based mail and messaging applications.  J2EE contains JAF – JavaBeans Activation Framework since it is required by JavaMail Supports common mail protocols IMAP POP SMTP MIME http://java.sun.com/products/ javamail /index.html
JAAS – Java Authentication and Authorization Service Authentication  of users, to reliably and securely determine who is currently executing Java code, regardless of whether the code is running as an application, an applet, a bean, or a servlet; and  A uthorization  of users to ensure they have the access control rights (permissions) required to do the actions performed.  Sample authentication modules using:  Java TM  Naming and Directory Interface (JNDI)  Unix Operating Environment  Windows NT  Kerberos  Keystore  http://java.sun.com/products/ jaas /index.html                  
XML J2EE 1.3 includes JAXP 1.1 support, as well as Servlet Filters and XML JSP TM  documents.  The Java TM  API for XML Processing (&quot;JAXP&quot;) supports processing of XML documents using DOM, SAX, and XSLT. The portability and extensibility of both XML and Java make them the ideal choice for the flexibility and wide availability requirements of this new web. http://java.sun.com/ xml /index.html http://java.sun.com/ xml / jaxp /index.html
J2EE Connectors The J2EE Connector architecture defines a standard architecture for connecting the J2EE platform to heterogeneous EISs (Enterprise Information Systems). Examples of EISs include ERP, mainframe transaction processing, database systems, and legacy applications not written in the Java programming language.  http://java.sun.com/j2ee/connector/index.html
J2EE Applications http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Oveview3.html
J2EE Deployment JAR – Java ARchive Java class file EJBs WAR - Web ARchive Servlets JSPs EAR - Enterprise ARchive Contains other JARs and WARs to form an entire application Deployment descriptors XML Required for EJB JARs, WARs, EARs
J2EE Servers Application Server As of Sept ’01 - MetaGroup Survey by sales $$ BEA Weblogic - 37% IBM Websphere – 22% Oracle – 11% Iplanet – 5% Other- 12% Open-source  Jboss –  www.jboss.org Sun’s listing of J2EE compatible servers -  http://java.sun.com/j2ee/compatibility.html
J2EE Servers Servlet / JSP Servers Most of the commercial application servers also include servlet / JSP support Open-Source Apache Tomcat Jetty Sun’s listing of servlet / JSP servers -  http://java.sun.com/products/ servlet /industry.html
J2EE Development Tools Major IDEs support J2EE in some form Wizards for EJB / Servlets Custom editors for JSP Deployment descriptor support Deployment support for application servers Embedded servers for testing within IDE
Learning more… Enterprise JavaBeans – 3 rd  Edition Richard Monson-Haefel O’Reilly © 2001 JBoss documentation http://www.jboss.org/online-manual/HTML/index.html Designing Enterprise Applications with the Java 2 Platform, Enterprise Edition Nicholas Kassem and the Enterprise Team Addison Wesley © 2000 Core Servlets and JavaServer Pages (JSP) Marty Hall Prentice Hall © 2000
Learning more… J2EE Tutorial -  http://java.sun.com/j2ee/tutorial/1_3- fcs J2EE Developers Guide -  http://java.sun.com/j2ee/ sdk _1.2.1/ techdocs /guides/ ejb /html/ DevGuideTOC .html JNDI  -  http://java.sun.com/products/ jndi /tutorial/ JMS -  http://java.sun.com/products/jms/tutorial/ JDBC -  http://java.sun.com/docs/books/tutorial/ jdbc Servlets -  http://java.sun.com/docs/books/tutorial/ servlets JSP -  http://java.sun.com/products/ jsp /docs.html JAXP -  http://java.sun.com/ xml / jaxp /dist/1.1/docs/tutorial
Ad

More Related Content

What's hot (20)

Servlets lecture1
Servlets lecture1Servlets lecture1
Servlets lecture1
Tata Consultancy Services
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
patinijava
 
Java Servlets & JSP
Java Servlets & JSPJava Servlets & JSP
Java Servlets & JSP
Manjunatha RK
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
John Lewis
 
Java server pages
Java server pagesJava server pages
Java server pages
Tanmoy Barman
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
sunniboy
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
BG Java EE Course
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
Nitin Pai
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
Ankit Minocha
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
BG Java EE Course
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
BG Java EE Course
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010
arif44
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
Sasidhar Kothuru
 
JDBC in Servlets
JDBC in ServletsJDBC in Servlets
JDBC in Servlets
Eleonora Ciceri
 
JDBC
JDBCJDBC
JDBC
Manjunatha RK
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
Markus Eisele
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
John Lewis
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
sunniboy
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
BG Java EE Course
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
Nitin Pai
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
Ankit Minocha
 
Web Applications and Deployment
Web Applications and DeploymentWeb Applications and Deployment
Web Applications and Deployment
BG Java EE Course
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Java/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBCJava/Servlet/JSP/JDBC
Java/Servlet/JSP/JDBC
FAKHRUN NISHA
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010
arif44
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
Markus Eisele
 

Viewers also liked (17)

Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
How To Approach Stock Trading
How To Approach Stock TradingHow To Approach Stock Trading
How To Approach Stock Trading
SSShuk
 
Introduction to TA
Introduction to TAIntroduction to TA
Introduction to TA
fallond
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginners
Clement Levallois
 
Wave Rider Trading Records - PDF
Wave Rider Trading Records - PDFWave Rider Trading Records - PDF
Wave Rider Trading Records - PDF
Pragasit Thitaram
 
Designing an Investment Portfolio
Designing an Investment PortfolioDesigning an Investment Portfolio
Designing an Investment Portfolio
InvestingTips
 
How to we construct your investment portfolio?
How to we construct your investment portfolio?How to we construct your investment portfolio?
How to we construct your investment portfolio?
vikasmunoth
 
Option Spreads
Option SpreadsOption Spreads
Option Spreads
boblawson
 
Combining fundamental and technical analysis to increase trading profits
Combining fundamental and technical analysis to increase trading profitsCombining fundamental and technical analysis to increase trading profits
Combining fundamental and technical analysis to increase trading profits
Dan Oconnor
 
Diversify Your Investment Portfolio
Diversify Your Investment PortfolioDiversify Your Investment Portfolio
Diversify Your Investment Portfolio
InvestingTips
 
Trading Strategies
Trading StrategiesTrading Strategies
Trading Strategies
InvestingTips
 
Trading Profit And Loss CMD
Trading Profit And Loss CMDTrading Profit And Loss CMD
Trading Profit And Loss CMD
knoxbusiness
 
Functional Areas of Business
Functional Areas of BusinessFunctional Areas of Business
Functional Areas of Business
Dani-Kaye Golding
 
Functional areas of business
Functional areas of businessFunctional areas of business
Functional areas of business
Eqbal Habibi
 
Trading Profit And Loss Account
Trading Profit And Loss AccountTrading Profit And Loss Account
Trading Profit And Loss Account
Marcus9000
 
Functional Areas of a Business
Functional Areas of a BusinessFunctional Areas of a Business
Functional Areas of a Business
kaerankin
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
How To Approach Stock Trading
How To Approach Stock TradingHow To Approach Stock Trading
How To Approach Stock Trading
SSShuk
 
Introduction to TA
Introduction to TAIntroduction to TA
Introduction to TA
fallond
 
Presentation of programming languages for beginners
Presentation of programming languages for beginnersPresentation of programming languages for beginners
Presentation of programming languages for beginners
Clement Levallois
 
Wave Rider Trading Records - PDF
Wave Rider Trading Records - PDFWave Rider Trading Records - PDF
Wave Rider Trading Records - PDF
Pragasit Thitaram
 
Designing an Investment Portfolio
Designing an Investment PortfolioDesigning an Investment Portfolio
Designing an Investment Portfolio
InvestingTips
 
How to we construct your investment portfolio?
How to we construct your investment portfolio?How to we construct your investment portfolio?
How to we construct your investment portfolio?
vikasmunoth
 
Option Spreads
Option SpreadsOption Spreads
Option Spreads
boblawson
 
Combining fundamental and technical analysis to increase trading profits
Combining fundamental and technical analysis to increase trading profitsCombining fundamental and technical analysis to increase trading profits
Combining fundamental and technical analysis to increase trading profits
Dan Oconnor
 
Diversify Your Investment Portfolio
Diversify Your Investment PortfolioDiversify Your Investment Portfolio
Diversify Your Investment Portfolio
InvestingTips
 
Trading Profit And Loss CMD
Trading Profit And Loss CMDTrading Profit And Loss CMD
Trading Profit And Loss CMD
knoxbusiness
 
Functional Areas of Business
Functional Areas of BusinessFunctional Areas of Business
Functional Areas of Business
Dani-Kaye Golding
 
Functional areas of business
Functional areas of businessFunctional areas of business
Functional areas of business
Eqbal Habibi
 
Trading Profit And Loss Account
Trading Profit And Loss AccountTrading Profit And Loss Account
Trading Profit And Loss Account
Marcus9000
 
Functional Areas of a Business
Functional Areas of a BusinessFunctional Areas of a Business
Functional Areas of a Business
kaerankin
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
 
Ad

Similar to J2 Ee Overview (20)

Enterprise Java Beans( E)
Enterprise  Java  Beans( E)Enterprise  Java  Beans( E)
Enterprise Java Beans( E)
vikram singh
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
vikram singh
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2
vikram singh
 
Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2
vikram singh
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
Bill Lyons
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Jsf+ejb 50
Jsf+ejb 50Jsf+ejb 50
Jsf+ejb 50
lullabyte
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
Alassane Diallo
 
Ejb intro
Ejb introEjb intro
Ejb intro
vantinhkhuc
 
Virtual Classroom
Virtual ClassroomVirtual Classroom
Virtual Classroom
chintanshah007
 
Ejb notes
Ejb notesEjb notes
Ejb notes
Mumbai Academisc
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
Antonio Goncalves
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
phanleson
 
15 expression-language
15 expression-language15 expression-language
15 expression-language
snopteck
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
Virtual Nuggets
 
J2EE jsp_01
J2EE jsp_01J2EE jsp_01
J2EE jsp_01
Biswabrata Banerjee
 
Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
Venky Sadasivam
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Introduction to jsf2
Introduction to jsf2Introduction to jsf2
Introduction to jsf2
Rajiv Gupta
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
Skillwise Group
 
Enterprise Java Beans( E)
Enterprise  Java  Beans( E)Enterprise  Java  Beans( E)
Enterprise Java Beans( E)
vikram singh
 
Enterprise java beans(ejb)
Enterprise java beans(ejb)Enterprise java beans(ejb)
Enterprise java beans(ejb)
vikram singh
 
Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2Enterprise java beans(ejb) update 2
Enterprise java beans(ejb) update 2
vikram singh
 
Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2Enterprise java beans(ejb) Update 2
Enterprise java beans(ejb) Update 2
vikram singh
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
Bill Lyons
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Real world java_ee_patterns
Real world java_ee_patternsReal world java_ee_patterns
Real world java_ee_patterns
Alassane Diallo
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
phanleson
 
15 expression-language
15 expression-language15 expression-language
15 expression-language
snopteck
 
Free EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggetsFree EJB Tutorial | VirtualNuggets
Free EJB Tutorial | VirtualNuggets
Virtual Nuggets
 
ADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.pptADVANCED JAVA MODULE I & II.ppt
ADVANCED JAVA MODULE I & II.ppt
rani marri
 
Introduction to jsf2
Introduction to jsf2Introduction to jsf2
Introduction to jsf2
Rajiv Gupta
 
Skillwise EJB3.0 training
Skillwise EJB3.0 trainingSkillwise EJB3.0 training
Skillwise EJB3.0 training
Skillwise Group
 
Ad

Recently uploaded (20)

Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 

J2 Ee Overview

  • 1. J2EE Overview Ian Cole Orlando Java User’s Group February 28, 2002
  • 2. Presentation Overview Introduction to J2EE Explain the major technologies within the J2EE designation J2EE applications J2EE servers
  • 3. The Java 2 Platform Platform introduced June, 1999 J2SE – Java 2 Standard Edition Java for the desktop / workstation http://java.sun.com/j2se J2ME – Java 2 Micro Edition Java for the consumer device http://java.sun.com/j2me J2EE - Java 2 Enterprise Edition Java for the server http://java.sun.com/j2ee
  • 4. The Java 2 Platform http://java.sun.com/java2/
  • 5. J2EE Technologies Java Servlets JSP EJB JMS JDBC JNDI JTA / JTS JavaMail JAAS XML …
  • 7. Java Servlets Servlets are the Java platform technology of choice for extending and enhancing web servers. Servlets provide a component-based, platform-independent method for building web-based applications, without the performance limitations of CGI programs. http://java.sun.com/products/servlets/index.html
  • 8. Java Servlets Servlets have access to the entire family of Java APIs, including the JDBC TM API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection http://java.sun.com/products/ servlets /index.html
  • 9. Anatomy of a Servlet init() – the init() function is called when the servlet is initialized by the server. This often happens on the first doGet() or doPut() call of the servlet. destroy() – this function is called when the servlet is being destroyed by the server, typically when the server process is being stopped. http://java.sun.com/docs/books/tutorial/ servlets /lifecycle/index.html
  • 10. Anatomy of a Servlet doGet() – the doGet() function is called when the servlet is called via an HTTP GET. doPost() – the doPost() function is called when the servlet is called via an HTTP POST. POSTs are a good way to get input from HTML forms http://java.sun.com/docs/books/tutorial/ servlets /lifecycle/index.html
  • 11. Anatomy of a Servlet HTTPServletRequest object Information about an HTTP request Headers Query String Session Cookies HTTPServletResponse object Used for formatting an HTTP response Headers Status codes Cookies
  • 12. Sample Servlet import java.io.*; //Apache Tomcat sample code import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType(&quot; text/html &quot;); PrintWriter out = response.getWriter(); out.println(&quot; <html> &quot;); out.println(&quot; <body> &quot;); out.println(&quot; <head> &quot;); out.println(&quot; <title>Hello World!</title> &quot;); out.println(&quot; </head> &quot;); out.println(&quot; <body> &quot;); out.println(&quot; <h1>Hello World!</h1> &quot;); out.println(&quot; </body> &quot;); out.println(&quot; </html> &quot;); } }
  • 13. JSP – JavaServer Pages JavaServer Pages technology uses XML-like tags and scriptlets written in the Java programming language to encapsulate the logic that generates the content for the page. Any and all formatting (HTML or XML) tags are passed directly back to the response page. By separating the page logic from its design and display and supporting a reusable component-based design, JSP technology makes it faster and easier than ever to build web-based applications. http://java.sun.com/products/jsp/index.html
  • 14. Sample JSP <html> <!- Apache Tomcat Samples -> <!-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved.--> <body bgcolor=&quot;white&quot;> <jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type=&quot;dates.JspCalendar&quot; /> <font size=4><ul> <li> Day of month: is <jsp:getProperty name=&quot;clock&quot; property=&quot;dayOfMonth&quot;/> <li> Year: is <jsp:getProperty name=&quot;clock&quot; property=&quot;year&quot;/> <li> Month: is <jsp:getProperty name=&quot;clock&quot; property=&quot;month&quot;/> <li> Time: is <jsp:getProperty name=&quot;clock&quot; property=&quot;time&quot;/> <li> Date: is <jsp:getProperty name=&quot;clock&quot; property=&quot;date&quot;/> <li> Day: is <jsp:getProperty name=&quot;clock&quot; property=&quot;day&quot;/> <li> Day Of Year: is <jsp:getProperty name=&quot;clock&quot; property=&quot;dayOfYear&quot;/> <li> Week Of Year: is <jsp:getProperty name=&quot;clock&quot; property=&quot;weekOfYear&quot;/> <li> era: is <jsp:getProperty name=&quot;clock&quot; property=&quot;era&quot;/> <li> DST Offset: is <jsp:getProperty name=&quot;clock&quot; property=&quot;DSTOffset&quot;/> <li> Zone Offset: is <jsp:getProperty name=&quot;clock&quot; property=&quot;zoneOffset&quot;/> </ul> </font> </body> </html>
  • 15. EJB – Enterprise Java Beans Enterprise JavaBeans TM is the server-side component architecture for the J2EE TM platform . EJB TM enables rapid and simplified development of distributed, transactional, secure and portable Java applications. Current Specification: 2.0 – 4/16/2001 http://java.sun.com/products/ejb/index.html
  • 16. EJB – Enterprise Java Beans Enterprise Java Beans are components that are deployed into containers The container provides services Loading / Initialization Transactions Persistence Communication with EJB clients Enterprise Naming Context (JNDI name space)
  • 17. Anatomy of an EJB Remote Interface Methods that can be accessed by the outside world. Extends javax.ejb.EJBObject Remote Home Interface Life-cycle methods (create, findByPrimaryKey) Extends javax.ejb.EJBHome which extends java.rmi.Remote Bean class The class performing the actual business process Implements an interface based on type of bean
  • 18. Anatomy of an EJB EJB 2.0 New Interfaces New Interfaces allow bean to bean method calls within the same container Local Interface Similar to the remote interface, but without RMI Extends javax.ejb.EJBLocalObject Local Home Interface Similar to the remote home interface, but without RMI Extends javax.ejb.EJBLocalHome
  • 19. Client / EJB Relationship How does a client application (Java class) utilize EJBs? Lookup - JNDI ENC Network protocol - RMI EJB container creates object with RemoteHome and Home interfaces – this object passes calls to the bean class
  • 20. EJB – Enterprise Java Beans Entity Beans Session Beans Message Beans New in EJB 2.0
  • 21. EJB – Entity Beans Entity beans are classes that map to individual entities – typically, an Entity bean references a row in a database table, providing an object representation of that database object. For example, an entity bean could represent a customer, and changing the values in that entity bean would cause updates to that database row Entity beans provide an abstraction layer so that working with the entity is not specific to the storage mechanism for that entity.
  • 22. Entity Beans - Persistence Container Managed Persistence (CMP) The EJB container automatically persists the EJB objects, usually to a relational database where each type of object is represented as a table, and each instance of the object is a row in that table Bean Managed Persistence (BMP) The EJB container calls bean methods when it is appropriate for the bean to load, save or update data, enforcing transactions without transaction code written by the bean developer
  • 23. EJB – Session Beans Session beans perform work for a client application For example, a session bean could charge a credit card for a specific transaction.
  • 24. Session Beans – State Stateful – A stateful bean maintains a conversational state with a client. The client perceives that it is only talking to one bean, and that bean maintains information between calls Stateless – A stateless bean maintains no client information between method calls – the container can substitute beans as necessary between method calls
  • 25. EJB – Session Bean Example package org.jboss.docs.interest; import javax.ejb.EJBObject; import java.rmi.RemoteException; /** This interface defines the `Remote' interface for the `Interest' EJB. Its single method is the only method exposed to the outside world. The class InterestBean implements the method. */ public interface Interest extends EJBObject { /** Calculates the compound interest on the sum `principle', with interest rate per period `rate' over `periods' time periods. This method also prints a message to standard output; this is picked up by the EJB server and logged. In this way we can demonstrate that the method is actually being executed on the server, rather than the client. */ public double calculateCompoundInterest(double principle, double rate, double periods) throws RemoteException; }
  • 26. EJB – Session Bean Example package org.jboss.docs.interest; import java.io.Serializable; import java.rmi.RemoteException; import javax.ejb.CreateException; import javax.ejb.EJBHome; /** This interface defines the 'home' interface for the 'Interest' EJB. */ public interface InterestHome extends EJBHome { /** Creates an instance of the `InterestBean' class on the server, and returns a remote reference to an Interest interface on the client. */ Interest create() throws RemoteException, CreateException; }
  • 27. EJB – Session Bean Example package org.jboss.docs.interest; import java.rmi.RemoteException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; /** This class contains the implementation for the 'calculateCompoundInterest' method exposed by this Bean. It includes empty method bodies for the methods prescribe by the SessionBean interface; these don't need to do anything in this simple example. */ public class InterestBean implements SessionBean { public double calculateCompoundInterest(double principle, double rate, double periods) { System.out.println(&quot;Someone called `calculateCompoundInterest!'&quot;); return principle * Math.pow(1+rate, periods) - principle; } public void ejbCreate() {} public void ejbPostCreate() {} public void ejbRemove() {} public void ejbActivate() {} public void ejbPassivate() {} public void setSessionContext(SessionContext sc) {} }
  • 28. EJB – Session Bean Example <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <ejb-jar>      <description>JBoss Interest Sample Application</description>      <display-name>Interest EJB</display-name>      <enterprise-beans>        <session>          <ejb-name>Interest</ejb-name>          <home>org.jboss.docs.interest.InterestHome</home>          <remote>org.jboss.docs.interest.Interest</remote>          <ejb-class>org.jboss.docs.interest.InterestBean</ejb-class>          <session-type>Stateless</session-type>          <transaction-type>Bean</transaction-type>        </session>      </enterprise-beans> </ejb-jar>
  • 29. EJB – Session Bean Example package org.jboss.docs.interest; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; class InterestClient { /** This method does all the work. It creates an instance of the Interest EJB on the EJB server, and calls its `calculateCompoundInterest()' method, then prints the result of the calculation. */ public static void main(String[] args) { try { InitialContext jndiContext = new InitialContext(); ref = jndiContext.lookup(&quot;interest/Interest&quot;); InterestHome home = (InterestHome) PortableRemoteObject.narrow(ref, InterestHome.class); Interest interest = home.create(); //Create an Interest object from the Home interface System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2)); } catch(Exception e) { System.out.println(e.toString()); } } }
  • 30. EJB – Message Beans Message beans are classes that receive asynchronous notification from a Java Message Service server For example, a message bean could be activated when vendor sends a purchase order to a JMS queue.
  • 31. JMS – Java Message Service Enterprise messaging provides a reliable, flexible service for the asynchronous exchange of critical business data and events throughout an enterprise. The JMS API adds to this a common API and provider framework that enables the development of portable, message based applications in the Java programming language. http://java.sun.com/products/jms/index.html
  • 32. JMS – Java Message Service JMS Queue JMS Topic
  • 33. JMS – Java Message Service The JMS API in the J2EE 1.3 platform has the following new features: A new kind of enterprise bean, the message-driven bean, enables the asynchronous consumption of messages. Message sends and receives can participate in Java Transaction API (JTA) transactions. http://java.sun.com/products/jms/index.html
  • 34. JMS – Java Message Service Why should I use JMS? Loosely-coupled systems Connectionless Removes dependence on client and server platform / programming language / version Publish / Subscribe metaphor Send / receive information with many, unknown clients Integration with other messaging systems IBM MQ-Series Microsoft Message Queue http://java.sun.com/products/jms/index.html
  • 35. JDBC – Data Access API JDBC TM technology is an API that lets you access virtually any tabular data source from the Java TM programming language. Cross-DBMS connectivity to a wide range of SQL databases Access to other tabular data sources, such as spreadsheets or flat files. http://java.sun.com/products/jdbc/index.html
  • 36. JDBC – Driver Types Level 1 - A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Level 2 - A native-API partly Java technology-enabled driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Level 3 - A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. Level 4 - A native-protocol fully Java technology-enabled driver converts JDBC technology calls into the network protocol used by DBMSs directly. http://java.sun.com/products/ jdbc / driverdesc .html
  • 37. JNDI – Java Naming and Directory Interface JNDI is an API specified in Java tm that provides naming and directory functionality to applications written in Java. It is designed especially for Java by using Java's object model. Using JNDI, Java applications can store and retrieve named Java objects of any type. JNDI provides methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. JNDI allows Java applications to take advantage of information in a variety of existing naming and directory services, such as LDAP, NDS, DNS, and NIS(YP), and allows Java applications to coexist with legacy applications and systems. http://java.sun.com/products/ jndi /overview.html
  • 39. JNDI – Common Uses JNDI ENC – “enterprise naming context” EJB lookup within a J2EE app server LDAP integration Dynamic registration of services and clients Peer to Peer computing
  • 40. JNDI – Session Bean Example package org.jboss.docs.interest; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; class InterestClient { /** This method does all the work. It creates an instance of the Interest EJB on the EJB server, and calls its `calculateCompoundInterest()' method, then prints the result of the calculation. */ public static void main(String[] args) { try { InitialContext jndiContext = new InitialContext(); ref = jndiContext.lookup(&quot;interest/Interest&quot;); InterestHome home = (InterestHome) PortableRemoteObject.narrow(ref, InterestHome.class); Interest interest = home.create(); //Create an Interest object from the Home interface System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2)); } catch(Exception e) { System.out.println(e.toString()); } } }
  • 41. JTA / JTS – Transactions The Java Transaction API (JTA) and the Java Transaction Service (JTS) allow J2EE application servers to take the burden of transaction management off of the component developer. Developers can define the transactional properties of Enterprise JavaBeans TM technology based components during design or deployment using declarative statements in the deployment descriptor. The application server takes over the transaction management responsibilities. http://java.sun.com/j2ee/transactions.html
  • 42. JavaMail The JavaMail TM 1.2 API provides a set of abstract classes that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology-based mail and messaging applications. J2EE contains JAF – JavaBeans Activation Framework since it is required by JavaMail Supports common mail protocols IMAP POP SMTP MIME http://java.sun.com/products/ javamail /index.html
  • 43. JAAS – Java Authentication and Authorization Service Authentication of users, to reliably and securely determine who is currently executing Java code, regardless of whether the code is running as an application, an applet, a bean, or a servlet; and A uthorization of users to ensure they have the access control rights (permissions) required to do the actions performed. Sample authentication modules using: Java TM Naming and Directory Interface (JNDI) Unix Operating Environment Windows NT Kerberos Keystore http://java.sun.com/products/ jaas /index.html                  
  • 44. XML J2EE 1.3 includes JAXP 1.1 support, as well as Servlet Filters and XML JSP TM documents. The Java TM API for XML Processing (&quot;JAXP&quot;) supports processing of XML documents using DOM, SAX, and XSLT. The portability and extensibility of both XML and Java make them the ideal choice for the flexibility and wide availability requirements of this new web. http://java.sun.com/ xml /index.html http://java.sun.com/ xml / jaxp /index.html
  • 45. J2EE Connectors The J2EE Connector architecture defines a standard architecture for connecting the J2EE platform to heterogeneous EISs (Enterprise Information Systems). Examples of EISs include ERP, mainframe transaction processing, database systems, and legacy applications not written in the Java programming language. http://java.sun.com/j2ee/connector/index.html
  • 47. J2EE Deployment JAR – Java ARchive Java class file EJBs WAR - Web ARchive Servlets JSPs EAR - Enterprise ARchive Contains other JARs and WARs to form an entire application Deployment descriptors XML Required for EJB JARs, WARs, EARs
  • 48. J2EE Servers Application Server As of Sept ’01 - MetaGroup Survey by sales $$ BEA Weblogic - 37% IBM Websphere – 22% Oracle – 11% Iplanet – 5% Other- 12% Open-source Jboss – www.jboss.org Sun’s listing of J2EE compatible servers - http://java.sun.com/j2ee/compatibility.html
  • 49. J2EE Servers Servlet / JSP Servers Most of the commercial application servers also include servlet / JSP support Open-Source Apache Tomcat Jetty Sun’s listing of servlet / JSP servers - http://java.sun.com/products/ servlet /industry.html
  • 50. J2EE Development Tools Major IDEs support J2EE in some form Wizards for EJB / Servlets Custom editors for JSP Deployment descriptor support Deployment support for application servers Embedded servers for testing within IDE
  • 51. Learning more… Enterprise JavaBeans – 3 rd Edition Richard Monson-Haefel O’Reilly © 2001 JBoss documentation http://www.jboss.org/online-manual/HTML/index.html Designing Enterprise Applications with the Java 2 Platform, Enterprise Edition Nicholas Kassem and the Enterprise Team Addison Wesley © 2000 Core Servlets and JavaServer Pages (JSP) Marty Hall Prentice Hall © 2000
  • 52. Learning more… J2EE Tutorial - http://java.sun.com/j2ee/tutorial/1_3- fcs J2EE Developers Guide - http://java.sun.com/j2ee/ sdk _1.2.1/ techdocs /guides/ ejb /html/ DevGuideTOC .html JNDI - http://java.sun.com/products/ jndi /tutorial/ JMS - http://java.sun.com/products/jms/tutorial/ JDBC - http://java.sun.com/docs/books/tutorial/ jdbc Servlets - http://java.sun.com/docs/books/tutorial/ servlets JSP - http://java.sun.com/products/ jsp /docs.html JAXP - http://java.sun.com/ xml / jaxp /dist/1.1/docs/tutorial