Java 2 Platform, Enterprise Edition (J2EE) An Overview - PowerPoint PPT Presentation


PPT – Java 2 Platform, Enterprise Edition (J2EE) An Overview PowerPoint presentation | free to download - id: 754c54-NTFkM


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation

Java 2 Platform, Enterprise Edition (J2EE) An Overview


Java 2 Platform, Enterprise Edition (J2EE) An Overview – PowerPoint PPT presentation

Number of Views:358
Avg rating:3.0/5.0
Slides: 112
Provided by: edut1550


Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Java 2 Platform, Enterprise Edition (J2EE) An Overview

Java 2 Platform, Enterprise Edition (J2EE) An
? ? ? ??????????
What Is J2EE ?
  • Java 2 Enterprise Edition
  • There are 3 different specifications within the
    Java framework (J2SE, J2ME, J2EE)
  • Created to provide a simple, unified standard for
    distributed applications through a component
    based application model
  • Specification is managed by a consortium of
    industry leaders

Some useful online references
  • http//
  • http//
  • http//

J2EE and Other Java 2 Platform Editions
Source Computer, August 2000
J2EE and Other Java 2 Platform Editions
Source Sun Microsystems, Inc.
Java Development and Runtime Environment
Source P.J. Perrone and V.S.R.R. Chaganti,
Building Java Enterprise Systems with J2EE
Java 2 Platform Runtime Architecture
Source P.J. Perrone and V.S.R.R. Chaganti,
Building Java Enterprise Systems with J2EE
Java 2 Platform, Standard Edition (J2SE 1.3)
Source Sun Microsystems, Inc.,
Java 2 Platform, Standard Edition (J2SE 1.4)
Source Sun Microsystems, Inc.,
Why J2EE ?
  • A stand alone program
  • Client/Server (2-Tier)
  • BBS, News, FTP, Telnet,
  • Traditional (non-component) N-Tier Systems
  • 3-tier application Browser WEB Server DBMS
  • New trend
  • Component N-Tier Systems (J2EE Architecture)

See figures on next slides
2-Tier Database Access
  • Client Tier Presentation, Business Logic
  • Data Tier Database Management Services

Source Sun Microsystems, Inc., JDBC 3.0
Traditional(non-component) N-Tier Systems
  • Client Tier Presentation Logic
  • Application Tier Business Logic
  • Data Tier Database Management Services

Source Sun Microsystems, Inc., JDBC 3.0
Component N-Tier Systems J2EE Architecture
EIS Tier
Web Tier
Business Tier
Client Tier
J2EE Server Machine
Client Machine
Database Server Machine
J2EE Architecture (1/2) J2EE Component and
Source Sun Microsystems, Inc., J2EE
Specification v1.3
J2EE Architecture (2/2)
  • J2EE consists of three major parts
  • Components
  • Hold presentation and business logic
  • Containers
  • Provide context for components
  • Connectors
  • Provide access to legacy enterprise systems

J2EE Components
  • Application clients
  • Applets
  • Web components
  • Servelets, Java Server Pages (JSP)
  • Portlet (see JSR168)
  • Business components
  • Enterprise Java Beans (EJB)

J2EE Component Applet Component
  • An applet is a program written in the JavaTM
    programming language that can be included in an
    HTML page, much in the same way an image is
    included. When you use a Java technology-enabled
    browser to view a page that contains an applet,
    the applet's code is transferred to your system
    and executed by the browser's Java Virtual
    Machine (JVM).
  • An applet is a small program that is intended not
    to be run on its own, but rather to be embedded
    inside another application.

Applet pro vs. con
  • Applets Java code that runs inside browser
  • Advantages
  • Extends functionality on the client side
  • More complicated GUIs than w/ HTML or JavaScript
  • Computation can be off-loaded from server
  • Users dont have to build, install, and configure
  • Disadvantages
  • Download time
  • Sandbox limits functionality (unless signed)
  • Window management by browser

