Presentation is loading. Please wait.

Presentation is loading. Please wait.

2 Copyright © 2005, Oracle. All rights reserved. J2EE Overview.

Similar presentations


Presentation on theme: "2 Copyright © 2005, Oracle. All rights reserved. J2EE Overview."— Presentation transcript:

1 2 Copyright © 2005, Oracle. All rights reserved. J2EE Overview

2 2-2 Copyright © 2005, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Describe the Java 2, Enterprise Edition (J2EE) platform Define the various components of J2EE Describe the deployment options for a J2EE application Describe the architecture of Oracle Application Server 10g Containers for J2EE (OC4J) Describe the directory structure and the uses of the configuration files of OC4J

3 2-3 Copyright © 2005, Oracle. All rights reserved. Java 2, Enterprise Edition Platform The Java 2, Enterprise Edition (J2EE) platform is a standard for developing and implementing enterprisewide applications: It provides multitier applications support. It is designed to help improve the process of developing, deploying, and implementing enterprisewide applications.

4 2-4 Copyright © 2005, Oracle. All rights reserved. J2EE Platform Is a multitiered, distributed application model Supports component-based J2EE applications Client tier EJB clients Application Middle tier Web components Servlet JSP Page EJB components Enterprise Beans Web clients EIS tier Browser

5 2-5 Copyright © 2005, Oracle. All rights reserved. Benefits of the J2EE Platform Write once, run anywhere provides simplified component development. Multiple server products and vendors support the J2EE standard, thus giving more deployment choices. Integration with legacy systems through standard APIs is possible. J2EE separates client requirements from business logic. J2EE provides multiple development and design scenarios.

6 2-6 Copyright © 2005, Oracle. All rights reserved. Benefits of the J2EE Platform J2EE separates development tasks into specific skill areas. Web designers can create JSP components. Application behavior is created by Java programmers. Business logic and rules are created by Java programmers and business experts. Assembly and deployment can be assigned to production environment teams.

7 2-7 Copyright © 2005, Oracle. All rights reserved. J2EE Components J2EE is a component-based architecture for the development and deployment of enterprisewide applications. A component is an application-level software unit. Components can be easily updated as business needs change. Components are reusable. There are several types of components: –Client-side components –Web components –Business-tier components

8 2-8 Copyright © 2005, Oracle. All rights reserved. J2EE 1.3 Components The J2EE 1.3 Specification lists the following components: Servlet 2.3 JavaServer Pages 1.2 Enterprise JavaBeans 2.0 JDBC 2.0 RMI-IIOP JNDI 1.2 Web services 1.1 Java Message Service 1.0.2 Java Transaction API 1.0 Java Authentication and Authorization Service 1.0 J2EE Connector Architecture 1.0 SOAP with Attachments API for Java 1.1

9 2-9 Copyright © 2005, Oracle. All rights reserved. J2EE Architecture Client Machine J2EE Server Business container EJB Java Servlet/JSP Web Container EJB APIs Browser Application Client Container Application Client Database JNDI RMIJDBC JTA JAF JMS JavaMail

10 2-10 Copyright © 2005, Oracle. All rights reserved. Client-Tier Components A Web browser: –Is used for a Web-based J2EE application –Downloads static or dynamic Web pages from Web- tier components –Is a thin client An application client: –Is used for a non-browser-based J2EE application –Executes on the client machine –Can contain a graphical or command-line interface –Is a thick client –Accesses business-tier components or a servlet on the Web tier

11 2-11 Copyright © 2005, Oracle. All rights reserved. J2EE Web-Tier Components A Web tier may consist of: –Java servlets –JSPs Servlets and JSPs: –Work on a request-response model –Generate HTML dynamically –Access the database through JDBC –Access the business-tier components –Handle user-centric events, such as an HREF link or form submission –Usually generate visual interfaces such as a Web page

12 2-12 Copyright © 2005, Oracle. All rights reserved.

13 2-13 Copyright © 2005, Oracle. All rights reserved. Client info (host name, form data) Success or failure Process results (access database) Format results and produce HTML Send page back to client Browser Servlet What Is a Servlet? Request Response

14 2-14 Copyright © 2005, Oracle. All rights reserved. What Is a JavaServer Page (JSP)? A JSP: Is a text-based document that includes: – HTML –JSP tags –Java code (including calls to JavaBeans and servlets) Cleanly separates content creation from presentation logic Focuses on rapid development and easy modification of the user interface Provides presentation-centric method of developing servlets

