OODVS-Object Oriented Distributed Virtual Systems

(C) Copyrigth 2003 by Diego Ernesto Malpica Chauvet
SourceForge.net Logo



1 Description

        OODVS is a library which goal is to increase the Java support for Distributed Virtual Systems providing local access to distributed resources via proxies.  Our main componets are Participants, Entities, Proxy Enties, Proxy Methods , Remote Methods and Migratory Objects.


1.1 License

        This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

1.2 Downloads

    Home page: http://oodvs.sourceforge.net

    Project page: http://sourceforge.net/projects/oodvs
    Downloads:  SourceForge Files.
    CVS Project modules for Eclipse 3.0.2:  SourceForge CVS.

1.3 Contact Information

Email:  demch@users.sourceforge.net, demch.kwmyf@gmail.com
Mail:    Diego Ernesto Malpica Chauvet,
            Coleadero 71, Villas de la Hacienda,
            Atizipan de Zaragoza,CP 52929,
            Estado de Mexico,
            Mexico.


TOC

1.4 Table of  contents

1 Description

1.1 License
1.2 Downloads
1.3 Contact Information
1.4 Table of Content

2 Main components and Roles

2.1 Participants
2.2 Entities
2.3 Proxy Entities
2.4 Proxy Methods
2.5 Remote Methods
2.6 Regions
2.7 Time Perception
2.8 Security
2.9 Migratory Objects

3 Simple Examples

3.1 Object Oriented Distributed System
3.2 Remote Method Invocation
3.3 Remote Method Invocation Protocols

4 Advanced Examples

4.1 Amatrol
4.2 Phoenix
4.3 Plane

5 Glossary



TOC

2 Main components and Roles

2.1 Participants

Holds the entities.
            Interact with local entities to update their proxies

Interact with the proxies to update states

Interact with other participants to distribute proxies
            Propagate proxies between regions
            Send heart beats to plublish himself to other participants.
            Listen for other participants hear beats.
            Remove dead asumed participants
            Send proxies of new entities to known participants
            Send proxies of  its entities to new known participants
            Provides classes and resources to other participants

2.2 Entities

Contains state information

Contains references to its proxy entities
            Contains methods and Proxy methods
            

2.3 Proxy Entities

            Is a entity thats has a parent entity.

Contains a references to a  root entity.
            Could be the parent of other proxy entitites.

           

2.4 Proxy Methods

Are used to propagate messages to the root entity and all its proxy entities. Currently there are two implementations TCP Proxy  (TCPP)  and  UDP Proxy (UDPP).


2.5 Remote Methods

This is are kind of RMI , RPC services that does not need a external tool to create stubs or skelletons. Currently there are various protocolos  implemented over HTTP/TCP and UDP(Broadcast and Multicast). They have serveral security features like RSA,RC4 key generetation, RSA signing, RSA/RC4 encryption.  The semantics are very similar to the RMI semanthics, but disigned to support the implementation of Proxy methods.

 

2.6 Regions

Regions are defined by the visibility determined by a set of castAddresses (broadcast and multicast) especified in the participant.

2.7 Time Perception

The time services  allows to have diferent times and clock speeds and to mitigate network latency effects. It is used in conjuntion with prediction and convergence algoritms like the Dead reckoning implemented in avanced examples. 

2.8 Security

Several  crypto services will be provided mainly thru  the Remote Methods stack. There is also pending work in order to secure the ClassLoader used to suport the Mitratory objects.

2.9 Migratory objects

Full objects (code and data) are moved between participants a participan can retrieve code and resources on demand from other participants.


TOC

3 Simple Examples

3.1 Object Oriented Distributed System

These are the interface and  class used in the followind code fragments.
Two proxy methods are implemented, with names terminated with TCPP an UDPP that stands for TCP Proxy method and  UDP proxy method.

public interface EntityExample_I {
  public void printMsg_TCPP(String msg) throws RMClientException;
  public void printMsg_UDPP(String msg) throws RMClientException;
}

public class EntityExample extends Entity implements EntityExample_I {

 public EntityExample(String name) throws RMClientException {
    super(name);
 }

 public void printMsg_TCPP(String msg) throws RMClientException {
  System.out.println("  Participant:" + getParticipantName() + " TCCP:" + msg);
 }

 public void printMsg_UDPP(String msg) throws RMClientException {
  System.out.println("  Participant:" + getParticipantName() + " UUDP:" + msg);
 }

}

 