J2EE Component Web Component
  • Servlets
  • A servlet is a program that extends the
    functionality of a Web server. Servlets receive a
    request from a client, dynamically generate the
    response (possibly querying databases to fulfill
    the request), and then send the response
    containing an HTML or XML document to the client
  • JSP
  • The JavaServer Pages (JSP) technology provides an
    extensible way to generate dynamic content for a
    Web client. A JSP page is a text-based document
    that describes how to process a request to create
    a response

Java Servlet
Servlet Class wasnt loaded into System
Class Loader
Load Servlet class Into System
HTTP Request
Servlet Class was loaded
Web Services
HTTP Response
Java Servlet
  • Java Servlet is the bridge for user to use Java
    solution in Web Server.
  • Java Servlet has better performance than
    CGI(Common Gateway Interface).
  • Java Servlet can use session to replace cookie
    and enhance security.
  • J2EE Server maintains the session for Java

JavaServer Pages (JSP)
Java Source Code
Java Bytecode
Load Servlet class Into System
New JSP Page JSP was modified
Class Loader
JSP isnt loaded yet.
HTTP Request (.jsp)
Web Services
HTTP Response
JavaServer Pages (JSP)
  • JSP has all features of Servlet.
  • JSP is a HTML like document.
  • JSP is designed for Web Page Developer.
  • JSP will change to Java Servlet source.
  • JSP is ran via Servlet mode.

JavaServer Pages Objects
  • JSP has 9 objects which developer can use
    directly without new it.

JSP Object java class scope request javax.serv
let.ServletRequest request response javax.servlet
.ServletResponse pag pageContext javax.servlet.js
p. PageContext page session javax.servlet.http.H
ttpSession session application javax.servlet.Serv
letContext application out javax.servlet.jsp.Jsp
Writer page config javax.servlet.ServletConfig
page page java.lang.Object page exception java.
lang.Throwable page
Portlet and Portal
  • JSR168
  • Java portlet standard
  • WSRP
  • Remote portlet communication protocol
  • Portals aggregate remote portlets

Portal Server
(Web Services for Remote Portlets)
The Reason For JDBC
  • Despite almost all databases supporting SQL,
    database vendors (Microsoft Access, Oracle etc.)
    provide proprietary (no standard) Application
    Programming Interfaces for sending SQL to the
    server and receiving results from it!
  • Languages such as C/C can make use of these
    proprietary APIs directly
  • High performance
  • Can make use of non standard features of the
  • All the database code needs to be rewritten if
    you change database vendor or product
  • JDBC (Java DataBase Connectivity) is a vendor
    independent API for accessing relational data
    from different database vendors in a consistent

CCTM Course material developed by James King
  • JDBC provides an API that hides the vendor
    specific APIs by inserting a driver between the
    Java application and the database API
  • JDBC requires a vendor-specific driver
  • The driver converts calls from JDBC API to
    vendors API gt performance penalty
  • The driver does not provide access to vendor
    specific functionality
  • The same Java application can be used with a
    different vendors database by simply switching
    JDBC driver and changing one line of Java code.
  • JDBC 1.0 is included inside JDK 1.1 or higher in
    a package java.sql
  • JDBC 2.0 and 3.0 require updated drivers and an
    additional package javax.sql

CCTM Course material developed by James King
Rollback and Commit
  • By default connections to the database commit
    each update as soon as it is completed.
  • If you want to make a set of changes and only
    commit the aggregate result if nothing goes wrong
    auto commit needs to be switched off
  • connection.setAutoCommit(false)
  • You can then use
  • connection.commit() to apply the changes
  • connection.rollback() to undo changes since the
    last commit
  • You can switch auto commit back on using
  • connection.setAutoCommit(true)

CCTM Course material developed by James King
J2EE Compoent (1/2) EJB Component
  • Enterprise JavaBean (EJB)
  • The Enterprise JavaBeans (EJB) architecture is a
    server-side technology for developing and
    deploying components containing the business
    logic of an enterprise application.
  • Enterprise JavaBeans components, termed
    enterprise beans, are scalable, transactional,
    and multi-user secure.
  • EJB is an architecture for component-based
    transactional distributed computing.

