0% found this document useful (0 votes)
4 views

Design of Distributed Architecture Based on Java Remote Dessalew

The document discusses a distributed architecture design based on Java Remote Method Invocation (RMI) technology, highlighting its advantages over other distributed object technologies like DCOM and CORBA. It emphasizes the architecture's scalability, flexibility, and reduced complexity, making it suitable for large-scale distributed applications while also being economically viable. The paper concludes that while the proposed architecture is effective, further research is needed to address various related challenges.

Uploaded by

birhanfentie64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Design of Distributed Architecture Based on Java Remote Dessalew

The document discusses a distributed architecture design based on Java Remote Method Invocation (RMI) technology, highlighting its advantages over other distributed object technologies like DCOM and CORBA. It emphasizes the architecture's scalability, flexibility, and reduced complexity, making it suitable for large-scale distributed applications while also being economically viable. The paper concludes that while the proposed architecture is effective, further research is needed to address various related challenges.

Uploaded by

birhanfentie64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2009 International Conference on Environmental Science and Information Application Technology

Design of Distributed Architecture based on Java Remote


Method Invocation Technology

Delin Hou , Huosong Xia


College of Economics and Management
Wuhan University of Science and Engineering
Wuhan, Hubei, 430073, China
[email protected], [email protected]

Abstract—Remote method invocation is a distributed object DNA transplant and the effectiveness of the J2EE
model for the Java programming language that making architecture, Windows DNA includes the COM+
distributed objects easy to implement and tousle. Remote components and can only be applied to the Windows
method invocation applications are often comprised of two operation systems, and J2EE may be don’t meet system
separate programs: a Server and a Client. A typical server requirements or economic conditions are not allowed.
application creates a number of remote objects, makes Therefore, in face of different application demands and
references to those remote objects accessible, and waits for application types, there is still a lot of research space in the
clients to invoke methods on those remote objects. In view of architecture design of the system. With respect of the
the needs of the organization’s business and cross-platform
current popular web-based distributed application system,
of the system, the distributed object technology and
component technology based on the java platform is an ideal
from the point of the software design, this article puts
choice of the large-scale distributed application system of the forward the distributed architecture based on the Java
development of the enterprise. With respect to the current remote method invocation (RMI) technology [2].
popular web-based distributed application system, from the
II. ADVANTAGES OF RMI TECHNOLOGY
point of the software design, this article puts forward the
distributed architecture based on the java remote method At present, there are three main popular computer
invocation technology, and in the actual design and industry standards of the distributed object technology:
development have got more satisfactory results. Microsoft’s DCOM (Distributed Component Object
Model), CORBA (Common Object Requests Broker
Keywords- java;remote method invocation; javabeans; Architecture) of OMG (Object Management Group), and
distributed architecture; enterprise java bean Java RMI (Remote Method Invocation) of Sun
Microsystems. Because of the platform limitations of
I. INTRODUCTION DCOM and the complexity of the realization of CORBA,
The development of the network technology promotes Java technology is widely used in the distributed system.
the information management and the application mode of For the distributed computing, Java provides a series of
the enterprise to develop towards two directions. On the easy and useful solutions. Through supporting the Java
one hand, from the traditional C/S architecture to the browser, the Java Applet technology can be used to
structure mode of the web system that is based on the construct the user interface or carry out simple operations
multi-layer; on the other hand, the network environment in the aspect of downloading the class files of the client;
transfers from the concentrated processing environment to Java Bean technology provides a kind of way that creates
the distributed processing environment [1]. reusable components; Java RMI provides remote method
The distributed object technology and component invocation; JDBC simplifies the operation between the
technology has been largely applied to the web-based internal objects and external databases [3].
multi-layered technology. The web-based multi-layered RMI applications are often comprised of two separate
application architecture not only can well solve the programs: a Server and a Client. A typical server
problem of maintenance of the client, but also can carried application creates a number of remote objects, makes
out a more detailed breakdown and allocation for the references to those remote objects accessible, and waits for
application of logic through the introduction of clients to invoke methods on those remote objects. A
middleware technology. The distributed object technology typical client application gets a remote reference to one or
makes all objects in the software system can present in any more remote objects in the server and then invokes method
place in the network and can be visited by other objects in son them [4]. Java RMI is a pure java distributed
the remote place, which provides strong support for the computing solution. RMI is allowed to prepare distributed
realization of the reusable components. Application of object in java and allows the object to communicate each
component technology, the design and development of other in memory, objects can communicate across the java
each functional module can be divided and ruled, and the virtual machine and can also across the physical devices.
software reusability can be improved. The RMI object is composed of remote interfaces and
These theories and technologies provide a good support its implementations, when the RMI client makes use of
for the distributed application based on web. On the whole, these methods to visit remote interfaces, these method calls
although the general methodology and technology about will be transmitted to the RMI server across the network.
the architecture and components generally matures, there The RMI server makes use of these methods to visit the
are still some questions, such as the problems of Windows objects that RMI realized and then puts the results back to