The next code part creates a participant "A" and adds a Entity "A1" to it.
A proxy handler of entity "A1" is obtained.
The proxy handler is used to invoke the two proxy methods, the handler uses the prefix of the method name (UDPP,TCPP) to determine how to handle the method invocation.

Participant a = new Participant("A").start();
a.addEntity(new EntityExample("A1"));

EntityExample_I  handler= (EntityExample_I) a.getHandler("A1",0);

handler.printMsg_UDPP("hello 1.");
handler.printMsg_TCPP("hello 2.");

 

The next code part creates a participant "B".
Participants "A" and "B" will eventualy discover each other and send proxys to each other.
After particpant "B" is created a proxy for the entity "A1", will be retrieved.
Then the local method getName of the proxy will be invoked.
Finally a proxy handler for the proxy "A1" will be obtained
Then the handler will be used to invoke the a proxy method.

Participant b = new Participant("B").start();

EntityExample proxy = (EntityExample) b.getEntity("A1",0);
String name=proxy.getName();

handler = (EntityExample_I)proxy.getHandler();
handler.printMsg_TCPP("hello 3."); 



TOC

 

3.2 Remote Methods

These are the interface and class for the object to be used for remote method invocation in the next code fragments.

public interface ObjectExample_I {
  public String msg1(String name) throws Exception;
}
public class ObjectExample  implements ObjectExample_I {  
  public String msg1(String str) {
    System.out.println(str);
    return "RE: "+ str ;
  } 
}
  
This is the server part.

A remote method server is created and started .
An object  is created and added to the server to be ready for remote invocations.

RMServer server = new RMServer().start();
server.putObject("O1", new ObjectExample());

 

This is the client part, a handler is created and used to perform the remote method invocation.

RMClientContext cc = new RMClientContext("HTTP://localhost");
ObjectExample_I handler = (ObjectExample_I) cc.getHandler(ObjectExample_I.class, "O1");
  
String response = handler.msg1("Hello World.");


 

TOC

3.3 Remote Method Protocols

These are the interface and class for the object to be used for remote method invocation in the next code fragments.

public interface ObjectExample_I {
  public String msg1(String name) throws Exception;
}
public class ObjectExample  implements ObjectExample_I {  
  public String msg1(String str) {
    System.out.println(str);
    return "RE: "+ str ;
  } 
}

 

This is the server part.
This code part firts creates and intializes the server if the keyDir and keys does not exists it will be created.
UDP information is especified as part of the initialization for UDP remote method invocations.
Finally the server is started.
An object is created and added to the server to be ready for remote method invocation.

FileUtils.mkdirs("keyDir");
 
RMServer server = new RMServer("keyDir", "masterPasswd", "serverPasswd");
server.setUDPPort(9001);
server.addCastAddress("224.0.0.1");
server.start();

server.putObject("O1", new ObjectExample());   


 

This is the client part, a RMClientContext is created and used to obtain handlers to perform remote method invocations using various protocols.

RMClientContext context;
context = new RMClientContext("HTTP://localhost", RMClient.RM_HTTP_V1_0, "keyDir", "clientPasswd");
context.setUDPPort(9001);  
context.addCastAddress("224.0.0.1");

ObjectExample_I handler;
handler = (ObjectExample_I) context.getHandler(RMClient.RM_V1_0,ObjectExample_I.class, "/O1");
handler.msg1("HTTP.");

handler = (ObjectExample_I) context.getHandler(RMClient.RM_UDP_V1_0, ObjectExample_I.class, "/O1");
handler.msg1("UDP.");

handler = (ObjectExample_I) context.getHandler(RMClient.RM_HTTP_SIG_V1_0, ObjectExample_I.class, "/O1");
handler.msg1("HTTP Signed.");
      
handler = (ObjectExample_I) context.getHandler(RMClient.RM_HTTP_SEC_V1_0, ObjectExample_I.class, "/O1");
handler.msg1("HTTP Signed and Encrypted.");



TOC

4 Advanced Examples

Every window in these examples is a diferente participant, each participant sees it entites and proxy enties of other participants.  This examples ilustrates the implemtation of physics predictive and convergence algorithms, an various
visualization techniques using OODVS.

4.1  Amatrol (J3D)

 

TOC

4.2 Phoenix (J3D)

 



TOC

4.3 Plane (Open GL)

 


TOC

5 Glossary


OODVS          Object Oriented Distributed Virtual Systems

RMI                 Remote Method Invocation  (TCP,UDP,HTTP)

RPC                 Remote Procedure Call

TCP                 Transmission Control Protocol

UDP                User Datagram Protocol (broadcast and multicast)