J2EE Basics

From sheep
Revision as of 21:18, 14 September 2021 by Martin (talk | contribs) (Created page with "Refernces: * http://java.sun.com/javaee/5/docs/tutorial/doc/ * http://java.sun.com/javaee/technologies/ == Web Component == * JSP - Script * Servlets - Class files (compiled...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Refernces:


Web Component

  • JSP - Script
  • Servlets - Class files (compiled)
  • JSF - Framework based on JSP + Servlets
  • Html + Server utility classes
    • these are not considered web components but can be bundled with the web components

- May include java beans that talk to the business tier

Web Service support

  • web based application - open XML standards + transports
  • JEE provides XML API and tools

Web services - method + parameters

Document oriented - document containing service data

XML - cross platform, extensible, text based

SOAP - Simple Object Access Protocol

  • Envelope* describes message and how to process
  • Body* Encoding rules to express app, defined data types, convention used to represent request and response

WSDL - Web Service Definition Language

XML format for describing network services

  • description, name, location, communication mechanism (transport)
  • can be stored in UDDI or published - web

UDDI + ebXML - allows publishing of services

Business Component

  • EJB Enterprise beans that solve business needs
    • Stores and retrieves information from the EIS (Enterprise Information System)

Enterprise Information System

may contain:

  • ERP - Enterprise resource planning
  • Mainframe transaction processing
  • Database
  • Other legacy

Java EE Containers

  • component based - organises business logic into components
  • provides underlying services
  • requires assembly into a module and deployment
    • specifying component settings for each component e.g. transaction management, JNDI, remote connectivity
  • Transaction model allows relationships of methods to be defined
  • JNDI - unified naming and lookup mechanism across directory services
  • Remote connectivity - manages low level connectivity clients -> EJB

Security can be configured differently in different environments

Container manages non configurable items

  • EJB + servlet live cycle
  • DB pooling
  • Persistence
  • Access to JEE API

JEE Server = EJB container + Web Container

Deployment

  • Functional components + optional deployment descriptors
  • via platform specific tools - specifying user access + DB access

Packaging

  • JEE app = EAR file (Enterprise Archive - standard jar format)


/Web module (.war)
/Application client module (.jar)
/Resource Adaptor (.rar)
/EJB module (.jar)
/META-INF/application.xml - JEE deployment configuration - root of web app, protable naming mappings
/META-INF/sun-application.xml - runtime - app specific runtime e.g. caching options

Deployment configuration can be changed without need to modify code and rebuild

Deployment roles

  • Tool provider - provider of development, packaging tools
  • Application component provider - develops beans/applets/clients etc
    • Enterprise Bean developer
    • Web component developer
    • Application client developer - client jar file
  • Application assembler - assembles war,jar files into ear + writes deployment descriptors
  • Application deployer + administrator - configures deploys application, administers servers, JEE, network etc.

Simplifies System integration

  • platform independent system integration solution
  • unified application model across tiers with EJB
  • simplified request/response - Servlets/JSP
  • reliable security model - JAAS
  • XML data interchange - JAXP, SAAJ, JAX-WS
  • interoperability - JCA
  • easy DB connectivity - JDBC
  • enterprise application integration with JMS, JTA, JNDI

Protocols

Standard web based protocols:

  • TCP
  • HTTP 1.0
  • SSL 3.0
  • RMI (Remote Method Invocation) Serialisation + JRMP (Java Remote Messaging Protocol)
    • OMG protocols (Object Management Group)
    • CORBA (Common Object request Broker Architecture)
      • Defines interface in IDL (Interface Definition Language)
      • IDL compiled into client and server stubs
    • ORB (Object Request Broker)
      • Communicates using IIOP (Internet Inter Orb Protocol)

Requires:

  • Java IDL - idlj - hava compiler - generates java stubs from IDL
  • RMI-IIOP - RMI implementation over IIOP

From [URL="http://en.wikipedia.org/wiki/RMI-IIOP"]wikipedia [/URL]

Both CORBA and RMI-IIOP use the same GIOP communication standard. If required, it is possible to generate the IDL definitions for the involved RMI-IIOP data structures and use these definitions to arrange the interoperability between the RMI-IIOP and plain CORBA applications.

There is a program that will generate the idl: http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/rmi_iiop_pg.html

So though RMI-IIOP is CORBA compiant it needs work for corba clients to integrate.

java IDL is the typical way to integrate with an existing CORBA application.

java EJB is RMI-IIOP and CORBA can integrate but needs IDL to be generated (with the help of rmic)

http://java.sun.com/javase/6/docs/technotes/guides/idl/jidlFAQ.html

  • Java IDL - existing CORBA application - mainly CORBA/C++ based.
  • RMI-JRMP - (Application Servers see below). Designed for java.
  • RMI-IIOP - Used by Application Servers - part of spec. Mostly java based but want to maintain legacy applications.

Data formats

  • HTML
  • Image files: gif + jpeg
  • JAR
  • Class
  • XML