Date post: | 28-Dec-2015 |
Category: |
Documents |
Upload: | shanon-goodman |
View: | 233 times |
Download: | 1 times |
v012405 J2EE Introduction 2
EnterpriseJava
Objectives
• Understand complexity of enterprise applications
• Understand N-Tier architectures
• Differentiate between Java platforms– J2SE, J2ME, and J2EE
• High-level understanding of J2EE architecture and components
v012405 J2EE Introduction 4
EnterpriseJava
To ComplexFat Client(SWING)
EnterpriseApplication
OrderDatabase
InventoryManagement
CRMSystem
ManagementConsole
BrowserClient
CORBAClient
SOAPClient
RMI
HTTP
SOAP
IIOP
JDBC
SNMP/JMX
Custom
Also: PDAs, Cell, etc.
v012405 J2EE Introduction 5
EnterpriseJava
Enterprise Applications
• Extend their reach, reduce costs, lower response times
• Provide easy access for customers, employees, and suppliers
• Provide services that integrate existing Enterprise Information Systems (EIS) with new business functions– highly available
– Secure
– reliable/scaleable
v012405 J2EE Introduction 6
EnterpriseJava
Enterprise Application Requirements
• Highly Available– Business is being bet on the system in many cases
• Secure– Sensitive systems
– Sometimes ‘anonymous’ clients
• Scalable– Unpredictable system loads
• Wide variety of systems, platforms, languages, and APIs to integrate
v012405 J2EE Introduction 7
EnterpriseJava
N-Tier Architectures
• Developed to manage complexity and scalability issues– Middle tier implements new functionality
– client-tier hides the complexity while taking advantage of low administration web-based interfaces
• Enables system to be composed of different parts
• Areas of functionality can be ‘scaled up’ as demand requires
• Definitely more complex than the simple client-server application
v012405 J2EE Introduction 8
EnterpriseJava
LoadBalancer
WebServer
WebServer
WebServer
FIREWALL
FIREWALL
BusinessLogic
BusinessLogic
Database
BusinessSystem
BusinessSystem
DynamicWeb
Content
DynamicWeb
Content
For Fat Clients
v012405 J2EE Introduction 9
EnterpriseJava
Java 2 Enterprise Edition
• ‘Standard’ for developing multi-tier, enterprise applications
• Simplify development of multi-tier applications– Handle difficult middleware requirements
• Transactions
• Security
• Distributed objects
• Scaling
v012405 J2EE Introduction 10
EnterpriseJava
Java Platforms
• Java 2 Micro Edition (J2ME)– Java applications for ‘micro’ devices
– PDAs, cell phones, set-top boxes
• Java 2 Standard Edition (J2SE)– Used by J2EE. Write-Once Run-Anywhere
– ‘JDK’
• Java 2 Enterprise Edition (J2EE)– N-Tier server-side applications
v012405 J2EE Introduction 11
EnterpriseJava
J2EE Components
• J2EE Platform
• J2EE Compatibility Test Suite
• J2EE Reference Implementation
• Sun Blueprints Design Guidelines for J2EE
v012405 J2EE Introduction 12
EnterpriseJava
Compatibility Test Suite
• Verifies platform vendors have correctly implemented to the spec
• J2EE 1.3 Compatible Implementations– BEA Weblogic Server 7.0, Borland Enterprise Server, Computer
Associates Advantage Joe, Fujitsu Interstage, IBM Websphere, Macromedia JRun 4, Oracle 9i App Server, Pramati Server 3.0, SAS AppDev Studio, Silverstream App Server, Sun ONE Application Server, Sybase EAServer 4.1, TMax Soft JEUS 4.0, TriFork Application Server 3.1, J2EE SDK 1.3
• J2EE 1.4– “Web Services”
• J2EE 1.5 – “Ease of Use”
v012405 J2EE Introduction 13
EnterpriseJava
Reference Implementation
• Operational definition of the J2EE platform
• Proves spec is implementable
• Programmer experimentation
• Download At:– http://java.sun.com/j2ee/download.html
v012405 J2EE Introduction 14
EnterpriseJava
Blueprints
• Set of best practices
• http://java.sun.com/blueprints/
v012405 J2EE Introduction 16
EnterpriseJava
J2EE Platform
• Our main focus – standard execution environment for enterprise components
v012405 J2EE Introduction 20
EnterpriseJava
Application Components
• Application Clients
• Applets
• Servlets, JSP pages, filters, and web event listeners– Referred to as ‘Web Components’
• Enterprise Java Beans– Business logic for J2EE application
– transactional
v012405 J2EE Introduction 21
EnterpriseJava
Application Component Categories
• Deployed, managed, and executed on the J2EE server– JSPs, Servlets, EJBs
• Deployed and managed on the J2EE server, but executed on the client platform– HTML pages
– Applets embedded within HTML pages
• Deployment and management not fully addressed by J2EE specification– Application Clients
v012405 J2EE Introduction 22
EnterpriseJava
Containers
• Provide run-time support to application components– Provides Java 2 Standard Environment
– Provides APIs to access standard set of J2EE services
• Interposed between application clients and J2EE services– allows for declarative (versus programmatic) implementation of
services (e.g., security, transactions, and state management)
• Understands application packaging forms for deployment
• Part of a J2EE ‘server’– Typically implemented from an existing transaction processing
infrastructure
v012405 J2EE Introduction 23
EnterpriseJava
Containers (Cont)
• Deployment descriptor is the contract between a component and the container– TellerBean – no one can invoke the ‘closeAccount’ method unless
they are in the ‘manager’ role
– Essentially an XML config file
• Other Services– Lifecycle management
• Create and Destroy components as as demand and resources require
– Resource Pooling• Object pooling, connection pooling, thread pooling
v012405 J2EE Introduction 24
EnterpriseJava
Connectors
• Integrate EIS systems with J2EE system components– CICS
– Tandem
– SAP/R3
– PeopleSoft
– See: http://java.sun.com/j2ee/connector/products.html
• http://java.sun.com/j2ee/connector
v012405 J2EE Introduction 28
EnterpriseJava
Services (Cont)
• Java Naming and Directory Interface (JNDI)– Look up objects (services)
• JDBC– Access to relational databases and other repositories
• JavaMail– Send and receive mail
– Order confirmations, customer feedback
– Requires Java Activation Framework (JAF)
• CORBA Compliance– JavaIDL and RMI/IIOP
v012405 J2EE Introduction 29
EnterpriseJava
Services (Cont)
• Java Transaction API (JTA)– Components may manage transactions
– Usually, better left to platform
• XML Deployment Descriptors– Custom tool development
• Java Message Service (JMS)– Asynchronous communication with fault tolerance
v012405 J2EE Introduction 30
EnterpriseJava
Services (Cont)
• HTTP– Client-side API defined in java.net
– Standard: http://www.w3.org/Protocols/
• HTTPs– HTTP over Secure Socket Layer (SSL)
• JAXP– Java API for XML Parsing
v012405 J2EE Introduction 31
EnterpriseJava
Services (Cont)
• J2EE Connector Architecture (JCA)– Standardized access to EIS
• Security Services– JAAS allows services to authenticate and enforce access controls
– JACC allows security implementations to be ‘plugged into’ a J2EE application server
v012405 J2EE Introduction 32
EnterpriseJava
Services (Cont)
• Management– Manage servers using an enterprise bean
– Some JMX support
• Deployment– Contract between deployment tools and J2EE products
– J2EE product provides a plug-in component that the tool can use to deploy applications into the product
v012405 J2EE Introduction 33
EnterpriseJava
Services (Cont)
• Web Services– Deployment of web service clients and service endpoints fully
specified
– Web service clients• JAX-RPC for SOAP Web service calls
– Web service endpoints• Implementation using enterprise beans
– Java API for XML Registries for registry support
v012405 J2EE Introduction 34
EnterpriseJava
Transactions
• Transactional Resources– JDBC Connections
– JMS Sessions
– XATransaction Resource Adapters
• Transaction boundaries specified programmatically and declaratively
• Transactions may span multiple components and transactional resources
v012405 J2EE Introduction 36
EnterpriseJava
J2EE Security Goals
• Security should be portable and interoperable
• Security policy specified declaratively in deployment descriptors whenever possible
• Non-goals– Does not dictate a security policy
– Does not mandate a specific security technology
v012405 J2EE Introduction 37
EnterpriseJava
Security (Cont)
• Authentication– Prove identity
– Basic Authentication, HTTPs client authentication, SSL mutual authentication, Form-based authentication
– Application clients/JAAS
• Access Control– Limit access to resources based on role
• Can client access web page, servlet, JSP
• Can client invoke EJB method
v012405 J2EE Introduction 38
EnterpriseJava
Security (Cont)
• Deployment descriptor states security policies for declarative security
• APIs give access to security information– HttpServletRequest
• getUserPrincipal, isUserInRole
– EJBContext• getCallerPrincipal, isCallerInRole
• A J2EE product may restrict the use of certain J2SE classes and methods to secure and insure proper operation of the system.
v012405 J2EE Introduction 39
EnterpriseJava
Naming
• J2EE application clients, enterprise beans, and web components are required to have access to a JNDI naming environment.
• Containers provide naming context for components
• Deployment descriptors specify the component’s requirements for access to external information to the application assembler and deployers
• Components use JNDI interface
v012405 J2EE Introduction 40
EnterpriseJava
J2EE Applications
• J2EE Applications are composed of:– One or more J2EE components
– Module-level deployment descriptor• Lists application components as ‘modules’
• Goal:– Modular application assembly
– Portable deployment
v012405 J2EE Introduction 44
EnterpriseJava
Product Extensions
• Product Extensions are possible to standard– Specification defines the minimum with extensions expected
– Extensions may not change or add anything (classes, methods, parameters, etc.) to the packages identified by the specification
– may provide additional APIs
v012405 J2EE Introduction 45
EnterpriseJava
Product Requirements
• No specification on the number of programs or computers it takes to implement the standard
• No specification on the partitioning of services• No specification on the product boundaries
– may need to purchase different levels of compatibility incrementally
v012405 J2EE Introduction 46
EnterpriseJava
Platform Roles
• J2EE Product Provider– typically operating system venders, database venders, application
server vendors, or web server vendors
– provide component containers, API implementations, etc.
– provides deployment and management tools
• Application Component Provider– HTML document designers
– Applet developers
– EJB developers
v012405 J2EE Introduction 47
EnterpriseJava
Platform Roles (Cont)
• Application Assembler– assembles application components into a J2EE application
• Deployer– deploys software
– configures J2EE application for use in a specific environment
– instantiates application
– expert in the deployment environment
v012405 J2EE Introduction 48
EnterpriseJava
Platform Roles (Cont)
• System Administrator– configuration and administration of computing and networking
infrastructure
– monitors operation of application
• Tool Provider– develops tools for the development and packaging of components
v012405 J2EE Introduction 50
EnterpriseJava
Multi-Tier Model
• Client Tier– supports client access both inside and outside corporate firewall
• Middle Tier– supports client services through Web containers in the Web Tier
– supports business logic through EJB containers in the EJB Tier
• Enterprise Information Tier– supports access to information through standard APIs
v012405 J2EE Introduction 51
EnterpriseJava
Client Tier
• Variety of client types both inside and outside the enterprise firewall– Web Browsers using
• plain HTML pages
• dynamic HTML pages generated through JSPs
• Applets
– Standalone Java applications (portable code, non-portable install)
• Access Middle-Tier using web standards– HTTP, HTML, and XML
• Complex client interaction– communicated with through middle-tier Servlets
– clients access through JavaBeans
v012405 J2EE Introduction 52
EnterpriseJava
Middle Tier
• Application developer supplies business code in the form of Enterprise JavaBeans
• EJB Container provides reliability, scalability, security,and other qualities/services for the business code– APIs to implement business code
– Distributed environment to use the business code
v012405 J2EE Introduction 60
EnterpriseJava
J2EE Future Directions
• XML Data Binding (JSR-031)– http://java.sun.com/aboutJava/communityprocess/jsr/jsr_031_xmld.html
• JNLP– Java Network Launch Protocol– Deploy applications on server and launch on client– Java Web Start is reference implementation
• J2EE SPI– Make more aspects of an application server ‘pluggable’– http://java.sun.com/aboutJava/communityprocess/jsr/jsr_111_jsf.html a
possibility
v012405 J2EE Introduction 61
EnterpriseJava
Future Directions (Cont)
• JDBC Rowsets– Standard way to send tabular data between remote components of a
distributed app– http://java.sun.com/products/jdbc.
• Security APIs– Expand APIs available to a client that wishes to control security
programmatically
• SQLJ Part 0– Embed SQL statements in Java program– http://www.sqlj.org