EJB Component (2/2)
  • An enterprise bean contains business logic that
    operates on the enterprises data.
  • Client access is mediated by a Container.
  • There are three kinds of enterprise beans
    session beans, entity beans, and message-driven

Enterprise Bean Objects
  • Session objects for a single client,
    short-lived, Stateful, Stateless
  • Entity objects object view of data in the
    database, shared by multiple clients, long-lived,
  • Message-driven objects triggered by a single
    client message, short-lived, stateless,

Stateful vs. Stateless Session Beans
  • Stateful
  • Possess Internal State
  • One per client
  • Need to handle activation/ passivation
  • Stateless
  • Do not possess state
  • Can be pooled to handle multiple clients
  • Do not need to be passivated

Entity Beans CMP vs. BMP
  • Container Manager Persistence
  • Container responsible for database accesses/
  • Developer focuses on data use
  • Bean Managed Persistence
  • Developer must write code to handle database
    accesses/ controls
  • Used for more specialized data mapping strategies

Entity Bean Characteristics
  • Provides an object view of data in the underlying
  • Shared across multiple users
  • Long-lived
  • Survives container crash

To Implement an Enterprise Bean (1/2)
  • Any enterprise bean must define two interfaces
    and one or two classes
  • Remote interface
  • defines a beans external interface
  • must extend javax.ejb.EJBObject (which in turn
    extends java.rmi.Remote)
  • Home interface
  • The home interface defines a beans life cycle
    methods, eg. create bean, remove bean, find bean,
  • must extend javax.ejb.EJBHome which also extends

To Implement an EJB (2/2)
  • Bean Class
  • The java class that actually implements the
    beans external interface, e.g. the bean class
    provides implementations for the beans business
  • An entity bean must implement the
    javax.ejb.EntityBean interface, while a session
    bean must implement the (you guessed it)
    javax.ejb.SessionBean. Both of these interfaces
    extend javax.ejb.EnterpriseBean
  • Primary Key
  • The primary key is a very simple class that
    provides a pointer into a database Only entity
    beans need a primary key. This class must
    implment (so the entity bean
    can automatically be sent to persistent storage)

EJB Container
  • A container is provided by the Application Server
    vendor to provide basic services that are
    required by J2EE specification.
  • An EJB programmer places their code here, and is
    assured a variety of basic services are available
  • This means the developer doesnt have to code
    these services from scratch
  • Specification states which services must be
    supported but not how

Basic Services Supplied by the EJB Container
  • Security
  • Transaction management
  • Remote Client Connectivity
  • Life Cycle Management
  • Database Connection Pooling

More Services provided by container
  • The following basic services will be supported by
    all J2EE compliant products
  • Resource Pooling
  • Thread Control
  • Presentation Logic
  • Persistence
  • Messaging
  • And more

IIOP Internet Inter-ORB Protocol
ORB Object Request Broker
Cant Do in an EJB
  • Cant use threads
  • Cant use the AWT
  • Cant act as network server
  • Cant use package
  • Cant load native libray
  • Cant use this as an argument or return value

EJB Benefits Summary
  • Developing distributed applications in Java
  • Application developer is spared from following
  • Transaction management
  • State management
  • Multi-threading
  • Connection pooling
  • Write once, run anywhere
  • Interoperability with other languages
  • Compatible with CORBA protocols

J2EE Containers (1/2) Web
  • Web Component Containers
  • 1. Servlet Containers
  • A servlet container provides network services (by
    which requests and responses are sent), decodes
    requests, and formats responses. All servlet
    containers must support HTTP as a protocol for
    requests and responses, but may also support
    additional request-response protocols such as
  • 2. JSP Containers
  • A JSP container provides the same services as a
    servlet container and an engine that interprets
    and processes a JSP page into a servlet.
  • 3. Web Containers
  • A Web container provides the same services as a
    JSP container and access to the J2EE service and
    communication APIs.

J2EE Containers (2/2)
EJB Containers
  • EJB Container
  • Enterprise beans are hosted by an EJB container.
    In addition to standard container services, an
    EJB container provides a range of transaction and
    persistence services and access to the J2EE
    service and communication APIs.

  • Tomcat Java-based web server servlet container
    w/ JSP environment
  • Execution modes
  • Standalone default mode for Tomcat
  • Out-of-process add-on web server plugin opens
    JVM outside web server plugin and JVM
    communicate using IPC mechanism (TCP/IP sockets
    and special protocol)

