Download architecture

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Jini™ Technology:
Architecture and
Programming Model
Jim Waldo
Senior Staff Engineer
Sun Microsystems, Inc.
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
A New Architecture
• Both hardware and software
– Everything is an object
– Everything is accessed through an interface
• Network and language centric
– Data and code come from the network
– The Java™ language is assumed to be
everywhere
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Philosophy
• Less is more
– The simplicity of object-oriented design
– RMI extends objects to the network
• Language-based system
– Java language forms a conceptual frame
– No division between network and
programming types
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Unifying Architecture
• Designed for the network
– Code and data move, as appropriate
– Appropriate for everything
- Devices
- Large servers
- Software
• Everything is an object
– Hardware and software are services
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Goals of the Jini System
• Enable spontaneous networking
– Plug in and join
– Unplug and heal
• Provide reliable networks
– Individual services more reliable
– System independence from any single point of
failure
• Above all, simplicity
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Extending the Java Platform
Infrastructure
Java
Java VM
RMI
Jini
Discovery
Lookup Service
Lets objects find
and communicate with
each other,
Programming
Model
Services
Beans
Swing
...
EJB
JNDI
JTS
...
Leasing
Transactions
Distributed Events
Distributed Security
JavaSpaces
Transaction Manager
...
add simple APIs for
Remote Objects and
Basic Distributed
Computing, and
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
then everything else
is a service.
The Jini Infrastructure
• RMI extends objects to the platform
– Allows moving code and data
– Merges agent technology with traditional RPC
• Federation through Discovery, Join,
and Lookup
– Provides the place for services to advertise
– Provides the mechanism for finding that place
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Service Registration
Discovery Request
Service
Proxy
Object
Discovery Response
Service registration
Jini service
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Lookup Service
Service Lookup
Discovery Request
Discovery Response
Lookup Request
Service
Proxy
Object
Lookup Response
Jini client
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Lookup Service
Client/Service Interaction
Jini Client
Jini Service
Service
Proxy
Object
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Leaving a Jini Federation
• Services can cancel Lookup
registration
• A registration lease can run out
• No administer is required
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Federation, not Central
Control
• Not an operating system
• Defines minimal interaction rules
– How to join, rendezvous
– Group interaction patterns
– All else left to consenting clients and services
• Designed to work with existing OSs
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Programming Model
• Three major interfaces
– Distributed events
– Transactions/two phase commit
– Leasing
• Center on interaction patterns
• Define what, not how
– All are interfaces
– Services implement as best for them
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Distributed Events
• Extends AWT/JavaBeans event model
– Allows third-party delivery services
– Does not assume timely delivery
• Makes use of mobile objects
– Notifications can include an object
– This object can include behavior
– Defers both when and what action is taken in
response to an event
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Notification Class
public class RemoteEvent extends java.util.EventObject{
public RemoteEvent(Object source,
long eventID,
long seqNum,
MarshalledObject handback);
public Object getSource();
public long getID();
public long getSequenceNumber();
public MarshalledObject getRegistrationObject();
}
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Remote Listener Interface
public interface RemoteEventListener extends Remote,
java.util.EventListener
{
void notify(RemoteEvent theEvent)
throws UnknownEventException,
RemoteException;
}
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Transactions
• Allow multi-object coordination
–
–
–
–
Standard two-phase commit
No participant implementation guarantees
Designed for a mixed environment
Non-standard semantics supported
• Participant and manager interfaces
– Transaction manager presented as a service
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Transaction Participant
public interface TransactionParticipant
extends Remote, TransactionConstants
{
int prepare(TransactionManager mgr, long id)
throws UnknownTransactionException,
RemoteException;
void commit(TransactionManager mgr, long id)
throws UnknownTransactionException,
RemoteException;
void abort (TransactionManager mgr, long id)
throws UnknownTransactionException,
RemoteException;
int prepareAndCommit(transactionmanager mgr, long id)
thrrows UnknownTransactionException,
RemoteException;
}
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Leasing
• Introduces time to resource allocation
– Allocation requests for a duration
– Grant duration <= request duration
• Leases can be
– renewed (granter choice)
– cancelled (holder choice)
• Leases can expire
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Leasing Interface
public interface Lease {
long getExpiration();
void cancel() throws UnknownLeaseException,
RemoteException;
void renew(long duration)
throws LeaseDeniedException,
UnknownLeaseException,
RemoteException;
void setSerialFormat (int format);
int getSerialFormat();
LeaseMap createLeaseMap(long duration);
boolean canBatch(Lease lease);
}
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Why this model?
• Defines network interactions
– Simple
– Help in developing reliable distributed
applications
– Defines object interactions, not
implementations
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Services
• Represented by interfaces
– Implement in hardware or software
– Implementations can change over time
• Set of services open ended
–
–
–
–
Devices
Software services
Business objects
etc.
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Existing Services
• JavaSpaces
– A network object repository
– Something between a file and a database
• Transaction manager
– Default service implementation
– Runs voting protocol
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Service Interfaces
• Still to be defined
– Network storage
– Printing
– etc., etc.
• Don’t have to be done by Sun
• Only base types need to be common
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Legacy Services
• Jini requires Java at the network
– Services identified by Java type
– Proxies may need code downloaded
• Implementation can be non-Java
– Wrap legacy language in Java
– Make calls to legacy with JNI
• Turns language independence around
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
In Summation
• Simple
• Object-oriented
• Java based
• Network centric
• Service architecture
January 26, 1999--Jim Waldo Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Related documents