J2EE Structure & Definitions Catie Welsh CSE 432

Slides:



Advertisements
Similar presentations
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Lecture plan Information retrieval (from week 11)
Apache Struts Technology
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
An architecture for webb applications, J2EE
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
Servlets and a little bit of Web Services Russell Beale.
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
EJB Design. Server-side components Perform –complex algorithms –high volume transactions Run in –highly available environment (365 days/year) –fault tolerant.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Time Scalability Single User Unlimited Users 100s of Users Several Users PC based Single user Late 1980sNow PC based, file-level locking Single user or.
Java 2 – Enterprise Edition Kevin J. LaFata April 21, 2003 UM – St. Louis.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
CS 483 Enterprise and Web Application Programming
Apache Struts Technology A MVC Framework for Java Web Applications.
M.Sc. Course, Dept. of Informatics and Telecommunications, University of Athens S.Hadjiefthymiades “Web Application Servers” Basics on WAS WAS are necessary.
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Java Server Pages B.Ramamurthy. Topics for Discussion 8/20/20152 Inheritance and Polymorphism Develop an example for inheritance and polymorphism JSP.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
11. Java-Based Web: JSP, JSF. 2 Motto: Rule 1: Our client is always right Rule 2: If you think our client is wrong, see Rule 1. - Anonymous.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
1 J2EE Components. 2 Application Servers relieve the programming burden for business distributed components. They provide support for system level services.
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Introduction to distributed systems Dr. S. Indran 23 January 2004.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Introduction to J2EE Architecture Portions by Kunal Mehta.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
第十四章 J2EE 入门 Introduction What is J2EE ?
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
1 Java EE Programming Enterprise JavaBeans. 2 Topics J2EE Overview Enterprise JavaBeans Overview Enterprise Entity Beans Case Study How to build them.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
J2EE Chris Hundersmarck Maria Baron Jeff Webb.  Java 2 Platform, Micro Edition (J2ME)  Java 2 Platform, Standard Edition (J2SE)  Java 2 Platform, Enterprise.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Servlets and Java Server Pages
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Java Beans N.V.RAJASEKHAR REDDY. Definition of EJB EJBs are the components that are the set of classes and interfaces deployed within a container.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
EJB Enterprise Java Beans JAVA Enterprise Edition
Apache Struts Technology A MVC Framework for Java Web Applications.
©NIIT Session Beans Lesson 1B/ Slide 1 of 37J2EE Server Components Objectives In this lesson, you will learn to: Describe the characteristics of session.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Introduction to J2EE Architecture
Introduction to Enterprise JavaBean
Distributed System Using Java 2 Enterprise Edition (J2EE)
Understanding and Designing with EJB
Understanding and Designing with EJB
Enterprise Java Beans.
Intro to J2EE Concepts.
Presentation transcript:

J2EE Structure & Definitions Catie Welsh CSE

J2EE Breakdown Web Clients – contain 2 parts – Dynamic Web pages containing HTML, XML – Web browser, which renders the pages received from the server. Web Components – servlets or pages created using JSP technology Business Components – EJBs – Retrieves data from storage(database), processes it, and sends it back to the client program.

J2EE Servlets, JSP pages, filters, and web event listeners typically execute in a web container and may respond to HTTP requests from web clients. Servlets, JSP pages, and filters may be used to generate HTML pages that are an application’s user interface. They may also be used to generate XML or other format data that is consumed by other application components. A special kind of servlet provides support for web services using the SOAP/HTTP protocol. Servlets, pages created with the JavaServer Pages™ technology, web filters, and web event listeners are referred to collectively in this specification as “web components.” Web applications are composed of web components and other data such as HTML pages. Web components execute in a web container. A web server includes a web container and other protocol support, security support, and so on, as required by J2EE specifications. Enterprise JavaBeans™ (EJB) components execute in a managed environment that supports transactions. Enterprise beans typically contain the business logic for a J2EE application. Enterprise beans may directly provide web services using the SOAP/HTTP protocol.