15 2-15 Copyright © 2005, Oracle. All rights reserved. Web-Tier Components: Summary Web-tier components generate dynamic content. Servlets: –Extend Web server functionality –Are designed more for processing than for presentation JSPs: –Combine HTML (or other markup) and Java –Are designed to separate content creation from presentation logic –Are precompiled and converted to servlets at run time

16 2-16 Copyright © 2005, Oracle. All rights reserved. Business-Tier Components Business-tier components: Are EJBs Handle business logic Receive data from client programs Retrieve data from database storage Process the data and communicate with the database and the client program Can be invoked by the Web-tier components

17 2-17 Copyright © 2005, Oracle. All rights reserved. Enterprise JavaBeans (EJB) Enterprise JavaBeans: Are server-side components written in Java Contain the business logic of an enterprise application Are hosted in EJB containers Are based on Remote Method Invocation (RMI) communication Are platform independent Provide remote services for clients Can be exposed as Web services Use JDBC to connect to a database

18 2-18 Copyright © 2005, Oracle. All rights reserved. J2EE Communication APIs J2EE provides component communication through APIs. The APIs include: –RMI –JNDI –JDBC These APIs facilitate communication between the J2EE components.

19 2-19 Copyright © 2005, Oracle. All rights reserved. J2EE Server The J2EE server provides: Containers for each component type of a J2EE application System-level services to components: –Naming and directory services (JNDI) –Security services for Web components and EJBs (JAAS) –Transaction architecture (JTA) –Remote client connectivity: – Enterprise beans (RMI/IIOP, ORMI) – Servlet/JSP (HTTP, HTTPS, FTP)

20 2-20 Copyright © 2005, Oracle. All rights reserved.

21 2-21 Copyright © 2005, Oracle. All rights reserved. Oracle Application Server 10g Containers for J2EE (OC4J) OC4J is the J2EE server implementation in Oracle Application Server 10g Key features: –Implements J2EE 1.3 Specification –Runs on standard JVM –Provides high performance and scalability –Is productive for developers to use –Is simple to manage and deploy –Provides clustering for high availability and failover

22 2-22 Copyright © 2005, Oracle. All rights reserved. J2EE Applications J2EE applications consist of J2EE components and are deployed in the form of modules: Web modules contain the user interface: HTML, JSP, and servlets. EJB modules contain reusable EJB components. Client modules provide access to remote application code. Packaging information identifies dependencies between modules.

23 2-23 Copyright © 2005, Oracle. All rights reserved. Packaging J2EE Application Components 1. ejb.jar Bean class, Home and Remote interfaces, other supported files, DD 2. webtier.war Java servlets, JSP files, HTML, GIF files, DD (references to EJBs) 3. J2EEappClient.jar J2EE application client (Java class), DD (references to EJBs) 4. DD for J2EE application (.xml ) DD = XML Deployment Descriptor 5. Resource adapter (.rar ) J2EEapplication.ear

24 2-24 Copyright © 2005, Oracle. All rights reserved. JARs Are simple Java Archive files Are used to package application files together (for example, classes, images, and so on) Can be included in Web Archives (WARs) and Enterprise Archives (EARs) Can be included in library paths

25 2-25 Copyright © 2005, Oracle. All rights reserved. WARs Are specialized archives for packaging J2EE-compliant Web applications Have a fixed directory structure Have a deployment descriptor for the Web application lib Contain servlet code and JavaBeans not in standard JAR files Contains required classes that are packaged in standard JAR files classes WEB-INF web.xml index.html welcome.jsp

26 2-26 Copyright © 2005, Oracle. All rights reserved. EJB JARs Are specialized JARs for packaging EJBs Have a fixed directory structure Have a deployment descriptor for the EJB components EJB Classes Contain the class files for the EJBs, usually in a package directory structure Remote, Home and Bean classes ejb-jar.xml myEJB META-INF

27 2-27 Copyright © 2005, Oracle. All rights reserved. EARs The EAR files: Are specialized archives for packaging J2EE-compliant enterprise applications for deployment Have a deployment descriptor May have Web modules May have EJB modules May have client modules

