What is Jgroup?

Download Report

Transcript What is Jgroup?

The Jgroup Project
Alberto Montresor
Ozalp Babaoglu
University of Bologna - Italy
Department of Computer Science
© 2002 Alberto Montresor
1
Introduction
 What is Jgroup?
•
A group communication toolkit developed at the University
of Bologna
 Main characteristics:
•
Partition-aware group membership
•
Written in Java
•
Tightly integrated with Java RMI
•
Partially integrated with Jini
•
Can be integrated with J2EE!
 Please note:
•
Still a prototype: never reached the stability of other
toolkits
© 2002 Alberto Montresor
2
Brief History
 1997-1999
•
Specification and implementation of the main Jgroup core
Group Membership, View Synchrony, Merging Support
 2000
•
Integration with Java RMI started
•
First contacts with Sun RMI group
 2001-2002
•
Collaboration with Sun on a new RMI API and framework
•
(Partially) integrated in JDK 1.4
•
Downloadble as separate module
(Jeri project in Jini)
© 2002 Alberto Montresor
3
The Object Group Paradigm
 Object group:
• A dynamic collection of server objects that cooperate in
order to deliver some service and maintain shared state
 Group method invocations:
• Refer to the act of invoking a method on an object group
• The method is executed by a certain number of servers in
the object group, depending on the invocation semantics
Object
Group
Client
Server
Server
Server
© 2002 Alberto Montresor
4
Group Method Invocation (GMI)
 Internal GMI
•
For “closed” communication among members of a group
•
Two types:
• Synchronous: return value is an array
• Asynchronous: returns void; values returned through callback
 External GMI
•
For “open” communication originated from external clients
•
Two types:
• Anycast: one member executes the invocation; useful for
read operations
• Multicast: all members execute the invocation; useful for
write operations
© 2002 Alberto Montresor
5
Synchronous Internal Invocations
int[] values =
int getValue() {
group.getValue();
// return value
}
Synchronous invocation
S1
S2
S3
© 2002 Alberto Montresor
6
Asynchronous Internal Invocations
ValuesCB cb = new ValuesCB();
int getValue() {
group.getValue(cb);
public class ValuesCB
implements Callback {
void results(Object value){...}
}\
// return value
}
S1
S2
S3
© 2002 Alberto Montresor
7
External invocations: example
C1
S1
S2
S3
C2
Multicast invocation:
Anycast invocation:
table.bind(“name”, obj); table.lookup(“name”);
© 2002 Alberto Montresor
8
View Synchrony
 View Synchrony
All servers that survive from one view to the same next view
execute the same set of invocations in the original view
 View synchrony does not admit executions like this:
S1
S2
S3
S4
© 2002 Alberto Montresor
9
Java RMI
 Java RMI protocol:
enables objects residing in different JVMs to communicate
through remote method invocations
Client
Server
method()
return x
Server-side
RMI Runtime
Stub
JVM1
JVM2
Network
© 2002 Alberto Montresor
10
Extending Java RMI
 RMI group at Javasoft designed Java RMI in order to be
extensible
•
The RemoteRef interface enables programmers to write
their own references to remote objects on the client-side
 Unfortunately, RemoteRefs were not sufficient
•
There was no possibility to modify the behavior of RMI on
the server side
Client
Stub
RemoteRef
© 2002 Alberto Montresor
Server-side
RMI Runtime
Server
11
The Jgroup Approach (Previous Version)
Client
Server
Statically generated –
implements the remote
interface
Client
Proxy
Server
Method
dispatchers
Server
Proxy
Server
Proxy
Multicast
RMI Stub
RMI Stub
RMI
Fixed stub for server proxy
© 2002 Alberto Montresor
Server-side
RMI Runtime
Server-side
RMI Runtime
12
Designing a New Java RMI API
 Java Software Requesto 078: a new Java framework
•
Fully customizable, on both the client- and the server-side
•
Based on Dynamic Proxy Classes (JDK 1.3)
(No need for static stub generators)
•
Two different versions:
• One-to-one (remote method invocations)
• Voted down in JSR-078
• Being included in the "Davis" release of Jini
• One-to-many (group method invocations)
• To be developed...
•
We partecipated in the Java software process
© 2002 Alberto Montresor
13
Jini Extensible Remote Invocation (JERI)
Client
Server
foo()
bar()
foo()
bar()
Dynamically Compiled
Stub
invoke()
Invocation
Handler
Dispatcher
dispatch()
executeCall()
ObjectEndpoint
© 2002 Alberto Montresor
ServerEndpoint
network
communication
14
Jgroup with 1-to-1 Customizable RMI
Client
Server
Server
Jgroup Server
Proxy
Jgroup Server
Proxy
Customized
InvocationHandler
and Dispatcher
Jgroup Client
Proxy
RMI
© 2002 Alberto Montresor
Jgroup
Multicast
15
Jgroup with 1-to-Many Customizable RMI
Client
Server
Server
Server
Jgroup Server
Proxy
Jgroup Server
Proxy
Jgroup Server
Proxy
Customized
ObjectEndpoint
and ServerEndpoint
Jgroup Client
Proxy
Multicast RMI
© 2002 Alberto Montresor
16
Thank You!
http://cs.unibo.it/projects/jgroup
© 2002 Alberto Montresor
17