J2EE/WS/SOA Training

  • 396 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
396
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
17
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. J2EE/WS/SOA Training
  • 2. Scope/Contents  J2EE concepts  J2EE components  Service Oriented Architectures  Web Services  How they all tie together OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 2
  • 3. J2EETM – A brief history  Java EE (formerly J2EE™) was released with Java 1.2  Developing and running distributed multi- tier architecture applications.  Component-based approach to design, development, assembly and deployment of enterprise applications.  Introduced Enterprise Java Beans, Servlets, JSPs and Web OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 3
  • 4. What is J2EE  J2EE is not a technology, nor a system, but simply an implementation of a set of specifications.  is platform middleware  a comprehensive set of specifications for a platform that supports the development of robust and feature rich distributed systems  specifications that were written with managing general distributed systems in mind, not any particular domain.  technology neutral (agnostic) and scalable  has clearly defined standardized interfaces which are build to integrate seamlessly with other applications that support these interfaces. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 4
  • 5. What is J2EE  Component-based model which is reusable, scalable, modular and easy to integrate.  Well architected implementation for development of managed systems.  Reduced integration time  Reuse helps reduce the development time  Web Services support through integrated data interchange on Extensible Markup Language (XML)-based open standards and protocols OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 5
  • 6. J2EE Concepts  Abstraction  Encapsulation  Modularity  Interface-driven  Reusability  Component-based  Technology Neutral  Interoperability  Write-once run/test everywhere OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 6
  • 7. J2EE Concepts  Multi-tiered (3-tier or MVC)  3-tiered since they are distributed over 3 locations. J2EE J2EE  Middle layer is a multi- Application Application threaded J2EE application Application Dynamic server Client/Applet HTM L Pages Clie nt Tie r Client M achine  Any tier can be replaced/upgraded JSP We b Tie r independently as Pages J2EE Complaint Application requirements or technology Server change EJBs EJBs Business Tie r  Tiers could work across various operating systems or different legacy systems Database Legacy Application EIS Tier Other Servers  Modular  Advantage over simple client server architecture. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 7
  • 8. J2EE components OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 8
  • 9. J2EE Components  Self-contained unit of deployment that contains the implementation of value-added services which are instantiated and executed within a container.  Client Components contain:  Application Clients  Applets  Web Components contain:  JSP Pages  Servlets  Business Components contain:  Enterprise JavaBeans™ OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 9
  • 10. Client Components - Application Clients  Java™ Applications that access services provided Application Client by a J2EE Application Application Client Server. Thick Application Client Container Use these when a “thick” Clie nt Machine  client is required. 80-100 60-80 40-60 20-40 0-20 Nor th 100 80 60 We st 40 20 Used when a richer user 0 East 1st Qtr 2n d Qtr 3r d Qtr 4th Qtr Richer, interactiv e  GUI (graphs, me nus) interface is required. Web  Typically a GUI created Server from Swing or AWT.  Can access business tier, or open HTTP connection Application Server DBMS to web tier. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 10
  • 11. Client Components - Applet Clients  An applet is a Java class that Application Client Applet  Must subclass from java.applet.Applet Browser Client Machine  Is embedded within an HTML page Applet Applet can run only inside a browse r downloaded  Is invoked and executed with the from context of a Java-enabled HTML Web Server browser  Runs in the JVM in the web browser. Web  Very secure Server  Can not create files local to the platform hosting the browser  Can only communicate back to Application DBMS the server from which it has Server been/was downloaded. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 11
  • 12. Client Components – Web Clients Client HTML/JS  Also called ‘thin’ clients Browser Client Machine  Dynamic web pages HTML / DHTML Applet can run only generated by web pages inside a browse r components downloaded from Web Server  All ‘heavy weight’ operations off-loaded to Web Server enterprise beans on the J2EE server Application  Web clients do not directly Server DBMS query databases, run business processes or Client Tie r Application connect to legacy systems. Client Container Application Trade-offs between thick Client  and thin clients. Web Browser Web Page s Applets Business Web Tier Tier OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 12
  • 13. Web Components - Servlets  A servlet is  Used to extend the capabilities of the application server  Accessed via a request-response programming model  Draw servlet specific diagram.  Implemented as a class that inherits from javax.servlet.Servlet Servlets JSP Pages Web Container Business Client Tier Web Tier Tier OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 13
  • 14. Web Components - JSP  When your interface requires dynamic content  Two parts  Static content provided by the normal textual elements (XML, XHTML, HTML, etc)  Dynamic content provided by JSP elements JSP Pages JSP Compiler = Servlets + Dynamic HTM L / JS Web Container Client Tier OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 14
  • 15. Business Components - EJBs  Not to be confused with JavaBeans™  Three types Entity Servlets  Session Beans Beans  Stateless JSP Pages Session  Stateful Web Beans Container Message Entity Beans Client Tier Web Tier Driven Beans  EIS Tier  Container Managed Persistence Business Tier  Bean Managed Persistence  Message Driven Beans OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 15
  • 16. EJBs – Session beans  Stateful  Per client instantiation  Can still be pooled by the appserver  Returned to pool after the client has disconnected/disposed  Stateless  A shared pool  One instance is equivalent to the next OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 16
  • 17. EJBs – Session beans  Stateless can improve performance and scalability  Cost of reconstruction of context  Cost of number of required instances  Study the interaction patterns and cardinality issues OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 17
  • 18. EJBs – Entity beans  Provide data and business logic in one convenient place  Provide a transparent programmatic interface to data within a database  Implement the javax.ejb.EntityBean interface  2 flavors of persistence…  Container managed persistence (CMP)  Bean managed persistence (BMP) OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 18
  • 19. EJBs – Message-driven beans  An server-side component that allows a J2EE application to process messages in an asynchronous manner  Acts as a JMS listener  Resembles a stateless session bean  No data or conversational state for clients  All instances of an MDB are equivalent  A single MDB can process messages from multiple clients OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 19
  • 20. Containers  Interface between a component and the low-level platform-specific functionality that supports the component.  Hard-working second class citizens  Intercept requests, instantiate EJBs, maintain bean pools, manage threads.  Provide services like security, transaction management, JNDI lookups and remote connectivity.  EJB and servlet life cycle management, database connection resource pooling, data persistence. JSP Servlets Pages We b Contai ne r Low l e vel Pl a tform Spe cific Functiona li ty/ Code EJBs EJBs Cli ent Tie r J2EE compliant EJB Conta i ner Application Server EIS Tier OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 20
  • 21. Containers  Components are deployed in the container.  Provide the runtime support for application components J2EE container Applet Container Bean Pool Incoming Request  Container takes care of bean  Application Client Container management  Web Container  EJB Container Response  Advantages  No code to be written to handle transaction, state management, multi-threading, resource pooling and other complex low-level details.  If the container is J2EE complaint, you’re sure it will work.  Only concentrate on developing the business logic. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 21
  • 22. J2EE – Service Oriented Architectures  SOA is not Web Services Web Services External Web Services Internet  A web service may or may Middle Tier not be service oriented. Access to other Web Se rvices on the Internet SOA is a collection of Web  Server services that communicate Firewall with each other Application Server Data cache for database in EIS  Exchange data/info or co- Contains deployed Cache Middle-tier DBMS ordinate some activity components (EJBs, JSPs) Could be other relational databases. Could also exist  In past implemented with XML Firewall in EIS tier DCOM and ORB based on EIS Tier CORBA spec Internal Web Services Web Se rvices internal to the organization and trusted 3rd partie s  Now implemented with J2EE Adapter Adapter Adapter  Integrates seamlessly with the multi-tier J2EE Me ssage Router Legacy development architecture Application Existing DBMS Existing Internal Systems Internal System Internal System Database OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 22
  • 23. SOA – Components  Service (Service Endpoints)  Well-defined, self-contained, independent function.  End point of a connection  Connections  Channel over which communication happens  Request, response, provider, consumer  XML may or may not be used as the default message format Service Request Service Response Ser vice Provider Service Consumer OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 23
  • 24. SOA – Advantages  Loose Coupling  Asynchronous  Robust  Encapsulation  Reusable  Modularity  Technology Agnostic  Interoperable (Web Services)  Gartner reports that "By 2008, SOA will be a prevailing software engineering practice, ending the 40-year domination of monolithic software architecture" and that "Through 2008, SOA and web services will be implemented together in more than 75 percent of new SOA or Web Services projects." OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 24
  • 25. J2EE – Web Services  Web Service is a service/functionality defined/implemented according to WSDL and accessed using HTTP-SOAP.  Related to SOA?  Web Service has the following constraints:  Interfaces based on HTTP, FTP, SMTP  Messages in XML except Binary data attachments OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 25
  • 26. Web Services - SOAP  SOAP  Used to be Simple Object Access Protocol  Originally designed for RPC  Service Description in WSDL  All messages except attachments must be in HTTP-SOAP  SOAP-RPC and document-centric SOAP WS OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 26
  • 27. Other components of Web Services - WSDL  WSDL  Web Services Definition Language  XML format for describing network services as a set of endpoints operating on messages  Defines a binding mechanism to attach abstract services to specific network addresses.  Binding extensions for SOAP 1.1, HTTP and MIME.  Consists of:  Definitions  Types  Messages  Operations (defined in a portType)  Service bindings  Binding  Port  Service OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 27
  • 28. Other components of Web Services - WSDL WSDL document structure Definitions Operations Service Bindings Data Type Definitions Operation Message Definitions Service A Data Type Definitions Port Type Binding Port A Data Type Definitions Port B Message Operation Definitions Port C Data Type Definitions OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 28
  • 29. Other components of Web Services - UDDI  UDDI  Universal Description, Discovery, and Integration (UDDI) provides the definition of a set of services supporting the description and discovery of  (1) businesses, organizations, and other Web Services providers,  (2) the Web Services they make available, and  (3) the technical interfaces which may be used to access those services.  Yellow/White pages OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 29
  • 30. Web Services – SOAP Example  A service provider describes its service using WSDL. This definition is published to a directory of services like Directory Universal Description, Discovery, and Integration (UDDI). 2 L D. SD ri  A service consumer issues one or more g W Q. 3 ot ce queries to the directory to locate a in yr us eu Q service and determine how to yr n eu io R t r communicate with that service. ip e ps sei s cr no  Part of the WSDL provided by the De es ce service provider is passed to the su vi SOAP er ni service consumer. This tells the service Wg 1.S Messages DS consumer what the requests and L responses are for the service provider.  The service consumer uses the WSDL 4. Service Description using WSDL to send a request to the service provider.  The service provider provides the 5. XML Service Response based on WSDL expected response to the service Ser vice Provider Service Consumer consumer. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 30
  • 31. Web Services and SOA  A Web Service running on a Web Server in a SOA add another layer to abstraction to help interoperability Service Request Web Services + UDDI Ser vice Response Ser vice Provide r Service Consumer Service Service Provider/Consumer Provider/Consumer OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 31
  • 32. J2EE supports Web Services Web Services External Web Services Internet Web Service Middle Tier Access to othe r  Web Services on implementation the Internet Web Server runs inside a web Firewall container (Web Application Data cache for Server database in EIS Cache Middle-tier server) Contains deployed components (EJBs, JSPs) DBMS Could be other relational databases. Could also exist Can write Web in EIS tier  XML Fire wall Services on top of EIS Tier Internal Web Services Web Services internal to the organization a nd trusted 3rd parties an application to expose some of Adapter Adapter Ada pter the application Message Router Le gacy functionality as a Application Existing service DBMS Existing Internal Systems Internal System Internal System Database Existing DBMS OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 32
  • 33. Additional Slides
  • 34. Web Services Distributed Management  Composed of  Management Using Web Services (MUWS):  Enables management of distributed systems  Management Of Web Services (MOWS):  Addresses management of Web service end-points using Web Services protocols.  Based on MUWS specification. OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 34
  • 35. J2EE – Databases (JDBC)  The J2EE Platform specifies that a J2EE Application Server must support connection to databases via the JDBC™ API.  There is an explicit requirement that the all clients, with the notable exception of applet based clients be capable of accessing the database.  That is to say that there is not a requirement on a platform vendor to support access to a database from an applet client  ==============================  The Java Database Connection API  Based on X/Open SQL CLI (which is also the basis for ODBC  Included in the J2SE™ 1.4 distribution  First introduced in 1997  Current Version is 3.0  =============================  Provided a few critically needed updates to the capabilities of the JDBC interface  SavePoint interface  set, release, and rollback  Retrieval of  Parameter metadata  Auto-generated Keys  Allow for multiple open ResultSet objects  Holdable cursor support  New datatypes  Boolean (go figure)  DATALINK/URL OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 35
  • 36. Java Messaging Service  Providers  Clients JMS Provider  Messages  Queues Message Client  Topics Topic (pub-sub) Message Queue Client (Point-to-Point) Client OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 36
  • 37. JMX  Should this be included? OSS/J Overview www.ossj.org TMW Dallas, November 2005 Page 37