ICS 237- Distributed Systems Middleware Nalini Venkatasubramanian

Slides:



Advertisements
Similar presentations
JINI Shashwat Shriparv InfinitySoft.
Advertisements

THE JINI TECHNOLOGY Alessio Zumbo
The road to reliable, autonomous distributed systems
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
Introduction to Java 2 Enterprise Edition About myself –Neutrinos, Cancer Research, IT Applications Today’s topic: J2EE –Context –Advantages –Components.
Technical Architectures
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
1. Introducing Java Computing  What is Java Computing?  Why Java Computing?  Enterprise Java Computing  Java and Internet Web Server.
Copyright W. Howden1 Lecture 19: Intro to O/O Components.
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
2 Systems Architecture, Fifth Edition Chapter Goals Describe client/server and multi-tier application architecture and discuss their advantages compared.
J2EE Kenneth M. Anderson CSCI Web Technologies October 3, 2001.
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
EJB. Component Characteristics An enterprise Bean typically contains business logic that operates on the enterprise’s data. An enterprise Bean’s instances.
Presented by Mark Miyashita
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
Replication & EJB Graham Morgan. EJB goals Ease development of applications –Hide low-level details such as transactions. Provide framework defining the.
Enterprise JavaBeans. Lesson 1: Introduction to Server-Side Component Software.
Introduction to J2EE Architecture Portions by Kunal Mehta.
January 26, Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Jini Architecture Introduction System Overview An Example.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
Jini Architectural Overview Li Ping
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Enterprise Computing with Jini Technology Mark Stang and Stephen Whinston Jan / Feb 2001, IT Pro presented by Alex Kotchnev.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
Internet and Distributed Application Services
J2EE Platform Overview (Application Architecture)
Netscape Application Server
Introduction to Advanced Java Programming
Java Servlets By: Tejashri Udavant..
CHAPTER 3 Architectures for Distributed Systems
Introduction to J2EE Architecture
#01 Client/Server Computing
Enterprise Service Bus (ESB) (Chapter 9)
Distributed System Using Java 2 Enterprise Edition (J2EE)
Understanding and Designing with EJB
Lecture 1: Multi-tier Architecture Overview
Inventory of Distributed Computing Concepts
Chapter 40 Remote Method Invocation
Bina Ramamurthy Chapter 9
An Introduction to Software Architecture
Bina Ramamurthy Chapter 9
Web Application Server 2001/3/27 Kang, Seungwoo. Web Application Server A class of middleware Speeding application development Strategic platform for.
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Bina Ramamurthy Chapter 9
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
Chapter 46 Remote Method Invocation
Component-based Applications
Introduction to Web Services
Understanding and Designing with EJB
Java Remote Method Invocation
Knowledge Byte In this section, you will learn about:
Intro to J2EE Concepts.
#01 Client/Server Computing
Presentation transcript:

ICS 237- Distributed Systems Middleware Nalini Venkatasubramanian JINI ICS 237- Distributed Systems Middleware Nalini Venkatasubramanian

Java RMI Java communication Sockets RPC RMI 3 processes pt-to-pt, duplex Pre-determined format, protocol RPC Abstract to procedure call Standard data representations RMI Object oriented RPC RPC+Java serialization to pack objects 3 processes Client Server RMI registry Remote class must extendsRemote interface Server extends java.rmi.server.UnicastRemoteObject rmic compiler stub and skeleton generation Other Issues Serialization Exception handling Constructors public interface PrintService extends Remote { int print(Vector printJob) throws RemoteException; }

Java Serialization Store and retrieve objects Capture enough state for reconstruction Generate a bytestream Java interfaces for serialization java.io.Serializable: default serialization mechanism java.io.Externalizable: custom serialization Serialize to file, serialize an entire class

Jini Motivation Need a distributed system based on the idea of federating groups of users and the resources required by those users. Need an open software architecture that enables the creation of network-centric solutions which are highly adaptive to change. Middleware solution to build adaptive networks that are scalable, evolvable and flexible as typically required in dynamic computing environments.