Tomcat and Apache 
  • Communication mechanism between Tomcat and
    Apache web server adapter or named as
  • Implemented as shared library (e.g.,,
  • Uses/manages TCP connections
  • Uses the AJPV12/AJPV13 communication protocol

J2EE Connectors
  • Contract between container and Enterprise
    Information Systems (EIS)
  • Proprietary and under the hood
  • Implementation is available with J2EE
    specification version 1.3 / 1.4

J2EE Standard Services
  • Java Transaction API (JTA)
  • Java Database Connection (JDBC)
  • Java Message Service (JMS)
  • Java Authentication and Authorization Service
  • J2EE Connector Architecture (JCA)
  • Others RMI-IIOP, JavaIDL, JavaMail, JavaBeans
    Activation Framework (JAF), Java API for XML
    Parsing (JAXP)

IIOP Internet Inter-ORB Protocol
The Solution J2EE Application Model
  • J2EE application model partitions the work needed
    to implement a multi-tier service into two parts
  • the business and presentation logic (implemented
    by the application developer)
  • the standard system services provided by the J2EE
  • The developer can rely on the platform to provide
    the solutions for the hard systems level problems
    of developing a middle-tier service.

J2EE Application Model
Source Sun Microsystems, Inc.,
Benefits of J2EE Application Model
  • The J2EE application model provides the benefits
    of Write Once, Run Anywhere portability and
    scalability for multi-tier applications.
  • This standard model minimizes the cost of
    developer training while providing the enterprise
    with a broad choice of J2EE servers and
    development tools.

J2EE Platform Roles
  • J2EE Product Provider
  • Application Component Provider
  • Application Assembler
  • Deployer
  • System Administrator
  • Tool Provider

The Connector Architecture
  • Integration of J2EE servers with Enterprise
    Information Systems (EIS)
  • EIS vendor-provided resource adaptors
  • Resource adaptor-permitting application servers

J2EE Connector
  • J2EE Connector
  • The J2EE Connector architecture defines a
    standard architecture for connecting the J2EE
    platform to heterogeneous EISs. Examples of EISs
    include ERP, mainframe transaction processing,
    database systems, and legacy applications not
    written in the Java programming language. By
    defining a a set of scalable, secure, and
    transactional mechanisms, the J2EE Connector
    architecture enables the integration of EISs with
    application servers and enterprise applications.

System Level Pluggability
Source Sun Microsystems, Inc., J2EE Connector
Architecture Specification
Connector Architecture Overview
Source Sun Microsystems, Inc., J2EE Connector
Architecture Specification
Connector Architecture Overview (cont.)
Source Sun Microsystems, Inc., J2EE Connector
Architecture Specification
Connector Architecture in B2B Scenario
Source Sun Microsystems, Inc., J2EE Connector
Architecture Specification
Client View of an Enterprise Bean
  • Home Interface methods for creating, removing,
    and finding bean instances
  • Remote Interface methods callable by the client
  • Object Identity
  • Metadata Interface mainly for dynamic invocation
  • Handle

Client View of Session Beans
Source Sun Microsystems, Inc., Enterprise
JavaBeans 2.0
Accessing Enterprise Beans from
Servlets/JavaServer Pages
Source Sun Microsystems, Inc., J2EE
Specification, v1.3
J2EE Deployment
Source Sun Microsystems, Inc., J2EE
Specification, v1.3
J2EE Application Life Cycle
Source Sun Microsystems, Inc., J2EE Connector
Architecture Specification
Overview of Enterprise Applications Integration
Source P.J. Perrone and V.S.R.R. Chaganti,
Building Java Enterprise Systems with J2EE
Overview of Enterprise Applications Integration
Source P.J. Perrone and V.S.R.R. Chaganti,
Building Java Enterprise Systems with J2EE
EAI with XML
Source P.J. Perrone and V.S.R.R. Chaganti,
Building Java Enterprise Systems with J2EE
Enterprise Beans of the Example Design
Source Sun Microsystems, Inc., The J2EE Tutorial
J2EE Platform Technologies 1/3
  • Servlets and JSP
  • Java technology servlets and JavaServer Pages are
    server components that run in a web server that
    supports dynamic HTML generation and session
    management for browser clients.
  • EJB
  • Enterprise JavaBeans is a server component model
    that provides protability across application
    servers and implements automatic services on
    behalf of the application components.
  • JTA
  • Java Transaction API provides a transaction
    demarcation API.
  • JTS
  • Java transaction Service defines a distributed
    transaction management service based on the CORBA
    Object Transaction Service.

J2EE Platform Technologies 2/3
  • JNDI
  • Java Naming and Directory Interface provides
    access to naming and directory services, such as
    DNS, LDAP, NDS, and CORBA Naming.
  • Remote Method Invocation(RMI) creates remote
    interfaces for Java-to-Java communication. This
    extension uses the CORBA standard IIOP
    communication protocol.
  • Java IDL
  • Java Interface Definition Language creates remote
    interfaces to support java-to-CORBA

J2EE Platform Technologies 3/3
  • JDBC
  • JDBC database access API provides uniform access
    to relational databases.
  • JMS
  • Java Messaging Service supports asynchronous
    communication using either a reliable queuing or
    publish/subscribe model.
  • JavaMail
  • JavaMail provides a protocol-independent
    framework to build mail and messaging
  • JAF
  • JavaBeans Activation Framework provides standard
    services to determine the type of an arbitrary
    piece of data and activate an appropriate
    JavaBeans component to manipulate the data.

History of J2EE Technologies
  • Distributed Objects
  • CORBA, DCOM, etc.
  • Three-tier scenario presentation, business
    logic, and backend databases
  • Hard to get right without the proper
  • Server-Side Components
  • Focuses on encapsulating business rules into
    objects in the middle tier
  • Component Transaction Monitors
  • Descendant of CORBAs Object Request Broker
  • provides discovery, persistence, event
    notification, transactions, etc. for three-tier
    or n-tier applications

Server Technology Timeline
J2EE Platform Services
  • Naming Services
  • Provide application clients, EJB and Web
    components with access to a JNDI naming
  • Deployment Services
  • Allow components and applications to be
    customized at the time they are packaged and
  • Transaction Services
  • Devide an application into a series of
    indivisible or atomic units of work.
  • Security Services
  • Designed to ensure that resources are accessed
    only by users authorized to use them.

J2EE Platform Benefits
  • Simplified architecture and development
  • Scalability to meet demand variations
  • Integration with existing information systems
  • Choices of servers, tools, components
  • Flexible security model
  • The J2EE reduces the cost and complexity of
    developing these multi-tier services, resulting
    in services that can be rapidly deployed and
    easily enhanced as the enterprise responds to
    competitive pressures.

J2EE Platform
  • The J2EE platform is the standard environment for
    running J2EE applications. The J2EE platform is
    composed of the following elements
  • J2EE deployment specification - a standard that
    defines a common way of packaging applications
    for deployment on any J2EE compatible platform.
  • Java technology standards for the J2EE platform -
    a set of standards that all J2EE platform
    products must support (JMS , JNDI etc)
  • IETF standards for the J2EE platform - a set of
    standards defined by the Internet Engineering
    Task Force that all J2EE platform products must
    support.(eg XML, HTTP, HTML)
  • CORBA standards for the J2EE platform - a set of
    CORBA standards upon which the J2EE platform
    bases its middle-tier interoperability.

J2EE Application Assembly
  • A J2EE application is packaged into one or more
    standard units for deployment to any J2EE
    platform-compliant system.
  • Each unit contains a functional component or
    components (enterprise bean, JSP page, servlet,
    applet, etc.), a standard deployment descriptor
    that describes its content, and the J2EE
    declarations which have been specified by the
    application developer and assembler.
  • Once deployed, theses components can then be run.

J2EE Reference Implementation
  • Its primary role is as an operational definition
    of the J2EE platform.
  • Most importantly, it is used as the standard
    platform for running the J2EE Compatibility Test
  • A secondary role for the reference implementation
    is as a freely available platform for
    popularizing Java 2 platform, Enterprise Edition.

J2EE Reference Implementation
  • Latest version available for download
  • JavaTM 2 SDK, Enterprise Edition Version 1.3
  • Downloadable at
  • http//
  • NOTE
  • This version will require Java 2 SDK, Standard
    Edition (J2SE) Version 1.3.1 or higher.

Application Servers
  • Consists of
  • EJB server
  • Web server (HTTP)
  • Secured web server (HTTPS)
  • J2EE Compliance Test
  • Brings vendor neutrality to your applications
  • Consists of more than 5000 tests
  • Currently 9 application servers have been
  • BEA WebLogic (BEA)
  • iPlanet (Sun Netscape)
  • Websphere (IBM)
  • (check out for latest

The BEA WebLogic Server
  • All Java, clean-room implementation of the J2EE
  • Shipping basic APIs since 1997
  • One of the most widely-used Application Servers
    on the market
  • Over 12,000 customers
  • Associated BEA product TUXEDO
  • Distributed TP Monitor
  • Originally developed at Bell Labs in 1984
  • Influenced the design of WebLogic

Sun ONE Application Server 7
  • Provides a comprehensive overview of the Sun ONE
    Application Server. Please note - the tour may
    take up to 1 minute to complete testing your
    system before starting to load.
  • Sun is the first software vendor to deliver a
    fully J2EEtm platform-certified, commercial
    application server, free of charge, on all
    leading OS platforms.
  • The new Sun ONE Application Server 7 includes the
    world's fastest, secure http server, and new
    "Always On" technology.

J2SE Component Links
  • Assistive Technologies
  • Drag and Drop
  • Java Access Bridge
  • JavaBeansTM Technology
  • Javadoc Tool
  • Java Foundation Classes (JFC)/Swing
  • Java HotSpotTM Virtual Machine
  • Java Platform Debugger Architecture (JPDA)
  • Java Plug-in for Windows XP
  • Java 2DTM API product page
  • Java Web Start
  • JDBCTM Technology
  • Pluggable Look and Feel
  • Remote Method Invocation (RMI)
  • Security

List of J2ME Technologies
  • Personal Profile
  • Personal Basis Profile
  • Java CardTM Technology
  • Java Embedded ServerTM Technology
  • JavaPhoneTM API
  • Java Telematics Technology (JTT)
  • Java TVTM API
  • J2ME Wireless Toolkit
  • PersonalJavaTM Technology
  • Wireless Developer web site
  • Connected Limited Device Configuration (CLDC)
  • Mobile Information Device Profile (MIDP)
  • Connected Device Configuration (CDC)
  • Foundation Profile

JBoss Application Server
  • JBoss is a simply powerful J2EE application
  • JBoss Application Server is the 1 most widely
    used Java application server on the market. A
    J2EE certified platform for developing and
    deploying enterprise Java applications, Web
    applications, and Portals, JBoss Application
    Server provides the full range of J2EE 1.4
    features as well as extended enterprise services
    including clustering, caching, and persistence.
  • EJB3.0
  • JBoss Application Server includes support for
    Enterprise Java Beans (EJB) 3.0 which is designed
    to dramatically simplify the enterprise Java
    programming model.
  • Service Oriented Architecture
  • JBoss AS is founded on a service oriented
    microkernel architecture with an extremely small
    in footprint that ensures all services are
    accessed, managed, and integrated in a unified
    and consistent manner.

Introduction to Apache Ant
  • What is Ant?
  • Java-based build tool
  • Why use Ant?
  • Cross-platform
  • Java domain smart
  • Fast, extensible, integrated
  • Alternatives?
  • Analogy
  • Factory automation

Typical Things to Build
Documentation HTML/PDF
Designing a Build
  • What are you building?
  • What does it take to build it?
  • How are the steps related?

High-level Model
HTML / Text files
Source Code
"The Build"
Application (EAR)
Examples of Commercially Used AOP Tools
  • AspectWerkz
  • Supported by BEA
  • Spring AOP framework
  • JBoss AOP
  • CME (Concern Manipulation Environment)
  • Supported by IBM

Technical Architecture
Web Tier
Ant build ltindexgt task
EJB Container
AOP Aspect Oriented Programming
  • Which tools are suitable for commercial dev?
  • Over a dozen tools are listed on
  • Early adopters harden new technologies
  • How active are the user communities of each?

project posts list (november04 posts) url
AspectJ 150..210 each aspectj-users at
AspectWerkz 150..210 each user at
JBoss AOP 150..210 each aspects/jboss forum
Spring AOP 150..210 each springframework-user
abc 1..30 abc-users at
aspect 1..30 aspectsharp-users
AspectC 1..30 aspectc-user at
JAC 1..30 jac-users at
IDE support, libs, and docs
ide editor views debugger other libs docs
AspectJ eclipse, jdeveloper, jbuilder, netbeans highlighting, content assist, advice links outline, visualizer, cross references plain Java ajdoc, ajbrowser -
Aspect Werkz eclipse advice links - plain Java - -
JBoss AOP eclipse advice links, UI for pointcut creation aspect manager, advised members plain Java dynamic deployment UI, jboss framework integration
Spring AOP eclipse - - plain Java spring framework integration
Building AOP programs
  • Whats it like to adopt AOP on an existing

source compiler checking weaving deployment run
AspectJ extended .java, or .aj incremental aspectj compile full static checking compile and load-time, produce bytecode static deployment plain Java program
Aspect Werkz plain .java, .xml java compile, post processing minor static checking, none of pointcuts compile and load-time, produce bytecode hot deployable plain Java program
JBoss AOP plain .java, .xml java compile, post processing minor static checking, none of pointcuts runtime interception and proxies hot deployable framework invoked managed
Spring AOP plain .java, .xml java compile - runtime interception and proxies hot deployable framework invoked managed
AOP features
  • AspectJ and AspectWerkz
  • AspectJ 5 will feature support for generics in
    pointcuts. The _at_AspectJ syntax will support the
    AspectWerkz annotation style
  • JBoss AOP
  • Static typing for parameters, performance
    improvements, libraries, and more IDE support
  • Spring AOP
  • Performance improvements, interoperability with
    AspectJ's pointcuts, and packaging of some Spring
    AOP services as AspectJ aspects

JBoss AOP (1/2)
  • Lack of static checking for pointcuts
  • Advanced IDE features not yet supported
  • Rich set of enterprise aspects libraries are
    available and integrated with JBoss and JEMS
  • IDE support lowers adoption and reduces need to
    hand-code XML
  • Support for dynamic deployment of aspects

JBoss AOP (2/2)
Web services in JBoss Overview
  • Specifies how JBoss server components are exposed
    as Web service
  • Stateless Session Beans
  • Web components
  • POJO as servlet

JBoss Hibernate
  • Hibernate IS EJB 3.0 CMP
  • CMP is an API and XML mappings
  • Hibernate is the actual persistence engine
  • Hibernate caches are being integrated with
  • Full distributed data with OR backend on one

  • Part of JBoss full-time
  • Gavin King and Christian Bauer on board
  • Persistence for POJOs (JavaBeans)
  • Flexible and intuitive mapping
  • Support for fine-grained object models
  • Powerful, high performance queries
  • Dual-Layer Caching Architecture (HDLCA)
  • Support for detached objects (no DTOs)
  • Transparent Persistence
  • Automatic dirty checking
  • Transitive Persistence
  • Smart fetching and caching
  • Smooth migration to EJB3.0
  • Consulting and support available as part of JBoss

Tomcat 5.0.x improvements
  • Tomcats Remy Maucherat is on JBoss inc staff
  • Performance optimizations and reduced garbage
  • Optional standalone deployer (validation and
    precompilation of webapps)
  • Scalability and reliability enhancements
  • Complete server monitoring using JMX
  • Improved Taglibs handling, including advanced
    pooling and tag plugins
  • Embedding of Tomcat using JMX
  • Enhanced Security Manager support (now allows
    very restrictive policies)
  • Expanded documentation
  • Consulting and support available as part of JBoss

Tomcat standalone or Tomcat inside JBoss ?
  • Better JBoss deployer
  • Hot deployment
  • Deployment of nested archives (EARs, SARs)
  • Redeployment
  • Automatic undeployment
  • Advanced clustering
  • Integrated J2EE stack within one VM
  • Deployment descriptor
  • Optimized local calls
  • Integrated security
  • AOP in JBoss 4.0 available in Tomcat components
    and webapps
  • Easy to use classloader
  • Nukes

  • JBoss IDE is based on Eclipse.
  • Series of plugins for Eclipse
  • The debugging and monitoring of JBoss servers and
    the control of their life cycle (start/stop).
  • A very comfortable and sophisticated support for
  • Support completion and generation
  • Support for AOP (completion and generation).
  • An easy way to configure and deploy the packaging
    layout of archives (packed or exploded)

What Is JBossCache?
  • What is JBossCache?
  • A transactional replicated cache for JBoss with
    and without AOP (aspect-oriented programming)
  • A cache for frequently accessed elements
  • Stateful Session Beans, HTTPSession
  • Caches are used in a number of places in JBoss
  • This one provides a central cache service (MBean
  • All access goes through the cache
  • Write-through (lazy or eager)
  • Reads only access the cache (very fast on cache
  • Items not in the cache are loaded (e.g. from
  • Bounded size old items are removed by eviction
  • Local (non-replicated) and replicated caches
  • Replicated caches are the interesting part

  • Transactions
  • All modifications done within TX, replication at
    TX commit. No replication on rollback
  • Locking
  • Access to nodes serialized by locks
  • Lock acquisition timeouts used for deadlock
  • Replication
  • local in-VM, no replication
  • repl-async replication done on separate thread
  • repl-sync replication done on user's thread,
    wait for all acks
  • All combinations supported
  • From local/no-tx/no-locking to repl/tx/locking
  • Ex repl-async/no-locking/TX

Nukes on JBoss
  • Nukes on JBoss is a port of PHP postnukes
  • Scalability problems with Zend engine
  • Full port to EJB/J2EE.
  • Leverage the vast library of nukes modules
  • Most of PN modules are ported
  • Core offers the core functionalities to other
  • Security, lifecycle management, parameterization
  • User enables user management
  • Html stores files, filesystem is abstracted,
    stored in DB
  • Sections edit/publish articles
  • FORUMS!!!!

CMS ease of update for non-techies
Nukes components
How to Deploy on JBoss (1/3)
  1. Write your beans and package them in an ejb-jar
  2. Write your servlets/JSPs and package them in a
    war file.
  3. Add a Class-Path attribute to your war files
    MANIFEST.MF file to reference your beans package.
    for detailed information on that see J2EE
    Deployment specification.

How to Deploy in JBoss (2/3)
  • 4. Package your application in an ear file.
  • An ear file is a jar archive which contains
  • Your jar files
  • Your war files
  • A deployment descriptor for your application.
  • This file must be named "application.xml", and
    must be
  • located in the META-INF directory in the ear
    archive. This
  • file tells JBoss which modules are EJBs, which
    ones are
  • web modules, and the context paths for the

Sample Application.xml file
  • lt?xml version"1.0" encoding"ISO-8859-1"?gt
  • ltapplicationgt ltdisplay-namegtMy applicationlt/displa
  • ltmodulegt
  • ltwebgt
  • ltweb-urigtwebmodule.warlt/web-urigt ltcontext
  • rootgt/servletslt/context-rootgt
  • lt/webgt
  • lt/modulegt
  • ltmodulegt
  • ltejbgtbeans.jarlt/ejbgt
  • lt/modulegt
  • lt/applicationgt

How to Deploy in JBoss (3/3)
  • 5. Deploy your ear file.
  • Option 1 Copy your ear file to JBOSS_HOME/deploy
  • Write once Deploy AnyWhere!!

Thank you!
  • ????
  • http//
  • ???

(No Transcript)