Java Object-Relational Layer Sharon Diskin GUS 3.0 Workshop June 18-21, 2002.

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Remote Method Invocation in Java Bennie Lewis EEL 6897.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Remote Method Invocation
Changing the way of designing distributed applications Communication oriented design: FIRST design the communication protocol for the distributed system.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Java RMI. What is RMI? RMI is an RPC system for an object based language. Objects provide a natural granularity for the binding of functions. –RMI allows.
EEC-681/781 Distributed Computing Systems Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Introduction to Remote Method Invocation (RMI)
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
How Does Remote Method Invocation Work? –Systems that use RMI for communication typically are divided into two categories: clients and servers. A server.
Internet Software Development Remote Method Invocation Paul Krause.
The GUS 3.0 Perl Object Layer CBIL Jonathan Schug June
CVSQL 2 The Design. System Overview System Components CVSQL Server –Three network interfaces –Modular data source provider framework –Decoupled SQL parsing.
RMI Components java.rmi: client-side RMI classes, interfaces, and exceptions java.rmi.server: server-side RMI classes, interfaces, and exceptions java.rmi.registry:
1 Java Programming II Java Network II (Distributed Objects in Java)
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
CS 584 Lecture 18 l Assignment » Glenda assignment extended to the Java RMI Deadline » No Java RMI Assignment l Test » Friday, Saturday, Monday.
+ A Short Java RMI Tutorial Usman Saleem
15 - RMI. Java RMI Architecture Example Deployment RMI is a part of J2SE (standard edition), but is used by J2EE) A J2EE server is not nessesary for using.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
LAB 1CSIS04021 Briefing on Assignment One & RMI Programming February 13, 2007.
1 Java RMI G53ACC Chris Greenhalgh. 2 Contents l Java RMI overview l A Java RMI example –Overview –Walk-through l Implementation notes –Argument passing.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Example: RMI Program How to write it.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Copyright  Oracle Corporation, All rights reserved. 7 Accessing a Database Using SQLJ.
Fall 2007cs4251 Distributed Computing Umar Kalim Dept. of Communication Systems Engineering 17/10/2007.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Java Remote Method Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
1 Java Remote Method Invocation java.rmi.* java.rmi.registry.* java.rmi.server.*
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
Remote Method Invocation with Java-RMI
Presentation: RMI Continued 2 Using The Registry & Callbacks.
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Remote Method Invocation A Client Server Approach.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
UMBC Distributed Computing with Objects RMI/Corba CMSC 432 Shon Vick.
Java RMI. RMI Any object whose methods can be invoked from another Java VM is called a remote object.
Khoa CNTT 1/37 PHẠM VĂN TÍNH   Java RMI (Remote Method Invocation)
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
CSC 480 Software Engineering Lab 6 – RMI Nov 8, 2002.
Netprog Java RMI1 Remote Method Invocation.
RMI1 Remote Method Invocation Adapted from “Core Java 2” by Cay Horstmann.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
January 26, Ann Wollrath Copyright 1999 Sun Microsystems, Inc., all rights reserved. Java ™ RMI Overview Ann Wollrath Senior Staff Engineer Sun Microsystems,
Principles of Software Development
Java Remote Method Invocation (RMI)
RMI Packages Overview java.rmi java.rmi.server java.rmi.registry
Remote Method Invocation
Remote Method Invocation
Network and Distributed Programming in Java
Chapter 40 Remote Method Invocation
Remote method invocation (RMI)
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
CS 584 Lecture 18 Assignment Glenda assignment extended to the Java RMI Deadline No Java RMI Assignment Test Friday, Saturday, Monday.
Java Remote Method Invocation
Changing the way of designing distributed applications
Java Object-Relational Layer
Presentation transcript:

Java Object-Relational Layer Sharon Diskin GUS 3.0 Workshop June 18-21, 2002

Agenda Motivation Overview of Design Overview of Implementation Status of Implementation Discussion of Future Plans

Motivation

Why another object layer? Design of new Annotation Tool –prompted a review of the current method for interacting with the database from Java –current annotator interface queries with JDBC and writes XML which is parsed and processed using a Perl ga-plugin –avoid having to update class files on client machines particularly since interacting with development database –avoid having SQL generated on client machines Long term goal of being able to serve generic objects to the public (for example using BioJava)

Options Considered SOAP Java Objects and CORBA Java Objects and Java RMI –Supports dynamic class loading –Automatic garbage collection –Decided to use –Port to use CORBA fairly straightforward, if desired

Object-Relational Layer Design

Overview of Design Based on Perl Object-Relational Layer Utility Classes Objects mapped to tables in GUS 3.0 Code Generator Relationships modeled as parent/child Accessible using Java RMI Remote Interface for the GUS Server Implementation of the remote GUS Server Client uses remote GUS Server to obtain GUS objects (by value)