Jini – Java Middleware Network extension of Java Users share services and resources over a network Easy access to resources anywhere on the network while allowing network location of the user to change Simplifying the task of building, maintaining, and altering a network of devices, software, and users Support true plug and play in LAN-based networked systems SOHO (small office, home office environments) ROHO (remote office, home office environments) System of federated users and resources Appears to users as a single system A client/resource/service may belong to more than one Jini system at a time The Jini system extends the Java™ application environment from a single virtual machine to a network of machines. The Java application environment provides a good computing platform for distributed computing because both code and data can move from machine to machine. The environment has built-in security that allows the confidence to run code downloaded from another machine. Strong typing in the Java application environment enables identifying the class of an object to be run on a virtual machine even when the object did not originate on that machine. The result is a system in which the network supports a fluid configuration of objects which can move from place to place as needed and can call any part of the network to perform operations.

Environmental Assumptions Existence of a network of “reasonable speed” Network latency is also “reasonable” Connected devices have “some memory and processing power” Those that don’t must have a Jini proxy that does have memory and processing power Needs the Java Environment Members are assumed to agree on basic notions of trust, administration, identification, and policy. The Jini system federates computers and computing devices into what appears to the user as a single system. Any programming language can be supported by a Jini system if it has a compiler that produces compliant bytecodes for the Java programming language.

Jini Advantages

Jini Structure

Services Anything that can be used in a Jini system Entity used by a person, program, another service, storage… Utilized through a Service Protocol Set of interfaces written in Java Services carry the code needed to use them A small set of protocols is predefined e.g. Discovery, Join, Lookup Communication happens through RMI Allows for objects and code to be sent around the network It is an entity that can be used by a person, a program, or another service computation, storage. It can be a communication channel to another user, a software filter, a hardware device. Examples: printing a document, translating from one word-processor to another Jini is not a system consisting of client and servers. It is system consisting of services that can be collected together for the performance of a particular task.

What Jini is not Not just RMI Jini is not just a name server Jini is not a system consisting of client and servers. It is system consisting of services that can be collected together for the performance of a particular task. Jini is not JavaBeans JavaBeans provides a way for software components to find and introspect each other intended for use within a single address space less dynamic (design-time, not runtime) Jini is not EJB similar to Jini but intended to hook together legacy systems covered by Java wrappers to form the back-end business logic of enterprise applications Not a distributed OS

What Jini is Services carry the code needed to use them proxies are dynamically downloaded by clients when they need to use a service A “meta-service” provides access to all other services Lookup services keeps track of all other services in a community. Bootstrapping process to find proxies for the lookup service

Properties Security: incorporates Java’s security models (sandboxing) --integrated into RMI Service discovery and join: service protocols that allows services (both hardware and software) to discover, become part of, and advertise supplied services to the other members of the federation Lookup: from a service repository Entries are downloadable Java objects that act as local proxies to the real service

Jini Overview Jini group: cs237.uci.edu Jini group: public Service Lookup Service Service Lookup Service Service Client Lookup Service Service Service Jini group: cs237.uci.edu Jini group: public

Jini Lookup Service Core/ Central bootstrapping mechanism for the system provides the major point of contact between the system and users of the system. Maps interfaces to objects that implement those interfaces Interface only describes functionality of a service Descriptive entries can be associated with a service to allow more flexible searching Services can appear/disappear in a lightweight way A service is added to a lookup service by a pair of protocols called Discovery and Join. The service locates an appropriate lookup service using the discovery protocol. The service is added using the join protocol.

Lookup Service Service item Attribute Proxy Service item Attribute

Lookup Service Jini Lookup Service is an interface Implementations can incorporate other lookup services Hierarchical Lookup Bridge between lookup services Discover, Join and Lookup Protocols Discover to find a lookup service Join to add to the lookup service Lookup to find a service and use it

Jini Service Discovery

Jini Join & Lookup Protocols

Discovery, Join & Lookup Protocols

Discovery, Join & Lookup Protocols Invocation

Attributes in Jini Attributes are Java objects assigned to service proxies Attributes describe service rich and flexible way for services to annotate their proxies with information describing that service Attribute matching set of rules to determine when attributes match one another template matching for matching against multiple attributes

Discovery Protocol Happens when a device is first connected to the Jini System Used so a device could find/join multiple groups The Unicast Discovery For applications and services that know about particular lookup services. Multicast Request Device looking for Lookup Service in a group Multicast Announce Lookup Service Advertises its presence

Discovery Protocol in Jini Serendipitous discovery Jini allows serendipitous interactions between services and users of those services Service initiated discovery used when a service starts to find all lookup services in its vicinity Lookup service initiated discovery used when a lookup service starts and announces its presence to Jini services Hardwired (Direct discovery) hardwire a Jini service to a lookup service

