|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
General Java Java-Based Gateway Middleware for the Web
Java-Based Gateway Middleware for the Web
Nov. 1, 1997 12:00 AM
Today, the Web has become an indispensable part of our lives. The Web is built based on client/server architecture. Traditionally, the client/server model refers to a two-tier relationship with a desktop client connected over the network to some form of server such as a database server. However, today's client/server applications are shifting from traditional two-tier to multi-tier architecture as shown in Figure 1. Multi-tier client/server architecture offers advantages such as extensibility, greater application scalability and increased reusability of components. In the multi-tier client/server model, a middleware is essential to act as a middle man in facilitating the interaction between the clients and the servers. In a general sense, middlewares cover all the distributed software needed to support interaction between clients and servers [1]. In this article, we look only at service-specific Web middleware which manages interaction among tiers in a Web-based application within a multi-tier architecture. The Web is pervasive in many areas like business, medicine, education, research and development, etc. The Web browser-like interface is emerging as the de facto user interface. However, end-users and applications normally need to have some knowledge about server information (e.g., processing capabilities, availability of servers, types of services provided, server name, etc.) in order to access the available resources. In this evolving and explosive information era, there is certainly a need for some form of Gateway middleman to provide one-stop transparent access of resources. In this article, we will discuss in detail how a proposed Java-based middleware is useful in providing transparent execution of software. We will also discuss how Java sockets and object serialization could be used in implementing the Gateway-like middleware.
Overview of the Gateway Middleware
The middleware is designed with the following characteristics:
Figure 2 shows the bird's eye view of the Gateway middleware, which includes: a. Receptionist - Handles the incoming requests from the clients; forwards them to the Dispatcher and returns the outgoing responses forwarded by the facilitator to the respective clients b. Dispatcher - Main task is to dispatch the requests to the service agents based on a suitable scheduling algorithm; it also maintains a queue of the requests c. Registry - Service agent must register with the Gateway middleware via the Registry in order to contribute to the service pool d. Facilitator - Handles the responses from the service agents and redirects them back to the ReceptionistAnatomy of the Java-based Gateway Middleware The Java-based middleware is developed using Java JDK 1.1.3 [2] and makes use of the Channel [3]. A Channel is a high-level Java-based abstraction of a bi-directional communication component that supports a generic message format. It is developed using Java sockets and object serialization [4], which is the process of reading or writing an object to a stream of bytes suitable for storage in a nonvolatile location; e.g., file. A Channel is a generic reusable software component which starts a thread to listen for incoming messages on a specified port. Any incoming message through the channel will be buffered into a generic message object. Figure 3 shows the interaction among various components of the Java-based Gateway middleware using Channel as the underlying communication component. Listing 1 shows the Gateway class specification. The Java-based Gateway middleware is to be started on the same host as the Web server as a standalone application, as shown below:
> java Gateway In the following discussion, we will describe the interactions among various components in the Gateway middleware in detail according to the steps outlined in Figure 3. 1. Service agents make their service known to the others. First, each service agent is to be started as a standalone application:
> java Service
Each participating service agent will register first with the Registry of the middleware to make its service known so that it can be assigned respective tasks later. For the discussion in this article, homogeneous services are assumed on all service agents. In Figure 4, the service agent contacts Registry through a Channel with a well-known address (a well known port in this case). Then, the registry will assign an unused address (port number) to the requesting service agent which will use it to accept task requests from the Dispatcher in future.
Listing 3 shows the class specification of the ClientApplet respectively. Upon loading of the ClientApplet, it connects to the Gateway Middlware by using a Channel with a well-known port (see Figure 5) and the client is initialized. Then, a unique address (port number in this case) and client id are assigned dynamically by the middleware.
The assigned port for the Channel will be used subsequently for receiving the execution outcome from the Gateway middleware. Once the ClientApplet is initialized, it submits the user-specified request commands to the Receptionist after marshalling it into specific message format (see the submitGateway() method in Listing 3). Then, it listens to the channel with the assigned port number for the outcome of its execution.
...
SpawnProcess sp = new SpawnProcess(gateway_hostname, clientID, request);
The SpawnProcess object starts a new process running externally to the interpreter (see Listing 7). The input data and output result for the execution are communicated to the runtime process through standard input and output streams. This is achieved by using the getOutputStream() and getInputStream() methods of the object process shown in Listing 8. In general, the execution process can be any executable programs.
6. Upon successful execution of the spawned process, the execution result is forwarded to the Facilitator of the Gateway middleware as shown in Listing 10.
Finally, the result is relayed to the client through the Receptionist using a channel with dynamically assigned port address.
The Client communicates with the Gateway middleware through a well-defined message format (see Table 1) whereby
The following class specification for the message format is used homogeneously between any two entities such as client-to-Gateway middleware, components of the Gateway middleware, Service Agent-to-Gateway middleware.
/**
Conclusion
Currently, the Gateway middleware is being developed using Visibroker [8] (an implementation of the CORBA framework) by Visigenic and more extensive testing is also being carried out.
References Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||