660 likes | 790 Views
COMP 655: Distributed/Operating Systems. Winter 2012 Mihajlo Jovanovic Week 11: System Examples. Distributed system examples. Commercial middleware J2EE Overview .NET Overview Web services: where middleware systems meet Web service from Open Source middleware. Java EE Overview.
E N D
COMP 655:Distributed/Operating Systems Winter 2012 Mihajlo Jovanovic Week 11: System Examples Distributed Systems - COMP 655
Distributed system examples • Commercial middleware • J2EE Overview • .NET Overview • Web services: where middleware systems meet • Web service from Open Source middleware Distributed Systems - Comp 655
Java EE Overview • The problem Java EE attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications that is • Integrated • Suitable for enterprise applications • Widely available • Includes all of the basic middleware capabilities for building distributed systems Distributed Systems - Comp 655
Enterprise applications require • High throughput • Load balancing • Efficient communications • High availability • Highly reliable communications • Persistent, asynchronous communication option • Distributed transactions • High security • Ability to interoperate with whatever • Structured naming with de-centralized administration Distributed Systems - Comp 655
Java Technology Enabled Desktop Workgroup Server High-End Server Java Technology Enabled Devices The Java™ Platform
The 3 Cs of Java EE Components Containers Connectors Distributed Systems - Comp 655
J2EE Overview Distributed Systems - Comp 655
Key middleware services • Communication: RMI-IIOP, JMS • Naming: JNDI (part of Java SE) • Persistence: JPA, JDBC, JDO • Transactions: JTA, JTS • Security: (next page) Distributed Systems - Comp 655
Java SE 6 Security Features • JAAS – Java Authentication and Authorization Service • JCE – Java Cryptography Extension • JSSE – Java Secure Socket Extension • Java GSS-API – Kerberos V5 secure communications • JSSE - Java Secure Socket Extension • More… Distributed Systems - Comp 655
Java EE for web services • Java Architecture for XML Binding (JAXB) • Java API for RESTful Services (JAX-RS) • Java API for XML-Based Web Services (JAX-WS) • SOAP with Attachments API for Java (SAAJ) • Java API for XML Messaging (JAXM) • Java API for XML Processing (JAXP) • Java API for XML Registries (JAXR) • Java API for XML-Based Remote Procedure Call (JAX-RPC) Distributed Systems - Comp 655
Enterprise Java Beans • A server-side component technology • Easy development and deployment of Java technology-based application that are: • Transactional, distributed, multi-tier, portable, scalable, secure, … Distributed Systems - Comp 655
Enterprise Java Beans • Session beans • Represent business processes and data about an interaction with a client • Two types: • Stateless • Stateful • Entity beans (FROZEN at EJB 2.5) • Represent persistent data and data integrity rules • Two types of persistence: • Container-managed persistence • Bean-managed persistence Distributed Systems - Comp 655
3 5 4 JNDI 6 1 2 EJB Object 7 • Request home object • Return home object reference • Request new EJB object NS, eg LDAP • Create EJB object • Return EJB object reference • Invoke method • Delegate request to enterprise bean(s) Invoking an EJB method EJB Container Home Object Client Enterprise Bean(s) Distributed Systems - Comp 655
Message-driven beans • MDB are stateless beans that • Listen for and handle JMS messages • Participate in transactions if necessary • MDB have no • Home interface • Remote interface • Interfaces directly callable by clients (clients just send messages) An MDB tutorial An MDB article Distributed Systems - Comp 655
If you remember one thing • Enterprise beans are • Single-threaded • Ignorant of security • Ignorant of transactions • Ignorant of networking • The container handles all that • Containers tend to be pricey Distributed Systems - Comp 655
Leading EJB containers • Oracle/BEA Weblogic • IBM Websphere • JBoss (open source) • GlassFish (open source) • Geronimo (open source) Distributed Systems - Comp 655
Deployment descriptors • Deferred binding for many of the things the bean developer need not worry about, including • Access control • Transaction requirements • Persistence parameters • Type of bean • Classes used for home and remote interfaces Distributed Systems - Comp 655
Deployment descriptor example <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"> <ejb-jar> <description>Deployment descriptor for the samplemdb JOnAS example</description> <display-name>samplemdb example</display-name> <enterprise-beans> <message-driven> <description>Describe here the message driven bean Mdb</description> <display-name>Message Driven Bean Mdb</display-name> <ejb-name>Mdb</ejb-name> <ejb-class>samplemdb.MdbBean</ejb-class> <transaction-type>Container</transaction-type> <acknowledge-mode>Auto-acknowledge</acknowledge-mode> <message-driven-destination> <destination-type>javax.jms.Topic</destination-type> <subscription-durability>NonDurable</subscription-durability> </message-driven-destination> </message-driven> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>Mdb</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> Distributed Systems - Comp 655
Java EE Distributed Systems - Comp 655
Java EE 6 • Defined by JSR 316 • Adds • JAX-RS (JSR 311) • Web Beans (JSR 299) • Java Authentication SPI for containers (JSR 196) • Removes • EJB Container-managed persistence • JAX-RPC • And other changes • Approved over a variety of concerns and objections Distributed Systems - Comp 655
EJB 3 • Developer does not have to implement EJB interfaces • EJB interface implementations inferred from annotations (for example @Stateless) • In many cases, explicit deployment descriptors are not needed • In many cases, deployment information can be inferred from annotations (for example @Stateless) • Enterprise beans frozen at version 2.5, replaced by Java Persistence API (JPA), based on Hibernate Distributed Systems - Comp 655
EJB 3, continued • In many cases, explicit JNDI lookups are not necessary • In many cases, system can infer the required lookup from annotations (for example, @EJB) Distributed Systems - Comp 655
Web sites (3 of thousands) Sun’s J2EE site: http://java.sun.com/javaee/ Mastering EJB 3.0 (downloadable) EJB design patterns (downloadable) J2EE Architect’s Handbook (downloadable) Distributed Systems - Comp 655
Connector • Defines standard API for integrating J2EE technology with EIS systems • CICS, SAP, PeopleSoft, etc. • Before Connector architecture, each App server has to provide an proprietary adaptor for each EIS system • m (# of App servers) x n (# of EIS's) Adaptors • With Connector architecture, same adaptor works with all J2EE compliant containers • 1 (common to all App servers) x n (# of EIS's) Adaptors
.NET Overview • The problem .NET tries to solve: maximize the sale of server-side licenses by providing a suite of Windows technologies that is • Integrated • Suitable for enterprise applications • Includes all of the basic capabilities for building distributed systems Distributed Systems - Comp 655
.NET Framework • Platform for running .NET managed code in a virtual machine • Provides a very good environment to develop networked applications and Web Services • Provides programming API and unified language-independent development framework .NET Application .NET Framework Operating System + Hardware
The Core of .NETFramework • Common Language Runtime • Garbage collection • Language integration • Multiple versioning support (no more DLL hell!) • Integrated security • Framework Class Library • Provides the core functionality: ASP.NET, Web Services, ADO.NET, Windows Forms, IO, XML, etc.
.NET FrameworkCommon Language Runtime • CLR manages code execution at runtime • Memory management, thread management, etc. Common Language Runtime Operating System
.NET FrameworkBase Class Library • Object-oriented collection of reusable types • Collections, I/O, Strings, … .NET Framework (Base Class Library) Common Language Runtime Operating System
.NET FrameworkData Access Layer • Access relational databases • Disconnected data model • Work with XML ADO .NET and XML .NET Framework (Base Class Library) Common Language Runtime Operating System
.NET FrameworkASP.NET & Windows Forms • Create application’s front-end – Web-based user interface, Windows GUI, Web services, … ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) Common Language Runtime Operating System
ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkProgramming Languages • Use your favorite language C++ C# VB.NET Perl J# … Common Language Runtime Operating System
C++ C# VB Perl J# … ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkCommon Language Specification Common Language Specification Common Language Runtime Operating System
ASP .NET Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML .NET Framework (Base Class Library) .NET FrameworkVisual Studio .NET C++ C# VB Perl J# … Visual Studio .NET Common Language Specification Common Language Runtime Operating System
C# Language – Submitted to ECMA Open Language Specification ASP .NET Web Services Web Forms Mobile Internet Toolkit Windows Forms Web services – XML, SOAP-based ADO .NET and XML .NET Framework (Base Class Library) XML-based data access .NET FrameworkStandards Compliance C++ C# VB Perl J# … Visual Studio .NET Common Language Specification Common Language Runtime Operating System
.NET programming languages Distributed Systems - Comp 655
Key middleware services (.NET) • Communication: SOAP, http, ORPC • Naming: URI, DNS, COM+ Catalog, Windows Registry • Persistence: ADO, OLE-DB • Transactions: MTS • Security: SSL, Kerberos, NTLM Distributed Systems - Comp 655
J2EE vs .NET • Microsoft says: • .NET is faster • You write less code and easier code with .NET • www.gotdotnet.com/team/compare/default.aspx • Sun says: • .NET is a closed system • .NET is immature • .NET lacks community • java.sun.com/features/2002/07/rimapatel.html (NOTE: this is getting old)(Java in grade school?) Distributed Systems - Comp 655
J2EE vs .Net continued • IBM says • Only 26% of mid-market companies have Windows only • .Net locks you into Windows • Microsoft competes with its partners • Our WebSphere-based J2EE platform is cheaper than a comparable server-side .Net platform • Read all about it Distributed Systems - Comp 655
Web Services • Where middleware systems meet • The idea: allow clients to find and interact with services over the web without regard to how the clients or services are built • How do you do that? With standards … • This is a MAJOR industry bandwagon, as you probably know Distributed Systems - Comp 655
SOAP overview Protocols include HTTP, SMTP, TCP, MSMQ, … What’s the difference between RPC and request/ response? Distributed Systems - Comp 655
SOAP intermediaries Distributed Systems - Comp 655
SOAP is (v1.2) SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation specific semantics. msdn.microsoft.com/library/default.asp? url=/library/en-us/dnsoap/html/understandsoap.asp Distributed Systems - Comp 655
SOAP message structure <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- optional --> <!-- header blocks go here... --> </soap:Header> <soap:Body> <!-- payload or Fault element goes here... --> </soap:Body> </soap:Envelope> Distributed Systems - Comp 655
SOAP message example <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> Distributed Systems - Comp 655
SOAP response message example <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFundsResponse xmlns:x="urn:examples-org:banking"> <balances> <account> <id>22-342439</id> <balance>33.45</balance> </account> <account> <id>98-283843</id> <balance>932.73</balance> </account> </balances> </x:TransferFundsResponse> </soap:Body> </soap:Envelope> Distributed Systems - Comp 655
SOAP error message example <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Insufficient funds</faultstring> <detail> <x:TransferError xmlns:x="urn:examples-org:banking"> <sourceAccount>22-342439</sourceAccount> <transferAmount>100.00</transferAmount> <currentBalance>89.23</currentBalance> </x:TransferError> </detail> </x:TransferFunds> </soap:Body> </soap:Envelope> Distributed Systems - Comp 655
SOAP extensibility example <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- security credentials --> <s:credentials xmlns:s="urn:examples-org:security"> <username>dave</username> <password>evad</password> </s:credentials> </soap:Header> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> Distributed Systems - Comp 655
Must-understand <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- security credentials --> <s:credentials xmlns:s="urn:examples-org:security" soap:mustUnderstand="1" > <username>dave</username> <password>evad</password> </s:credentials> </soap:Header> ... Distributed Systems - Comp 655
SOAP in HTTP Distributed Systems - Comp 655