Discovery uses Multicast Uses IP multicast based on UDP/IP each message has a scope (distance) associated with it. Mcast address used for one set of hosts invisible to another set using same mcast address promotes efficiency in routing set IP TTL (how many hops) parameter

Discovery: An Example Lookup Service Discovering Entity other Group Request Lookup Service other Group Discovering Entity Request Connects and Registers the Lookup Service with the entity Request Lookup Service public Group Lookup Service public Group Muticast Request for Group: public

Join Protocol Registers a service with a Lookup Service in a Jini System Each Service has a list of properties, Service ID, Attributes, a list of groups to register with, etc. Uses Discovery to find Lookup Services Maintains a list of Lookup Services to register with Registers with all Lookup Service that responds Creates a lease during registration, which is renewed periodically

Lookup Protocol Client queries the Lookup Service Find a service by name, or attributes Receive a copy of the service interface onto the client Client interacts with service through this “proxy” object Client also gets a lease on the service

Join and Lookup: An Example Lookup Service Service Object Service Attributes Client Service Lookup Join Service Object Service Object Client uses Service Service Attributes Join: Service object is registered. Copy sent to reside on Lookup Service through RMI Lookup: Service is copied to Client Service Object acts a proxy

Service Architecture The service object on the client communicates with Service by: RMI Local implementation Combination of the above (smart proxy) From client point of view: Services look the same across the network or in local address space All services are Java objects

Security Based on principals and access contol lists Services accessed on behalf of some entity- the principal Usually traces back to the user Access is determined through an ACL associated with an object

Programming Model The leasing interface defines a way of allocating and freeing resources using a renewable, duration-based model The event and notification interface an extension of the event model used by JavaBeans™ components to the distributed environment that enables event-based communication between Jini services Transaction interfaces enable entities to cooperate in such a way that either all of the changes made to the group occur atomically or none of them occur Jini provides an interface for two-phase commit transactions Does not provide implementation Does not define semantics of transactions Only provides protocol to coordinate Leasing The lease interface extends the Java programming language model by adding time to the notion of holding a reference to a resource, enabling references to be reclaimed safely in the face of network failures. Event The event and notification interfaces extend the standard event models used by JavaBeans components and the Java application environment to the distributed case, enabling events to be handled by third-party objects while making various delivery and timeliness guarantees. The model also recognizes that the delivery of a distributed notification may be delayed. Transaction The transaction interfaces introduce a light-weight, object-oriented protocol enabling Jini applications to coordinate state changes.

Transactions in Jini Create a transaction Jini transactionFactory object to create a transaction object to hold grouped operations pass to it all the transactions to be grouped tell to try to execute all operations atomically, which will either succeed or fail commit() call

Jini Events Allows an object in one JVM to register for events occurring on another Possibly across a network Can register for different kinds of events Can schedule notifications Provides interfaces that implement a protocol No guarantees made interfaces, only by implementations

Leasing Set of interfaces that allow time-based resource allocation Guarantees access to a service while lease is in effect Can be renewed (depends in the service) Can be exclusive or non-exclusive Lease can be cancelled or it automatically expires at the end of the terms of the lease

Component Overview

JINI summary Federate devices and software components into a single, dynamic distributed system Service: an entity that can be used by a person, a program, or another service Lookup Service: discovery, join, lookup RMI: Remote Method Invocation Security: principal, access control list Leasing: a grant of guaranteed access over a time period Transactions Events Service: Jini systems provide mechanisms for service construction, lookup, communication, and use in a distributed system. Services in a Jini system communicate with each other by using a service protocol, which is a set of interfaces written in the Java programming language. Security: Jini services are accessed on behalf of some entity—the principal—which generally traces back to a particular user of the system. Leasing: Access to many of the services in the Jini system environment is lease based. Leases are either exclusive or non-exclusive.

Java-based Enterprise Platforms and Middleware J2EE and EJB

Motivation New multi-tier enterprise computing model in web environment A way to bring in different elements of enterprise application: Web interface design Transaction processing Meeting non-functional system requirements: Availability, reliability, extensibility, performance, scalability, reusability, interoperability Timely development and deployment

Introduction Platform introduced - 1999 J2SE – Java 2 Standard Edition Java for the desktop / workstation http://java.sun.com/j2se J2ME – Java 2 Micro Edition Java for the consumer device http://java.sun.com/j2me J2EE - Java 2 Enterprise Edition Java for the server http://java.sun.com/j2ee

