jini: what it is, how we use it, and where ... - talking java · jini: what it is, how we use it,...

17
Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael Ogg CTO, Valaran Corporation http://www.valaran.com [email protected]

Upload: others

Post on 30-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini: What it is, how we use it, and where it's going

Philadelphia Area Java Users' GroupDecember 12, 2001

Michael OggCTO, Valaran Corporation

http://[email protected]

Page 2: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini Overview

• v1.0 Announced by Sun Microsystems Jan. 1999• Marketed as “ubiquitous computing”• Main concepts very simple:

– All objects (service) defined by java interface– Lookup based on object type (not name)– Registration means depositing proxy code– Decoupling of object model from wire protocol

– Nothing is forever: registration receives lease– Objects register to receive remote events– Attributes can be attached to objects

• Java is “natural” – but services need not be java

Page 3: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Consequences of Design

• Jini enables spontaneous, self-healing systems– Discovery, reflection, lease expiration

• Intrinsically scalable– Point-point invocation, remote events

• Dynamic, flexible, changeable– Mobile, replaceable proxies

• Heterogeneous in language, protocol– Wire protocol decoupled from use (java interface)

• Resilient, no single point of failure– Use multiple lookup services

• Objects can carry their own descriptions, UI, etc.– Attributes

Page 4: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini in a Nutshell

Service

Proxy

Lookup Service

Proxy

Client

ProxyLocal Method Arbitrary Protocol

Page 5: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini in a Nutshell

Service

Proxy

Lookup Service

Proxy

Client

ProxyLocal Method Arbitrary Protocol

Agent

Page 6: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

More Details - 1

• Service finds Lookup Service – LS finds Service– Service multicasts LS-discovery datagram to LS– LS multicasts LS-announce datagram to Services– All LS instances eventually get all Service registrations– All Services eventually get all LS proxies

• Datagram contains host:port for unicast discovery– Only bootstrapping is knowledge of discovery protocol

• Lease renewal ensures liveness– Expiration removes stale references– All LS instances eventually consistent– Lease time negotiated between LS and Service. Can

change dynamically

Page 7: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

More Details - 2

• Proxy is mobile java code. Implements– java.rmi.Remote for “trivial” RMI/JRMP object– java.io.Serializable for any other protocol– Proxy byte code from ClassLoader or http

• Remote Events: peer-peer events across JVMs– Listener registers with source, and receives lease– Event notification can be delegated to 3rd party– Events can be multicast to several listeners

• Attributes allow objects to carry extra information– Implements net.jini.core.entry.Entry– Can be descriptive, UI, include html docs, etc.

Page 8: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

More Details - 3

• Additional properties:– Transaction support (lease expires at end of transaction)

– Javaspaces related service for global object repository

– Event mailbox, Lease renewal manager in v1.1

• Jini characterized by its light weight– Contains enough for robust distributed computing– And no more

• For the full story: http://www.sun.com/jini

Page 9: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Architectural Concepts

• Based on distributed service architecture

• All components (services) are modeled as a Jini service with a Java interface

• The services are comprised of: 1. Core (framework) native services

2. Legacy services with adaptors (proxies)

• The Business Process is the (distributed) application

• The logic controlling that Business Process can be in zero, one, or several Jini services

Page 10: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Service Infrastructure

System Services

Surrogates

Adapters

Application Services

Process Modeler

Rule Engine

Console

Legacy/Non-Jini Systems

Service UI Service Proxies

Application Clients

Object Communications

Store and Forward

Publish/ Subscribe

Remote Events

Method Invocation

Secure Transport

Web Browser

HTTP Gateway (HTML, XML)

Framework Services

Limited Devices

Service Browser

Business Rules Automation

Service-Based Architecture

Page 11: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Creating Jini Services

For everything that is not a Jini Service:

• Create a Jini Service:

1. Model the behavior with a Java interfaceWill it be a Remote or Serializable proxy?

1. Implement the proxyWhere is the proxy instantiated?

Where does the proxy execute?

1. Deploy the proxy

Page 12: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

For example: a device that is controlled by a string sent to a “well-known” UDP port

public interface MyDevice {

public void send(String msg)

throws java.io.IOException;

}

Example of Jini Interface

Page 13: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Example of Jini Proxy

public class MyDeviceProxy

implements MyDevice, java.io.Serializable {

...

public void send(String msg) throws java.io.IOException {

byte[ ] buff = msg.getBytes();

DatagramPacket datagram =

new DatagramPacket(buff, buff.length, host, port);

getSocket().send(datagram);

}

}

Page 14: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Fine Grain NGOSSTM Architecture Framework

ValaranValaranRuleRule

ServiceService

ResourceResourceServiceServiceControllerController

ServiceServiceContainerContainer

Turin Traverse Node

Turin Card

ValaranValaranConsoleConsole

DoradoDoradoRed CellRed CellTopologyTopology

SystemSystem ControllerController

ServiceService

SwitchSwitchCardCard

ServiceService

InterlinkInterlinkAAA ServerAAA Server

NetworkNetworkControllerController ServiceService

IntaMissionIntaMissionJavaSpaces ServiceJavaSpaces Service

(IntaSpaces)(IntaSpaces)

Work SpaceWork SpaceServiceService

DispatcherDispatcherServiceService

AvatarAvatarServiceService

UserUserWork SpaceWork Space

DirectoryDirectoryServiceService

SecuritySecurity TransactionTransaction LogLog

Intelliden Directory

Traverse Java Jini Interface

BlazeAdvisorBlazeAdvisorRule EngineRule Engine

Valaran Framework Services

WorldComWorldComDOCDOC

Product CatalogueProduct CatalogueServiceService

Sun Jini look UpSun Jini look UpDirectory Service Directory Service

PersistencePersistence

BillingBillingServiceService

Physical InventoryPhysical InventoryServiceService

WWW

Page 15: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini/CORBA Comparison

Jini CORBALookup Service Name Service

Stored by Class, Attribute Objects stored by name (string)

Resolves to Stub or Proxy Resolves to IOR

Lookup Service found by multicast NS found by "well known" IOR

Object in LS until lease expires Object in NS until removed

Any transport IIOP "natural" transport

Decentralized event listeners Centralized Event Service

Dynamic object architecture Static object architecture

Page 16: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Jini is Meta-Middleware

• CORBA (or other proprietary systems) forces specific protocols

• Jini is protocol-agnostic– Entire system may be Jini

– Or Jini can interconnect protocol islands

• In particular, Jini can interconnect unmodified legacy services– Legacy service: client-side proxy

– Legacy client: server-side proxy– Legacy service & client: client & server-side proxies

• Jini does not distinguish hardware and software

Page 17: Jini: What it is, how we use it, and where ... - talking Java · Jini: What it is, how we use it, and where it's going Philadelphia Area Java Users' Group December 12, 2001 Michael

Where is Jini Heading?

• Next release, JSK 1.2 (aka Alewife) December 2001

• JSK 1.3 (Davis) planned early 2003

• Davis available for review now

• Jini Community is a thriving organization

• Jini Decision Process, JDP, established

• Follow it at:

http://www.jini.org