Title: OASIS Team
1 ProActive PDC - MOP - JOnAs
- OASIS Team
- INRIA -- CNRS - I3S -- Univ. of Nice
Sophia-Antipolis - www.inria.fr/oasis/ProActive
- Francoise Baude, Denis Caromel, Fabrice Huet,
Julien Vayssiere, - Alexandre Bergel, Olivier Nano (IC2D)
- Mickael Bartorello, Helene Manguin, (ProActive -
Interactions) - Nico Guillier, Alexandre Guyot, Laurent Vaills
(ProActive - EJB) - 1. ProActive Non Functional
properties - 2. 1.MOP and 2. Meta-Objet
for Distribution - 3. IC2D
- 4. ProActive and EJB JOnAS
2Non Functional Properties
- Currently in ProActive
- Remotely accessible Objects
- (Classes, not only Interfaces, Dynamic)
- Asynchronous Communications, Futures
- Migration
- Visualization and monitoring (IC2D)
- Others
- Security (worked on)
- Group Communications (thinking about it)
- Communications with disconnected mode
31. ProActive PDC Objectives and Rationale
Seamless
Sequential
Multithreaded
Distributed
- Most of the time, activities and distribution are
not known at the beginning, and change over time - Seamless implies reuse, smooth and incremental
transitions
Library !
4ProActive model
- Active objects coarse-grained structuring
entities (subsystems) - Each active object - possibly owns many passive
objects - - has exactly one thread.
- No shared passive objects -- Parameters are
passed by deep-copy - Asynchronous Communication between active objects
- Future objects and wait-by-necessity.
- Full control to serve incoming requests
(reification)
5ProActive Active object
Standard object
- An active object is composed of several objects
- The object itself (1)
- The body handles synchronization and the
service of requests (2) - The queue of pending requests (3)
1
Objet
Active object
Proxy
Object
1
2
Body
6ProActive Creating active objects
Single inheritance using interface
- An object created with A a new A (obj, 7)
- can be turned into an active object
- Class-based
-
- class pA extends A implements Active
- A a (A)ProActive.newActive(pA,params,
node) - The most general case. Allows to provide a
specific behavior. - Instanciation-based
- A a (A)ProActive.newActive(A,params,
node) - Object-based
- A a new A (obj, 7)
- a (A)ProActive.turnActive (a, node)
7ProActive Reuse and seamless
- Two key features
- Polymorphism between standard and active objects
- Type compatibility for classes (and not only
interfaces) - Needed and done for the future objects also
- Dynamic mechanism (dynamically achieved if
needed) - Wait-by-necessity inter-object synchronization
- Systematic, implicit and transparent futures
- Ease the programming of synchronizations,
and the reuse of routines
82. ProActive Migration of active objects
- Migration is initiated by the active object
itself through a primitive migrateTo - Can be initiated from outside through any public
method -
- The active object migrates with
- all pending requests
- all its passive objects
- all its future objects
- Automatic and transparent forwarding of
- requests (remote references remain valid)
- replies (its previous queries will be
fullfilled)
9Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
10Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
11Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
12Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
direct
13Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
forwarder
direct
14Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
forwarder
direct
15Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
forwarder
direct
16Characteristics and optimizations
- Same semantics guaranteed (RDV, FIFO order point
to point, asynchronous) - Safe migration (no agent in the air!)
- Local references if possible when arriving within
a VM - Tensionning (removal of forwarder)
direct
forwarder
direct
17ProActive API for Mobile Agents
- Mobile agents (active objects) that communicate
- Basic primitive migrateTo
- public static void migrateTo (String u)
- // string to specify the node (VM)
- public static void migrateTo (Object o)
- // joinning another active object
- public static void migrateTo (Node n)
- // ProActive node (VM)
- public static void migrateTo (JiniNode n)
- // ProActive node (VM)
182.1 ProActive architecture a simple MOP
- MOP (Meta-Object Protocol)
- Runtime reflection (for dynamicity)
- New semantics for method and constructor calls
- Uses the Java Reflection API
- ProActive
- Implemented on top of the MOP
- Other models can be built on top of ProActive or
on top of the MOP
19Principes du MOP
- Génération statique ou dynamique de stub
- Réifie linvocation de méthode
- Représente lobjet réifié
- Sous-classe lobjet réifié typage respecté
- Le stub depend uniquement de lobjet réifié,
- pas du proxy
- Chaque méthode fabrique un objet Call
représentant son invocation et le passe à un proxy
Objet réifié
Stub
Proxy
20The MOP - principle
- Object effarray - String methodname - Object
res
Objet classique
- Object reify (Call c)
Objet réifié
PROXY_CLASS_NAME null
Reflect
Proxy
Objet distant
Proxy
Body
Futur
Active
Remote
All interfaces that inherit Reflect are marker
interfaces for reflexion
21ProActive implementation principle
PROXY_CLASS_NAME null
MOP
ProxyForBody
ProActive
2 aspects of distribution
- PROXY_CLASS_NAME ProxyForBody -
BODY_CLASS_NAME Body
Active
A
Application
PA
- live (Body)
22Proxy and Body
Based on interface Active and class ProActive
A proxy / body model
- Originalities
- Extensions through inheritance of the Reflect
interface - 3 ways to turn a standard object into a reified
one - Reuse of existing classes, polymorphism between
standard and reified objects
23Interface utilisateur du MOP
- Instanciation dobjets réifiés par le méthode
statique newInstance de la classe MOP - Programmation classe par classe par des
interfaces dérivant de Reflect - Vector v (Vector) MOP.newInstance ( ltnom classe
réifiée (impl. Reflect)gt, - ltparamètres
passés au proxygt, - ltparamètres
du constructeur de lobjet réifiégt ) -
- Ou instance par instance
- Vector v (Vector) MOP.newInstance ( ltnom de
classe standardgt, - ltnom classe
proxy à utilisergt, - ltparamètres
passés au proxygt, - ltparamètres
du constructeur de lobjet réifiégt ) - Ou objet par objet
- Vector v (Vector) MOP.turnReified ( ltobjet
standardgt, - ltnom
classe proxy à utilisergt, -
ltparamètres passés au proxygt )
24Exemple EchoProxy
- public class EchoProxy implements Proxy
- // Attributs
- Object myobject
- // Constructeur
- public EchoProxy (Call c, Object p)
- this.myobject c.execute()
-
- // Méthode de linterface Proxy
- public Object reify (Call c)
- System.out.println ("Echo-gt"c.methodname")
- return result c.execute (myobject)
-
-
- public interface Echo extends Reflect
- PROXY_CLASS_NAME "EchoProxy"
A a (A)newInstance ("Echo_A",null,null) A a
(A)newInstance ("A","Echo",null,null) A a
(A)turnReified ( a, "Echo", null)
252.2 Meta-Objects for DistributionAn Active Object
Body
FuturePool
RequestLine
Object
26Composition dun objet actif
- Multiples Objets
- RequestSender Envoie les requetes (proxy body)
- RequestReceiver Recoit les requetes
- ReplySender Envoie le resultat a lappelant
- ReplyReceiver Recoit les mises a jour de futures
- Service Choisit et execute les requetes
- RequestLine Requetes en attente
- FuturePool Futurs en attente
27Requete a un Objet Actif
28Listener
- Modele observateur-observe
- Des evenements sont (eventuellement) generes a
chaque etape importante, - eventuellement envoyes a un listener
- Ces listeners peuvent etre ajoutes/suprimes
dynamiquement
29Types devenements (1)
- 3 grandes categories
- Objet Actif
- Creation
- Migration (activation,
desactivation Cycle de vie) - Communications
- Requests
- RequestSent
- RequestReceived
- Reply
- ReplySent
- ReplyReceived
- Service (activite de lOA)
- WaitForRequest
- WaitByNecessity
30Listener - Modifier
- Idem Listener modifier lexecution dun
objet actif - A la creation changer le lieu de creation
- Au debut dune migration changer destination
- Step-by-step sur les toutes communications
- etc.
- Application debug, monitoring, contrôle
interactif de lexecution
31Localisation des listeners
32Reception dune requete avec Listener
1 - Appel
2 - RequestReceived
4 - RequestAccepted
33 3. IC2D
Interactive Control Debug for Distribution
DEMO
C3D Collaborative 3D renderer in
//
(ProActive application)
IC2D Monitoring and Control
34IC2D on several machines (1)
35IC2D on several machines (2)
364. ProActive -- EJB JOnASReflexion et
Experimentation
37DIVA Distributed Int. Virtual World in Java
38C3D distributed-//-collaborative
39www.inria.fr/oasis/ProActive
40ProActive Conclusion
- 100 Java
- Both parallelism, distribution, sophisticated
synchronization (CSCW), and mobile active objects
- Multithreaded and distributed
- Mapping of active objects onto hosts and VMs
- Reuse -- seamless
- Polymorphism with existing class types
- Dynamic works on previously unknown objects and
classes - Asynchrony -- Wait-by-necessity
- Centralized control
- Extensible
- ProActive vs. RMI alone - 30 of
code - www.inria.fr/oasis/ProActive
-
41The Level 0 MOP
- Originalities
- Extensions through inheritance of the Reflect
interface - 3 ways to turn a standard object into a reified
one - Reuse of existing classes, polymorphism between
standard and reified objects
42Proxy and Body
Based on interface Active and class ProActive
A proxy / body model
A body is needed (no multiple inheritance)
43The MOP - implementation
- Either static or dynamic stub generation
- The stub reifies method invocations by overriding
all inherited methods with methods that build a
MethodCall object when called and pass it on to
the proxyobject that implements the actual
meta-behavior. - Acts as a type-safe surrogate for the reified
object (the stub class is a subclass of the
reified class). - The stubs depends only on the reified class, not
on the proxy - The proxy does not depend on the type of the
reified object
reified object
reified object
Stub
Proxy
44ProActive Migration of active objects
Object
Calling Object
Forwarder
Proxy
Body
- Migration is initiated by the active object
through a request - The active object migrates with
- - its passive objects - the queue of pending
requests - its future objects