Overview of Design (continued) Remote GUS Server GUSdev (GUS3.0) GUS Objects (Serializable) …

Overview of Implementation

Utility Classes cbil.gus.Objects.GUS30.util Code Generator GUS30::GUS_utils::JavaGenerator.pm Remote Interfaces RemoteGUSServer, RemoteGUSJDBCServer Running remote GUSServer and Client access

cbil.gus.Objects.GUS30.util GUSJDBCServerGUSObjectCache GUSRowGUSTableAttributeGUSTable GUSTableRelation Generated Subclasses of GUSRow for each table/view GUSServer SQLutils

Implementation: RemoteGUSServer public String openConnection(String usr, String pswd) throws RemoteException,GUSException; Verifies username/password Creates a GUSConnection, including an instance of GUSJDBCServer (connection to GUSdev) Saves off some information about the connection Returns a session id (String) public GUSRow retrieveObject(GUSSession session, String owner, String tname, Integer pk) throws RemoteException, GUSException, SQLException; Verifies valid session and password Queries database to retrieve requested row Returns an instance of owner.tablename (eg. Core.Workflow)

Implementation: RemoteGUSServer public GUSRow submitObject(GUSSession session, GUSRow obj) throws RemoteException, GUSException, SQLException; Verifies session and password Submits object to database Submits children to database Returns updated object public GUSRow createObject(GUSSession session, String pswd, String owner, String tname) throws RemoteException, GUSException; Verifies username/password Returns a new instance of the specified class (owner.tname)

Implementation: RemoteGUSServer public List getSessionHistory(GUSSession session) throws RemoteException, GUSException; Verifies session and password Returns a List of transactions in this session public void closeConnection(GUSSession session) throws RemoteException, GUSException; Verifies session and password Closes GUSConnection Etc. (getParent, getChildren, … )

Code Generation Execute command file: –CreateAllJavaObjects.cmd –should be executed from directory where want objects created Calls generateGusJavaObjects.pl –generateGusJavaObjects.pl --login GUSrw --database GUS30 --specialCases./gus_special_cases –Same as generateGusPerlObjects.pl, but uses different code generation package

Code Generation (continued) Uses JavaGenerator.pm Creates java source files: –./ /.java –./ /gen/ _gen.java –./ /gen/ _tbl.java Compiles all generated code –currently assumes java is in your path –hand_edited code not ported to Java yet

Starting Remote GUS Server // to generate stubs and skeletons rmic -d /home/diskins/java_dev/GUS/java/ GUSServer rmic -d /home/diskins/java_dev/GUS/java/ GUS_JDBC_Server // start the rmiregistry rmiregistry & // to start the remote GUSServer - without a codebase... java \ -Djava.security.policy=/home/diskins/RMIServer/policy.txt \ -Djava.rmi.server.logCalls=true \ GUSServer \ >& GUSServer.log &

GUSServer registered with rmiregistry public static void main(String[] args) { try { GUSServer server = new GUSServer(); String name = System.getProperty("gusservername", "GUSServer_1") ; Naming.rebind(name, server); System.out.println(name + " is bound in RMIRegistry and ready to serve."); } catch ( Exception e ) { System.err.println(e); System.err.println("Usage: java [-Dgusservername= ] " + "GUSServer"); System.exit(1); //force exit cause may be hanging RMI threads. }

Client access to remote GUSServer public static void main (String argv[]) {... try { // Get a reference to the Remote GUS Server object... System.out.println("Looking for remote GUS Server..."); String name = "rmi:///GUSServer_1";//here assumes local machine... RemoteGUSServer gi = (RemoteGUSServer)Naming.lookup(name); System.out.println("Obtained reference to remote GUS Server"); // Open a session with the remote GUS Server Object... String session = gi.openConnection(user, password); System.out.println("New Session is : " + session + "\n"); … }catch (Exception e) { System.err.println(e); e.printStackTrace(); }

Status of Implementation

What “works” now Code Generation (except hand edited) RMI Server accepting connections Create new objects (subclasses of GUSRow) Set attribute values Set / Get parent Set / Get child (ren) Simple submits: insert, update, delete –Deep submits not fully tested yet Basic error checking –Username/password, valid attributes, etc.

What still needs to be done More error checking/handling –Read/write permissions (config file initialization) Port “Hand edited” classes to Java Evidence and Similarity handling Test, test, test

Future Plans

Discussion of Possible Plans GUSApplication for Java –May help with submits –Could also just be handled by GUSServer –CBIL effort ? BioJava Wrappers to GUS Java Objects –Would aid in java interface implementations –Could be served to the public –Sanger (or joint) effort ? Sanger – BioJava expertise CBIL – Schema and GUS Java object expertise –Perhaps start with educated estimate of resource requirements