Implementing Java Distributed Objects with JDBC



Similar documents
A MONITORING PLATFORM FOR DISTRIBUTED JAVA APPLICATIONS

Instrumentation Software Profiling

Invocación remota (based on M. L. Liu Distributed Computing -- Concepts and Application

Elements of Advanced Java Programming

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

Middleware Lou Somers

Chapter 6. CORBA-based Architecture. 6.1 Introduction to CORBA 6.2 CORBA-IDL 6.3 Designing CORBA Systems 6.4 Implementing CORBA Applications

Introduction to CORBA. 1. Introduction 2. Distributed Systems: Notions 3. Middleware 4. CORBA Architecture

Module 17. Client-Server Software Development. Version 2 CSE IIT, Kharagpur

INTRODUCTION TO JAVA PROGRAMMING LANGUAGE

25 May Code 3C3 Peeling the Layers of the 'Performance Onion John Murphy, Andrew Lee and Liam Murphy

Distributed Network Management Using SNMP, Java, WWW and CORBA

JRastro: A Trace Agent for Debugging Multithreaded and Distributed Java Programs

Virtual Credit Card Processing System

Infrastructure that supports (distributed) componentbased application development

Distributed Systems Architectures

A Web-Based Real-Time Traffic Monitoring Scheme Using CORBA

Web Services. Copyright 2011 Srdjan Komazec

Research on the Model of Enterprise Application Integration with Web Services

What Is the Java TM 2 Platform, Enterprise Edition?

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

Interface Definition Language

Layering a computing infrastructure. Middleware. The new infrastructure: middleware. Spanning layer. Middleware objectives. The new infrastructure

Architectural Overview

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

Version Overview. Business value

CS 209 Programming in Java #1

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Client/server is a network architecture that divides functions into client and server

What s Cool in the SAP JVM (CON3243)

PERFORMANCE MONITORING OF JAVA COMPONENT-ORIENTED DISTRIBUTED APPLICATIONS

Chapter 4. Architecture. Table of Contents. J2EE Technology Application Servers. Application Models

3-Tier Architecture. 3-Tier Architecture. Prepared By. Channu Kambalyal. Page 1 of 19

Extreme Java G Session 3 Main Theme Java Core Technologies (Part I) Dr. Jean-Claude Franchitti

What is Middleware? Software that functions as a conversion or translation layer. It is also a consolidator and integrator.

Mobile Devices: Server and Management Lesson 05 Service Discovery

Java and Distributed Object Models: An Analysis

A standards-based approach to application integration

Java Thin-Client Programming for a Network Computing Environment

Java Server Programming: Principles and Technologies. Subrahmanyam Allamaraju, Ph.D.

Load balancing using Remote Method Invocation (JAVA RMI)

System Architectures for Integrating Web-Based User Interfaces into (Legacy) Database Applications

Concepts of Database Management Seventh Edition. Chapter 9 Database Management Approaches

Introduction to Web Services

The distributed object computing paradigm: concepts and applications

Monitoring HP OO 10. Overview. Available Tools. HP OO Community Guides

Distributed Objects and Components

B. WEB APPLICATION ARCHITECTURE MODELS

Enterprise Java. Where, How, When (and When Not) to Apply Java in Client/Server Business Environments. Jeffrey Savit Sean Wilcox Bhuvana Jayaraman

JProfiler: Code Coverage Analysis Tool for OMP Project

Trace-Based and Sample-Based Profiling in Rational Application Developer

A Generic Database Web Service

Introduction CORBA Distributed COM. Sections 9.1 & 9.2. Corba & DCOM. John P. Daigle. Department of Computer Science Georgia State University

JNMWare: Network Management Platform Using Java Technologies

Internationalization and Web Services

Object Instance Profiling

Client/Server Computing Distributed Processing, Client/Server, and Clusters

Mobility Information Series

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

A DEPLOYMENT-READY SOLUTION FOR ADDING QUALITY-OF-SERVICE FEATURES TO WEB SERVICES

White paper. IBM WebSphere Application Server architecture

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Enabling the Information Age

The Study on Mobile Phone-oriented Application Integration Technology of Web Services 1

XXI. Object-Oriented Database Design

System types. Distributed systems

A technical guide for monitoring Adobe LiveCycle ES deployments

Introduction into Web Services (WS)

Chapter 2: Enterprise Applications from a Middleware Perspective

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

A Java-based system support for distributed applications on the Internet

Distributed Systems Lecture 1 1

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

CSE 452: Programming Languages. Acknowledgements. Contents. Java and its Evolution

Automatic Configuration and Service Discovery for Networked Smart Devices

Architecture Design For Web-based Application Systems. Instructor: Dr. Jerry Gao Class: CMPE296U

IBM WebSphere Business Integration for HIPAA

Detailed Table of Contents

2. Accessing Databases via the Web

Performance Analysis of Web based Applications on Single and Multi Core Servers

IBM Software Group. SW5706 JVM Tools IBM Corporation 4.0. This presentation will act as an introduction to JVM tools.

FROM RELATIONAL TO OBJECT DATABASE MANAGEMENT SYSTEMS

Introduction to Web services architecture

COMP5426 Parallel and Distributed Computing. Distributed Systems: Client/Server and Clusters

IBM Rational Web Developer for WebSphere Software Version 6.0

An introduction to SOA and the HP NonStop server environment

Software Development Kit (SDK) Technical Overview and Specifications

Transcription:

Implementing Java Distributed Objects with JDBC Pritisha 1, Aashima Arya 2 1,2 Department of Computer Science Bhagwan Mahaveer institute of engineering & technology (BMIET), Deenbandhu Chhotu Ram University of Science & Technology (DCRUST), Sonepat Abstract Organizations rely on information to make effective business decisions and corporate intranets are changing the way organizations conduct business. As networking technologies continue to improve, with increasing bandwidth and reliability, effective distributed computing is becoming a reality. Organizations are relying on internet technologies to be the conduit for employees to access and manipulate corporate information. Having timely and accurate information is essential for effective management practices and optimization of limited resources. Information can be stored effectively and efficiently in Database Management Systems (DBMS), a software system that manages the data integrity, storage and access of data in a database. The goal of a database is to reduce redundant storage of information throughout an organization. Java is destined to become a language for distributed computing. Java Development Kit (JDK) comes with a broad range of classes for network and database programming. Java Database Connectivity (JDBC) is one such class for providing client/server database access. Keywords JDBC, Applet, RMI, CORBA, SOAP I. INTRODUCTION Java, as a relatively simple, object-oriented, secure and portable language, is also a flexible and powerful programming system for distributed computing. Program development with Java results in software that is portable across multiple machine architectures and operating systems. Distributed programming in Java is supported by remote method invocation (RMI), object serialization, reflection, a Java security manager and distributed garbage collection. Java RMI is designed to simplify the communication between objects in different virtual machines allowing transparent calls to methods in remote virtual machines. Organizations rely on information to make effective business decisions and corporate intranets are changing the way organizations conduct business. Information can be stored effectively and efficiently in Database Management Systems (DBMS), a software system that manages the data integrity, storage and access of data in a database. The goal of a database is to reduce redundant storage of information throughout an organization. Data is stored in a central location and multiple clients are allowed to access the data from various locations throughout the organization's network or via the internet. In this client/server environment, client processes need to be able to effectively locate the database server, and communicate with the remote server process. Java is destined to become a language for distributed computing. Java Development Kit (JDK) comes with a broad range of classes for network and database programming. Java Database Connectivity (JDBC) is one such class for providing client/server database access. In this paper we focus on two different approaches: Remote Method Invocation (RMI) and Common Object Request Broker Architecture (CORBA) with JDBC. II. LITERATURE REVIEW The first version of JVMs had poor support for monitoring Java programs. Initially there was a simple debugger, jde, attached to the Java Development Kit (JDK). Then, there was an instrumented Java virtual machine build for JDK version 1.16 to support the collection of profiling data generated when executing a Java program. This approach was developed until version 2 of the Java platform. All JVMs for the new Java platform were equipped with interfaces for debugging (JVMDI) [6] and profiling (JVMPI) [7]. A new release of Java 2 Platform version 1.5, called Tiger, contains a new native profiling interface called JVMTI which is intended to replace JVMPI and JVMDI. JVMTI aims to cover the full range of native in-process tools access, which in addition to profiling, includes monitoring, debugging and, potentially, a wide variety of other code analysis tools. Most of the tools for JVM versions from 1.2 to 1.4 are based on the Java Virtual Machine Profiling Interface (JVMPI) [7]. Starting with JDK 1.2 SDK it also includes an example profiler agent for efficiency examination called hprof [8], which can be used to build professional profilers. A Heap Analysis Tool (Hat) [9] enables one to read and analyze profile reports of the heap generated by the IJRASET 2015: All Rights are Reserved 14

hprof tool and may be used e.g. for debugging memory leaks. Tracer [10] is a debugger which provides traditional features, e.g. a variable watcher, breakpoints and line-by-line execution. J-Sprint [11] provides information about what parts of a program consume the most of execution time and memory. JProfiler [12], targeted at JEE and JSE applications, provides information on CPU and memory usage, thread profiling and VM. Its visualization tool shows the object references chain, execution control flow, thread hierarchy and general information about JVM using special displays. All these tools have similar features: memory, performance, code coverage analysis, program debugging, thread deadlock detection and class instrumentation, but many of them are designed to observe a single-process Java application and do not support directly monitoring a distributed environment based on RMI middleware, except for JaViz [17], which is intended to supplement the existing performance analysis tools with tracing client/server activities to extend Java s profiling support for distributed environments. III. DISTRIBUTED APPLICATIONS The term distributed applications, is used for applications that require two or more autonomous computers or processes to cooperate in order to run them. Thus, the distributed system considered in this thesis, involves three resources, processing, data and user interface. Both processing and data can be distributed over many computers. The user interface is usually local to the user so that the graphical interface, which consumes high bandwidth, does not have to be transmitted from one location to another (figure 1). Figure 1: A Typical Distributed Application Scenario In distributed computing, the computer network is used to support the execution of program units, called processes that cooperate with one another to work towards a common goal. This approach has become popular due to a number of developments like: Increase in the number of personal computers Low cost of establishing computer networks with the advancement of technology Computer manufacturers now offer networking software as a part of the basic operating system Computer networks are now an established way of disseminating information The modern client/server model uses proxy objects for server and client respectively. The client calls the proxy, making a regular method call. The client proxy contacts the server. Similarly, a second proxy object on the server communicates with the client proxy, and it makes regular calls to the server object. Methods of proxies communications: There are three different methods with which proxies communicate with each other. RMI, the Java Remote Method Invocation technology, supports method calls between distributed Java objects. CORBA, the Common Object Request Broker Architecture, supports method calls between objects of any programming language. CORBA uses the Internet Inter-ORB Protocol or IIOP to communicate between objects. SOAP, the Simple Object Access Protocol, is also programming language neutral. However, SOAP uses an XML-based IJRASET 2015: All Rights are Reserved 15

transmission format. IV. REMOTE METHOD INVOCATION WITH JDBC RMI allows a Java object that executes on one machine to invoke a method of the Java object that executes on another machine. This is an important feature, because it allows building distributed application. All the RMI classes are available in jave.rmi package. To use different classes of this package we must import the java.rmi package in the beginning of the Java program. One main application where RMI is used client/server. The server receives requests from a client, processes it & returns the result. For example, the client seeking product information can query a Ware House object on the server. It calls a remote method, find, which has one parameter: a Customer object. The find method returns an object to the client: the Product object (Figure 2). Figure 2: RMI using Client & Server Object In RMI terminology, the object whose method makes the remote call is called the client object. The remote object is called the server object. Following steps are required for creating RMI/JDBC connection object: A. Creating The Connection Object The first step we will take in building our RMI process is in the creation of a connection object. This object will be used to provide multi-user access to our database. B. Creating The Remote Interface The RMI process begins with an interface that defines the methods accessible to the RMI client. As with all other abstract classes, the interface serves only to define the remote object's methods and parameters; they do not contain any actual programming logic. C. Creating The Remote Object After the creation of the remote interface, we continue by building the actual remote object. The remote object implements the interface and incorporates the program code that will be run when its methods are called. This object performs the actual execution process, or invocation, of the RMI. D. Creating A RMI Client Applet The remote object that we just created will be used within a background process running on the Web server. It represents the "server" side of the "distributed" computing model. The "client" side can be constructed either as a Java application or as an applet. E. Create A Registration Program We need to bind the remote object to the RMI registry. IJRASET 2015: All Rights are Reserved 16

F. Creating The HTML file For Executing Applet The jr.html document contains an <APPLET> tag to run the client Applet. V. COMMON OBJECT REQUEST BROKER ARCHITECTURE Though RMI is a powerful mechanism for distributing and processing objects in a platform-independent manner, it has one significant drawback. it only works with objects that have been created using Java. Convenient though it might be if Java were the only language used for creating software objects, this simply is not the case in the real world. A more generic approach to the development of distributed systems is offered by CORBA (Common Object Request Broker Architecture), which allows objects written in a variety of programming languages to be accessed by client programs which themselves may be written in a variety of programming languages. Another fundamental difference between RMI and CORBA is that, whereas RMI uses Java to define the interfaces for its objects, CORBA uses a special language called Interface Definition Language (IDL) to define those interfaces. Although this language has syntactic similarities to C++, it is not a full-blown programming language. In order for any ORB to provide access to software objects in a particular programming language, the ORB has to provide a mapping from the IDL to the target language. Mappings currently specified include ones for Java, C++, C, Smalltalk, COBOL and Ada. At the client end of a CORBA interaction, there is a code stub for each method that is to be called remotely. This stub acts as a proxy (a 'stand-in') for the remote method. At the server end, there is skeleton code that also acts as a proxy for the required method and is used to translate the incoming method call and any parameters into their implementation-specific format, which is then used to invoke the method implementation on the associated object. Method invocation passes through the stub on the client side, then through the ORB and finally through the skeleton on the server side, where it is executed on the object. For a client and server using the same ORB, Figure 3 shows the process. Figure 3.3: Remote method invocation when client and server are using the same ORB. In order to illustrate a distributed computing model using CORBA, as well as its ability to provide persistency in Internet computing, we will build a simple application using the JDBC. CORBA allows an applet to communicate with one instance of a particular remote object that was previously registered with the CORBA Naming Service. A. Creating The Remote Interface All CORBA applications begin with an interface that defines the methods accessible to the CORBA client. This interface is written in the Interface Definition Language and converted to a native language. In our case, the language is Java. B. Creating The CORBA/JDBC Connection Object The JDBC Connection object is where the database connection logic is contained. A new object will be spawned by the CORBA server for every client that opens a connection to it. In this way we will be able to support multiple concurrent users. C. Creating A CORBA Server Object IJRASET 2015: All Rights are Reserved 17

After the creation of the IDL interface and the associated Java interface classes, we continue by building the remote object's implementation. The remote object extends the base skeleton object, _JIImplBase that was created by the idltojava tool. It also incorporates the program logic that will be run when its methods are called by a CORBA client. The server object is also referred to as a servant. D. Creating A CORBA Client Applet The servant object that we just created will be executed as a background process running on the Web server. It represents the "server" side of the "distributed" computing model. The "client" side can be constructed either as a Java application or as an applet. E. Create A Servant Bootstrap Program The final step in setting up our CORBA server object is to create a bootstrap program for the servant. This is done through a small program that initializes the object to the CORBA server and binds it with the Naming Service. F. Creating The HTML File For Executing Applet The ji.htm document contains an <APPLET> tag to run JIApplet.class VI. SIMPLE OBJECT ACCESS PROTOCOL IBM, Lotus Development Corporation, Microsoft, Develop Mentor and User land Software developed and drafted SOAP, which is an HTTP-XML-based protocol that enables applications to communicate over the Internet, by using XML documents called SOAP messages. SOAP is compatible with any object model, because it includes only functions and capabilities that are absolutely necessary for defining a communication framework. Thus, SOAP is both platform and software independent, and any programming language can implement it. SOAP supports transport using almost any conceivable protocol. SOAP binds to HTTP and follows the HTTP request response model. SOAP also supports any method of encoding data, which enables SOAP-based applications to send virtually any type information (e.g., images, objects, documents, etc.) in SOAP messages. A SOAP message contains an envelope, which describes the content, intended recipient and processing requirements of a message. The optional header element of a SOAP message provides processing instructions for applications that receive the message. VII. CONCLUSION During the first two decades of their existence, computer systems were highly centralized. A computer was usually placed within a large room and the information to be processed had to be taken to it. This had two major flaws, a) the concept of a single large computer doing all the work and b) the idea of users bringing work to the computer instead of bringing the computer to the user. This was followed by stand alone PCs where the complete application had to be loaded on to a single machine. Each user has his/her own copy of the software. The major problems were a) sharing information and b) redundancy. These two concepts are now being balanced by a new concept called computer networks. In computer networking a large number of separate but interconnected computers work together. An application that requires two or more computers on the network is called a network application. The client server model is a standard model for network applications. A server is a process that is waiting to be contacted by a client process so that the server can do something for it. A client is a process that sends a request to the server. REFERENCES [1] Bubak M, Funika W, Metel P, Orłowski R and Wism uller R 2002 Proc. 4 th Int. Conf. PPAM 2001, Naleczow, Poland, LNCS 2328 315 [2] Bubak M, Funika W, Smetek M, Kilianski Z and Wism uller R 2003 Proc. 10 th European PVM/MPI Users Group Meeting, Venice, Italy, LNCS 2840 447 [3] Bubak M, Funika W, Wism uller R, Metel P and Orłowski R 2003 Future Generation Computer Systems 19 651 [4] Bubak M, Funika W, Smetek M, Kilianski Z and Wism uller R 2004 Proc. 5 th Int. Conf. PPAM, Czestochowa, Poland, LNCS 3019 352 [5] Funika W, Bubak M, Smetek M and Wism uller R 2004 Proc. Int. Conf. on Computational Science, Cracow, Poland, LNCS 3038 472 [6] Sun Microsystems: Java Virtual Machine Profiler Interface (JVMDI), http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jvmdi-spec.html [7] Sun Microsystems: Java Virtual Machine Profiler Interface (JVMPI), http://java.sun.com/j2se /1.4.2/docs/guide/jvmpi/jvmpi.html [8] The SDK Profiler, http://www.javaworld.com /javaworld/jw-12-2001/jw-1207-hprof.html IJRASET 2015: All Rights are Reserved 18

[9] Sun s Heap Analysis Tool (HAT) for Analysing Output from hprof, http://java.sun.com/developer/onlinetraining/programming/jdcbook/hat bin.zip [10] JTracer Tool, http://amslib.free.fr/ [11] Java Profiler J-Sprint, http://www.j-sprint.com/ [12] JProbe, http://java.quest.com/jprobe/jprobe.shtml [13] JView, http://www.devstream.com/ [14] Kazi I H, Jose D P, Ben-Hamida B, Hescott C J, Kwok C, Konstan J, Lilja D J and Yew P-C 2000 IBM Systems Journal 39 (1) 96; http://www.research.ibm.com/journal/sj/391/kazi.html [15] Sun Microsystems: Java Platform Debug Architecture (JPDA), http://java.sun.com/j2se/1.4.2/docs/guide/jpda/ IJRASET 2015: All Rights are Reserved 19