28 2-28 Copyright © 2005, Oracle. All rights reserved. EAR File Structure for a J2EE Application: Example |-------META-INF | |-------application.xml |------- | |-------EJB classes | |-------META-INF | |-------ejb-jar.xml |------- | |-------index.html | |-------JSP pages | |-------WEB-INF | |----web.xml | |----classes | |-------Servlet classes |------- | |-------Client classes | |-------META-INF | |-------application-client.xml

29 2-29 Copyright © 2005, Oracle. All rights reserved. OC4J Architecture Web container JNDI JMS EJB container AJP13 ORMI JDBC JTA JavaMail JAF mod_oc4j Client EJB client Oracle HTTP Server ORMI AJP HTTP OC4J server process JAAS JCA

30 2-30 Copyright © 2005, Oracle. All rights reserved. OC4J Server Configuration Files OC4J Server XML Files Web site Server Configuration jazn.xml * Web site default-web- site.xml Oracle HTTP Server configuration files mod_oc4j.conf jazn-data.xml * server.xml data-sources.xml rmi.xml jms.xml

31 2-31 Copyright © 2005, Oracle. All rights reserved. Relation of Configuration Files webapp1.war When an application is deployed, an entry is made in the \config\server.xml file: For each Web module within the application, a context root is defined in \config\default-web-site.xml : The modules of the application are defined in \ applications\lesson02\META- INF\application.xml :

32 2-32 Copyright © 2005, Oracle. All rights reserved. Data Sources A data source is the instantiation of an object that implements the javax.sql.DataSource interface, which enables you to retrieve a connection to a database server. OC4J data sources are defined in data- sources.xml. J2EE applications use JNDI to look up these DataSource objects.

33 2-33 Copyright © 2005, Oracle. All rights reserved. Application Logging Application logging in Oracle Application Server 10g is configured by specifying the location of a log file in the application.xml file: To create a log file formatted in XML, use Oracle Diagnostic Logging (ODL):

34 2-34 Copyright © 2005, Oracle. All rights reserved. J2EE Application Deployment to Oracle Application Server 10g Deploying to OC4J can be done in multiple ways: Step 2: Deploy Use JDeveloper – specify an Application Server and click 'Deploy' Step 1: Create WAR, EAR file Step 2: Deploy Use a command- line tool (such as ANT). Use JDeveloper. Use Oracle Enterprise Manager (installed with Oracle Application Server 10g): Access the Enterprise Manager Web site http://localhost:1810 (requires login). Use JDeveloper: Specify an application server and click Deploy.

35 2-35 Copyright © 2005, Oracle. All rights reserved. Oracle Enterprise Manager localhost

36 2-36 Copyright © 2005, Oracle. All rights reserved. JDeveloper and J2EE JDeveloper provides: Integrated development, deployment, and testing support for Web-tier and business-tier components A J2EE framework for rapid development –Application Development Framework (ADF) business components –Data tags Integration with Struts UML modeling Visual editors for Web clients Easy deployment to Oracle Application Server 10g JDeveloper

37 2-37 Copyright © 2005, Oracle. All rights reserved. Oracle JDeveloper 10g Environment Wizards for JSPs, servlets, and EJBs Error checking for HTML and JSP Code insight EAR, WAR deployment to J2EE server Customizable code editor

38 2-38 Copyright © 2005, Oracle. All rights reserved. Oracle JDeveloper 10g Visual Design Tools Drag JSP and HTML elements Modify values in property inspector Design in visual or code views

39 2-39 Copyright © 2005, Oracle. All rights reserved. Summary In this lesson, you should have learned that: J2EE is a set of Java technologies that support end-to-end application development Components are the foundation of the J2EE architecture Web components (servlets, JSPs) generate dynamic content Business components (EJBs) are server-side components that contain business logic Applications can be built by using Oracle JDeveloper 10g and deployed to a J2EE server, such as Oracle Application Server 10g

40 2-40 Copyright © 2005, Oracle. All rights reserved. Practice 2-1: Overview This practice covers the following topics: Navigating to the OC4J console by using Oracle Enterprise Manager Mapping a data source in OC4J Restarting the OC4J server instance from Oracle Enterprise Manager Deploying an EAR file by using Oracle Enterprise Manager

41 2-41 Copyright © 2005, Oracle. All rights reserved.

42 2-42 Copyright © 2005, Oracle. All rights reserved.


Download ppt "2 Copyright © 2005, Oracle. All rights reserved. J2EE Overview."

Similar presentations


Ads by Google