978-0-7695-3682-8/09 $25.00 © 2009 IEEE 618


DOI 10.1109/ESIAT.2009.235
the RMI client through the network. The client and the implementation of the target layer, such as Home and
server are not fixed, and their roles can be replaced in the Remote interface of EJB. RMI technology complies with
application procedures. this thought, at the RMI server side, first of all, we should
define and publish the Remote interface, and define the
Server Client implementation methods of the remote objects in the
Application Application Application remote interface (these methods achieve the business
logic), but for the client, only these long-range interface is
visible, as for the realization of the interface, and the client
is transparent. In addition, because RMI supports the
Skeletons Stubs distributed computing and it has well inherited the features
RMI System Remote Reference Layer of java’s portability and security, therefore, we can transfer
the RMI server to the most suitable node in the network,
Transport Layer
and in the client we call the java object in the remote host
Figure 1. The basic architecture of Java RMI object like calling the local member of the java object.
That is, it realizes the remote object of the business logic
The transmission of java objects between the client and [7].
the server is through the use of the grouped root procedure In the specific implementation process, we can carry
(stub) and the framework procedure (skeleton). When out logic partition of the whole system according to needs,
client need to be invoked methods of the remote object, which can be take the partition of corporate sector as a unit
parameters are encapsulated in the root process of the as an example. Each sector represents a RMI remote object,
remote object, which is transferred to the server after being the business logic of each sector is encapsulated in the
grouped. At the server side, the framework procedures of method implementation of the corresponding RMI remote
the remote object bring out the parameters of the grouped object. In the future, it can be carried out seamless
root procedures and then transfer it to the actual object to extension of the system making the department as a unit,
perform remote method, the results get back to the client and can make use of the remote interface to publish. The
after the operation is over [5]. implementation is simply introduced.
III. A DESIGN OF THE DISTRIBUTED ARCHITECTURE //Issue remote interface
BASED ON RMI public interface someDepartment extends
In the design process of the whole system, we follow java.rmi.Remote{
the abstract design thought, make reducing the coupling public someMethod() throws RemoteException;
degree as the principle, and make use of the component …
technology and the distributed object technology so as to //other interfaces
achieve the objects of easy to reuse, and easy to achieve }
transparency, and easy to extend, and the high effect of the
technology and economy [6]. 1) Realization of the remote interface.
The distributed architecture design based on the java public class someDepartmentImpl extends
RMI technology that this article puts forward is shown in UnicastRemoteObject implements someDepartment {
figure 2, according to all levels in the RMI platform’s // Constructed Function
position, we divide abstractly the entire architecture into public someDepartmentImpl() throws
tow major parts (client and server) to separately illuminate. RemoteException { };
public someMethod() throws RemoteException {
//Concrete Implementation
RMI Web …
Servers R Server }
M JavaBeans
I (Encapsulate JSP/ // Realization of other interfaces
J
D RMI Client) Servlets …
DBMS
B
C
Server Classes }
Auxiliary Classes 2) Main program
public class companyServer {
Server Client public someDepartmentImpl somDep = null;
public String rmiServer;
Figure 2. A distributed architecture based on Java RMI public int rmiPort;
public void init() {
A. The design and realization of the Server // Access IP address and port of RMI server from
configuration files
In the layered technology, the coupling degree between try {
the general layers shouldn’t too big, therefore, we should // Start registry thread of RMI, and bind on RMI server
carefully design the calling ways between the layers. The on at rmiPort.
calling ways between the layers of some distributed LocateRegistry.createRegistry( rmiPort) ;
software systems put forward request in the form of }
interface. At the same time, different layers only know the catch (RemoteExcep tion re) {
interface of the target layer and needn’t know the specific // Exception handing

619
… //Get IP address and port of RMI server
} …
} public String rmiUrl = "//" + rmiServer + ":"
public void registerManager() throws + rmiPort;
RemoteException, MalformedURLException { try {
somDep = new someDepartmentImpl(); // Search remote object through its name, and
String url = "//" + rmiServer + ":" + rmiPort + "/"; return the remote interface reference
// Bind on the name of remote object at its reference somDep = (someDepartment)
Naming.rebind (url + "someDepartment",somDep); Naming.lookup ( rmiUrl+
… "someDepartment" );
// The same way to deal with other remote object //Search other remote objects
} …
public companyServer() { }
init(); catch ( Exception ex) {
try { // Exception handing
registerManager() ; …
} }
catch ( Exception ex) { }
// Exception handing public someMethod() throws RemoteException {
… return somDep.someMethod();
} }
public static void main ( String[ ] args) { //Calls all the remote methods of remote object
companyServer server = new companyServer(); …
java.lang.Object sync = new java.lang.Object() ; }
synchronized (sync) {
try{ IV. THE TRANSPLANT TOWARDS THE EJB
// Wait for the request of the client at The distributed applications by use the architecture
Services design and development of this article presents can be
sync.wait() ; required easy to transplant to the EJB at the time. In the
} following, this article introduces the conversion between
catch ( InterruptedException ie) { them [9].
// Exception handing This article assumes to express the defined remote
… interface with the interface function, realize the service
} method that the interface defined with the “interfaceImpl”,
} and express the client with the “RMIclient”. One EJB
} component needs two interfaces, one is used to get a
B. Design and implementation of the Client handle on the container (EJBHome), and another is used to
publish the provided services (EJBObject).
In the framework that this article proposed, JavaBeans According to the previous assumption, for EJB
don’t package the implementation of the business logic components, the conventionally way of naming is:
like the usual, in fact it doesn’t do any specific things, and interfaceBean, interface, interfaceHome 。 Under the
only carries out re-package of the client of the RMI, this environment of EJB, interface extend EJBobject, its
makes the system easier to do the expansion and defined method with the interface in the RMI system is the
maintenance, there is always only one JavaBeans in the same method, but this interface is no longer extend the
entire system, it almost doesn’t have an impact on the Remote interface, and it is extend EJBObject.
JavaBeans regardless of the increase or decrease of the InterfaceBean is an enterprise Bean, it realizes the
business, it can be looked as an another abstract of the sessionBean interface, and this interface has an ejbCreate
business logic in the JavaBeans and make use of method, regardless when to use the create method in the
JavaBeans ’ characteristics. The API of JavaBeans interfaceHome, ejbCreate method will be called.
provides a standard format for the java class, the user This article uses the ejbCreate method and the
needn’t direct the preparation of any code and can setsessionContext method to substitute the main function
manipulate these categories, as well as model Ⅰ (JSP+ of the RMI system in the interfaceBean. In addition,
JavaBeans) and model Ⅱ(JSP+ Servlets+ JavaBeans) [8]. SessionBean class includes some methods to manage Bean:
The design at that layer makes the developers call the ejbCreate method, ejbRemove method, ejbActivate
implementation of the business logic at that layer more method, ejbPassivate method, etc.
conveniently and more efficiently. Here, we make a brief
introduction about the implementation. TABLE I. RMI AND EJB CONVERSION TABLE

