object oriented distributed virtual systems java framework
DESCRIPTION
OODVS is Java framework that explores several extensions to object oriented paradigms like the use of adjectives or qualifiers that are similar to notations, that let us work with concepts like threaded methods, proxy methods that can significantly reduce the complexity of distributed, multicore, high concurrency systems.TRANSCRIPT
Object Oriented Distributed Virtual Systems Framework (20042014)(OODVS Framework,Remote Method Invocation, Multicast Remote Method Invocation, Intelligent Handlers, Proxy
Methods, Threaded Methods, Migratory Objects, Distributed System, Shared State)Diego Malpica Chauvet et al.
Praxis (www.openknowledge.mx), diego[email protected] this paper, we propose a framework following the Paradigm Shifting Technique focused on using advance objectoriented languages features to reduce the external complexity inherent to distributed systems.Categories and Subject Descriptors: C.2.4 Distributed Systems1 IntroductionOriginally, the development of Distributed Virtual Reality was strongly promoted by the military industry, mainly for theelaboration of combat simulators. This industry has devoted a lot of resources to developing quality software allowing forreuse compatibility and portability of components, emphasizing the protection of previous investment. Today, thedevelopment of virtual reality is more diverse, due to develop in new areas such as entertainment, medicine andmanufacturing. Many new technologies have been arrived since DIS(Distributed Interactive Simulation) protocol origin inin 1980.
Paradigm Shiftingfrom 1980 to 2013
2005 BUP & EPF
Virtualization
Mobile
WWW
CPU(Hardware)
OperativeSystem
Languages
Frameworks
DataBase
Presentation
Architecture
Quality
Applications
Social Technologies
1979 Unix
1981 MSDOS
1966 DOS
1985 Windows
1991 Linux
2007 Linux Android
1993 Newton
1988 Mac
2004 LinuxUbuntu
1978 80861982 286
1993 Pentium
2006 Dual Core2007 Quad Core
2011 10 Core
1988 SUN softpc
1979 IBM VM
1997 MAC virtualpc
1998 VMWare
2003 XEN
2008 KVM
1993 Newton
2007 Kindle 2010 Ipad2011 Galaxy
2007 IPhone2007 Android
1991 HTML
1995 AWT
1999 JSP
2002 Vaadin
1992 OpenGL
2006 GWT 1.0
2004 JSF 1.0
1993 Mosaic
1994 Newton1994 Netscape
1996 Safari1998 Firefox
1995 IExplorer
2011 BBerry
2011 FFox M
2011 Chrome
2007 Safari M2008 Android M
2008 Chrome2009 Opera M
2001 Explorer M1996 Apache
1987 CMM
1989 ITIL
1991 SCRUM1993 MSF
1999 XP
2003 RUP
1998 ASP
1996 Flash
2007 SilverLight
1999 GPU
2013
1996 Palm
2000 PocketPC2001 Win XP
2009 Win 7
1996 Win NT
1987 OS/2
1984 GNU
2008 Atom
2002 CMMI
1990 WWW 2000 PocketPC
1960
1980
1990
2000
2010
2011 Chrome M
2009 GWT 2.02007 Vaadin/GWT
1970
2000
2010
1990
1960
1980
1970
1975 Tandem
1991 TandemMips
2001 TandemItanium
1975 Tandem T/TOS
1994 Tandem OSS (Unix)
2006 JSPJSTL
2000 HTML 4
2008 HTML 5
1980
2006 Linux 2.4
2011 Linux 3.0
2001 MAC OS 10
2012 MAC OS 10.8
2004
2009 JSF 2.0
1997 WAP
2013 Vaadin 7
1970 DBMS1978 RDMS
1979 Oracle
1997 Oracle ORDBMS
1994 Mysql
2004 DB4O
2001 HSQL
2005 H2
1980 OODMS
1988 Oracle RDBMS
1979 MVC
1980 OSI
1998 XML
1981 RPC
1996 DCOM
1997 RMI
1998 SOAP
2000 REST
2007 Cloud
2000 Ajax
1997 MVP 1987 Sybase RDBMS
1989 Microsoft SQL
1967 Object Oriented
1983 Internet
1970 Chat1970 Enail
1991 WWW3 Layer
2002 RIA
2002 Prevayler
1972 C1972 SQL
1983 C++
2001 AspectJ2001 C#2003 Scala
1999 J2EE2000 .NET
2001 Hibernate2006 OpenJDK2005 Harmony
1967 Simula
1968 BI
1980 BPMS
1970 Ecommerce
1984 Staroffice1989 MS office1990 ERP
2000 OpenOffice
2006 Google Docs
2011 MS Off365
2000 RSA Public
1991 ISOS. Engineering1993 ISOS. Process
1960 RFC
1950 Freesoftware
1970 BBS
1958 Lisp1959 Cobol
2007 Clojure
2004 BPMN
2004 OODVS2002 Spring2000 Liferay
1991 MS Visual Basic
2004 Eclipse
1991 MS Power Builder
2012Win Phone 8
1985 MacApp
1995 Java
1996 Cocoa
1991 MS Visual Basic
1995 Wikis1997 Google
1998 Opensource1999 Sourceforge
2001 Wikipedia2003 Linkedin
2004 Facebook
1990 WWW
1995 MS Visual Studio
1997 Netbeans
1995 Java
1995 PHP1995 JavaScript
1997 UML
2012 Win 8, WinServer2012 Lunix U Unity
2012 Lunix Android 4.1
2008 HyperV
Granted ObsoleteOld and ValidTargetNew Promissing
1987 PAC
2009 Mongo DB
2007 Amazon EC2
2009 Windows Azure2009 Google Apps Engine
2010 OpenStack
2006 Twitter1999 RSS
2006 OpenUP
2001 OWASP & ISOSecurity
1993 MSF
1993 EDI
2004 PCI
1990 Versant ObjecttDB
2007 Hadoop
2010 Maria DB
1980 DIS
1993 CORBA
2000 HLA
1998 Java 3D
1995 VRML
2004 Hypper Threading
1997 Swing
2001 Webstart
1995 Applets
2000 OSGi
Figure 1: Technology advances 19722013Shared state maintenance is governed by the ConsistencyThroughput Tradeoff that imposes physical limits on howconsistent state can be achieved within the given a set of constraints. Shared state is a complex issue. Selecting anappropriate shared state maintenance technique is an engineering task that must balance a variety of issues, includingbandwidth, computation, latency, data consistency, and reproduceability.There are three broad types of shared state maintenance:Shared repository: Uses a centralized database to store the net current state. It provides highly consistent statemaintenance at the expense of high bandwidth, slow throughput, and tight interdependencies among participatinghosts.Blind broadcast: Transmits updates on a regular basis. Sacrifices absolute consistency in favor of eventual consistencywhile reducing the interdependencies among participating hosts.Dead reckoning: Transmits nonregular updates and uses prediction and convergence to manage state at remote hosts.Provides weakly consistent state maintenance (bounded error) in order to minimize bandwidth and maximize hostautonomy.2 Technologies2.1 Java PlatformThe language is a key factor to our approach since the power of expression is directly related with the externalcomplexity. To see the language as the center of integration of multiple technologies (as a platform) it really simplifies
things just take a glance to the following table that’s shows the relevant technologies for our point of view integrated tothe java platform.
Version Technologies
Java 1.0 Object Oriented, Virtual Machine, Threads, Sockets, Garbage Collection, Dynamic Loading
Java 1.1 Just in time compilation, Serialization, Remote Method Invocation, Reflection
Java 1.2 Cryptography
Java 1.3 Proxies
Java 1.4 XML
Java 1.5 Annotations, Concurrency, Generics
Table 1: Java Platform relevant technologies2.2 Remote MethodsRMI (Remote Method Invocation) has been part of the Java Platform since version 1.2 unfortunately the currentimplementation has not fully take advantage of platform advances like reflection (proxy, annotations), and protocols(HTTP, UDP Broadcast, UDP Multicast).Since we consider this technology a key factor we have implemented our own remote method stack which it provides akind of RMI, RPC services that doesn’t need stubs, skeletons or an external tool. Currently we support various protocolsimplemented over HTTP/TCP and UDP (Broadcast and Multicast) and they have several security features based onBouncy Castle Cryptography API. The semantics are very similar to the RMI semantics, but designed to support theimplementation of the Proxy Model that we will see ahead.2.3 Intelligent HandlersHandlers could be seen as a kind of proxy that it’s placed between method invocations and the method execution. Ahandler in conjunction with other java features as reflection an annotation, can greatly simplify the design and thesemantics of the components. We used handlers to implement our remote method stack with out the need of externaltools and precompiled stubs or skeletons. We also used handler to implement the Proxy Model.2.4 Proxy ModelThe purpose of the model is to support objects and messages distribution. The model is constituted by three roles:Participant Entity and Proxy. The interaction between these roles defines a Distributed Virtual System.2.4.1 Role responsibilitiesParticipant
Holds the entitiesInteract with entities to update their proxiesInteract with the proxies to update statesInteract with other participants to distribute proxies
Propagate proxies between regionsSend heart beats to publish himself to other participants.Listen for other participants hear beats.Remove dead assumed participantsSend proxies of new entities to known participantsSend proxies of its entities to new known participantsProvides classes and resources to other participants
Entity
Contains state informationContains references to its proxy entitiesContains methods and Proxy methods
Proxy
Is an entity that’s has a parent entity.Contains a reference to a root entity.Could be the parent of other proxy entities.
Figure 2: Planes implemented using our Proxy Model and OpenGL, every window is a different participant; eachparticipant sees its entities and the proxies from other participant’s entities.
Figure 3: Illustrates the object distribution between five participants
Figure 4: Illustrates different visibility regions between the five participants of the figure 2.2.5 Proxy MethodsProxy methods are implemented via Handlers and they are used to propagate messages to the entities and all itsproxies.2.6 Time PerceptionThe time services allow to have different times and clock speeds and to mitigate network latency effects. They are used inconjunction with prediction and convergence algorithms like the Dead reckoning implemented in advanced examples.2.7 Dead ReckoningThe Proxy model eases the implementation of Predictive and Convergence algorithms the Proxy Model is a kind of deadreckoning general implementation.2.8 SecurityWe base our solution cryptography in the Bouncy Castle Lightweight API.2.9 Migratory ObjectsFull objects (code and data) are moved between participants a participant can retrieve code and resources on demandfrom other participants.3 Hands on Code3.1 Remote MethodsThese 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. Then an object is created and added to the serverto 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.");3.2 Remote Method ProtocolsThese 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 first creates and initializes the server. If the keyDir and keys that does not exist it willbe created.UDP information is specified 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 invocationsusing 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.");3.3 Proxy ModelThese are the interface and the class used in the following 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 eventually discover each other and send proxies to each other.After participant "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 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.");4 ResultsThe framework substantially reduced the complexity associated to maintaining a shared state and the number ofspecialities needed to implement a Distributed Simulation.
Figure 5: Amatrol Robot implemented using Proxy Model and Java3D, every window is a different participant; eachparticipant sees its entities and the proxies from other participant’s entities.
Figure 6: Space Ship using Proxy Model and Java3D, every window is a different participant; each participant sees itsentities and the proxies from other participant’s entities.5 ConclusionThere are significant advances in various technologies that plenty justify a paradigm shifting in order to get new designsand implementations.6 Future WorkImplement a secure loader for the proxy Loader, an various secure protocols for the UDP messages.Introduce the use of annotations and Aspect oriented techiques for method handling instead of name prefixes.7 DownloadsHome page: http://oodvs.sourceforge.netProject page: http://sourceforge.net/projects/oodvs8 GlosaryOODVS Object Oriented Distributed Virtual SystemsRMI Remote Method InvocationRPC Remote Procedure CallTCP Transmission Control ProtocolUDP User Datagram Protocol (broadcast and multicast)HTTP HyperText Transfer ProtocolRSA A publickey encryption technologyRC4 A variable keysize stream cipherDead ReckoningDIS Distributed Interactive SimulationNPS Naval Postgraduate School9 References
1. Distributed Interactive Simulation (DISJavaVRML) http://faculty.nps.edu/brutzman/vrtp/disjavavrml/download.html
2. Open DIS http://opendis.sourceforge.net/OpenDIS.html3. Open Astex Viewer http://openastexviewer.net/web/4. ITESMCEM, Tesis, "Arquitectura para realidad virtual distribuida con física simulada, poblada de agentes
autónomos", Ing. Montserrat Morales, Ph. D Isaac Rudomín,
5. NPS, Tesis, "AN AUTOMATED APPROACH TO DISTRIBUTED INTERACTIVE SIMULATION (DIS)PROTOCOL ENTITY DEVELOPMENT", Michael Canterbury, September 1995.
6. NPS, "DialaBehavior Protocol" (DBP)7. "Networked Virtual Environments and DISJavaVRML Library", NPSNET Research Group, Don Brutzman
and Mike Zyda8. NPS, " A NETWORK SOFTWARE ARCHITECTURE FOR LARGE SCALE VIRTUAL ENVIRONMENTS",
Michael R. Macedonia, Michael J. Zyda,David R. Pratt,Paul T. Barham,Steven Zeswitz9. NPS, " NPSNET LargeScale Virtual Environment Technology Testbed", Michael Zyda*, Don Brutzman,
Rudy Darken, Robert McGhee, John Falby, Eric Bachmann, Kent Watsen, Ben Kavanagh & RussellStorms