J2EE Structure Diagram

Types of J2EE Modules EJB modules – contain the class files for enterprise beans and an EJB deployment descriptor. EJB modules are packaged as JAR files with a.jar extension. Web modules – contains servlet class files, JSP files, supporting class files, GIF and HTML files and a Web application deployment descriptor. Web modules are packaged as JAR files with a.war (Web archive) extension.

JSP JSP ’ s are executed server-side. Don ’ t get confused and think the code is executing client side in the browser. There is a two step compilation process. – Step 1- the commingled jsp/html code is translated to a Java Servlet – Step 2 - it is compiled like any other Java class and (re)deployed in the application server

JSP Example Code <% boolean loginOK = false; String login_id = request.getParameter("login_id"); login_id = login_id.toLowerCase(); String password = request.getParameter("password"); loginOK = loginBean.loginCheck(login_id, password); if(loginOK){ //do something } %>

Serializable Objects RMI used for EJB's and JSP's/Java files to communicate with EJB's EJB's can transfer complex objects over a network connection, object must be type that can be written as binary information (static data) Ex. ArrayList, String, HashMap Ex. of Non-Serializable objects: Database connection, reference to other EJB's, graphical widgets (Calendar), ResultSet

EJBs An EJB is essentially a managed component that is created, controlled, and destroyed by the J2EE container in which it lives. When an EJB instance is no longer needed, it is returned to the pool and its resources are released. When it is needed, it is assigned to a client. The client that uses the EJB instance does not need to know about all of this work by the container. As far as the client is concerned, it is talking to a remote component that supports defined business methods.

EJB Servers The EJB server is the base set of services on top of which the container runs. They are usually included in most J2EE- compliant application servers such as WebLogic and WebSphere.

3 Types of EJB’s Session – A Session EJB is useful for mapping business process flow. There are two sub- types of Session EJB: stateless and stateful Message – A Message-driven EJB is very similar in concept to a Session EJB, but is only activated when an asynchronous message arrives. Entity – An Entity EJB maps a combination of data and associated functionality.

Session EJBs A stateless session bean only contains a state for the duration of its invocation. Once the method is finished, the state is no longer maintained. A stateful session bean, the instance variables represent the state of a unique client-bean session. The state is maintained for the duration of the session.

Entity EJBs Entity beans differ from session beans in that they are: – Persistent – Allow shared access – Have primary keys – Participate in relationships with other entity beans Entity beans represent a business entity but not a procedure. – For example, CreditCardBean would be an entity bean, but CreditCardVerifierBean would be a session bean.

Message-driven EJBs The most visible difference between message- driven beans and session and entity beans is that clients do not access message-driven beans through interfaces. Message-driven beans have the following characteristics: – They execute upon receipt of a single client message. – They are invoked asynchronously. – They are relatively short-lived. – They do not represent directly shared data in the database, but they can access and update this data. – They can be transaction-aware. – They are stateless.

Common Uses of EJBs In web-oriented applications, EJBs are used to supply the business logic behind the components, such as servlets and JSPs. Thick-client applications, such as Swing apps, use EJBs similarly, to supply the business logic. Business-to-business e-commerce applications use EJBs since they offer an ideal place to house the business process logic.

Common types of EJBs A servlet or JSP that provides an HTML-based interface for a browser client Another EJB that can delegate certain of its own tasks or can work in combination with other EJBs to achieve its own goals A Java/Swing application that provides a front-end for the business processes encapsulated in the EJB A CORBA application that takes advantage of the EJB's business logic An applet that takes advantage of the business logic in a remote EJB so that this business logic does not need to be downloaded to the client

Advantages of EJBs Hiding complexity – business developers want to write business code, without having to know how all the interactions work Separation of Business Logic from UI and Data Access Container Services – distribution via proxies, lifecycle management, name and registration, transaction management, security and access control, persistence