What is J2EE? A Multi-tiered distributed application model A collection of Standards: JDBC, JNDI, JMX, JMS A Component Technology: EJB An Application Server

J2EE Architecture

J2EE Tiers Client Presentation HTML or Java applets deployed in Browser XML documentations transmitted through HTTP Java clients running in Client Java Virtual Machine (JVM) Presentation Logic Servlets or JavaServer Pages running in web server Application Logic Enterprise JavaBeans running in Server

J2EE Components and Services Java Servlets JavaServer Pages (JSP) Enterprise JavaBeans (EJB) Standard services & supporting technologies Java database connectivity(JDBC) data access API Java Messaging Service (JMS) (Remote Method Invocations (RMI)) Extensible Markup Languages(XML) JavaIDL (Interface Description Language) JavaMail Java Security CORBA technology Design Patterns

J2EE Clients Web Clients (thin clients): dynamic web pages and a web browser Applets: Client application in Java that runs on JVM on the web browser Application Clients: Runs on a client machine to provide a way for users to handle tasks that require a richer user interface

J2EE Server

Enterprise Information System Tier Information Infrastructure for an enterprise Handles enterprise information system software and includes enterprise infrastructure systems such as enterprise resource planning (ERP) Necessary to ensure transactional access to EIS system from various applications

J2EE Containers An interface between a component and a low-level platform specific functionality

J2EE APIs Enterprise JavaBeans Technology 2.0 JDBC API 2.0 Java Servlet Technology 2.3 Java Server Pages Technology 1.2 Java Message Service 1.0 Java Naming and Directory Interface 1.2 Java Transaction API 1.0 Java Mail API 1.2 Java API for XML Processing 1.1 Java Authentication &Authorization Service 1.0

What is Java Servlet? Conforms to Java Servlet API in J2EE Container managed Web Component Generate dynamic response to requests from web based clients Synchronize multiple concurrent client request

What is Java Server Pages? Conforms to J2EE Web Application Web Component that sits on top of Java Servlet mode Dynamically generates Web pages based on HTML, XML Text based documents describe how to process a request and create a response

Enterprise JavaBeans A Server side distributed transaction component architecture for J2EE Standard component model for application servers EJB enables rapid and simplified development of distributed, transactional, secure and portable Java applications.

EJB Architecture

Remote Interface WebAddressAccount.java defines the business methods that a client may call. The business methods are implemented in the enterprise bean code public interface WebAddressAccount extends EJBObject { public String getUrlName(); public String getUrlDescript(); }

Home Interface } WebAddressAccountHome.java defines the methods that allow a client to create, find, or remove an enterprise bean public interface WebAddressAccountHome extends EJBHome { public WebAddressAccount create(String urlName, String urlDescript); public WebAddressAccount findByPrimaryKey(String urlName) ; }

Enterprise Bean Class WebAddressAccountBean.java implements the business methods public class WebAddressAccountBean implements EntityBean { public String getUrlName() { return urlName; } public String getUrlDescript() { return urlDescript; } public String ejbCreate( String urlName, String urlDescript) { insertRow( urlName, urlDescript); } public String ejbFindByPrimaryKey(String primaryKey) { result = selectByPrimaryKey(primaryKey);

Thin Client Design Model

Session Beans Represents business rules or process Perform work for individual clients on the server Encapsulate complex business logic Can coordinate transactional work on multiple entity beans 2 types: Stateful and Stateless

Entity Beans Represents business model data Persisted in storage system ( usually Database) Might contain Application logic intrinsic to entity Maps business data to java class

Example of EJB Application Consider a distributed Airline Travel Reservation System

Example: Use Case Diagram

Classes

EJB Representation

EJB Packaging Packed in a jar file Factory Proxy XML Deployment Descriptor

Bean Provider

Application Assembler

Deployer

Service/ Container Provider

Travel Reservation System: Bean Provider

Application Assembler

Deployment in a target container

Features Portable Contained and Managed at Runtime Simplifies the complexity of building n-tier application Scalable & distributable Easy to upgrade and maintain

References http://www.scribd.com/doc/6173018/J2EE-Tutorial http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Overview6.html http://download.oracle.com/docs/cd/B31017_01/migrate.1013/b25219/overview.htm http://en.wikipedia.org/wiki/J2ee http://rangiroa.essi.fr/cours/ejb/00-ejbcodecamp_ch1of6.PDF