RMI EJB
public class companyBeans RMI Client EJBClient
{ interfaceImpl interfaceBean
public someDepartment somDep = null;
Interface interface
public void setRmi()
{ interfaceHome

620
V. CONCLUSIONS
This article puts forward a kind of distributed
architecture based on the java RMI technology. This
architecture of the system is definite and has reduced the
complexity of development, which has good scalability
and flexibility making the system easier to maintain.
Compared to the architecture Servlet/JSP and JavaBeans, it
can adapt to a more large-scale distributed applications.
Considered fully from the point of the economy, it has
reduced the development cost and it can quickly transplant
towards the application server of better performance and
more expensive when it can meet the system requirements
and the economic conditions is allowed. The architecture
design of the system is a very complicated job, involving a
lot of related technology and theory. This article only
discussed it from one aspect, and there are a lot of
questions worthy of further resolving and studying.
ACKNOWLEDGMENTS
The work was partly supported by the Foundation of
Hubei Provincial Department of Education (Grant No.
B20081705 , 2008d062).

REFERENCES
[1] Chung-Kai Chen, Cheng-Wei Chen, “Mobile Java RMI support
over heterogeneous wireless networks: A case study,” Journal of
Parallel and Distributed Computing, vol.68, pp.1425-1436,
Nov.2008.
[2] Martin Alt, Sergei Gorlatch, “Adapting Java RMI for grid
computing,” Future Generation Computer Systems, vol. 21,
pp.699-707, 2005.
[3] Juric, M.B, Rozman, I.G, “Performance comparison of CORBA
and RMI,” Information&Software Technology, vol. 42, pp.915-935,
2000.
[4] Sun Microsystems, Inc., “Java Remote Method Invocation
Specification,” Apr.2009, http://java.sun.com/j2se/1.5/pdf/rmi-
spec-1.5.0.pdf .
[5] Cs.columbia,“Remote Method Invocation, ” Apr. 2009,
http://www1.cs.columbia.edu/~lok/3101/lectures/06-rmi.pdf.
[6] Chih-Chieh Yang, Chung-Kai Chen, Yu-Hao Chang, ect.,
“Software architecture design for streaming Java RMI,” Science of
Computer Programming, vol. 70, pp. 168-184, 2008.
[7] Matjaz B. Juric, Ivan Rozman, Bostjan Brumen, etc., “Comparison
of performance of Web services,WS-Security, RMI, and RMI–
SSL,” Journal of Systems and Software, vol. 79, pp. 689-700,
2006.
[8] Alexander Ahern, Nobuko Yoshida, “Formalising Java RMI with
explicit code mobility,” Theoretical Computer Science, vol.389,
pp341-410, 2007.
[9] T. F. Lunney, A. J. McCaughey, “Component based distributed
systems – CORBA and EJB in context,” Computer Physics
Communications, vol. 127, pp.207-214, 2000.

621

You might also like