Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Java-Based Gateway Middleware for the Web
Java-Based Gateway Middleware for the Web

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
In organizations where Internet/Intranets and various heterogeneous servers are deployed, end users normally need to know certain resource information such as server name, processing capability, types of services supported, etc., in order to access the resources. There is a need to provide a one stop and transparent access of services so that the users need not worry about the servers' attributes, location or network details. This gives rise to the proposed Java-based Gateway middleware, which is able to receive the clients' requests and perform the tasks without the need to specify the execution details in their requests.

The middleware is designed with the following characteristics:

  • Distributed and dynamic - Provides distributed execution based on the client's requests, and it also supports dynamic configuration of the service execution network.
  • Autonomous - Active, self-contained, independent and long-life so that it can assist the clients in performing tasks without the knowledge of the underlying detail; e.g., server location, network information.
  • Open service provider - Provides transparent and consolidated services to the client, such as location transparency.

    Figure 2 shows the bird's eye view of the Gateway middleware, which includes:

  • Clients: A Web browser is used as the interface whereby the client can submit its request to the Gateway middleware and wait for the outcome.
  • Service agents: This consists of a participating pool of service agents such as Unix hosts and Microsoft NT hosts, which register themselves through the Gateway middleware with the types of services they can support.
  • Gateway middleware: It is comprised of three main components:
    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
    Java-based Gateway Middleware set up done

    Upon executing, it initiates the four main components of the middleware; i.e., Facilitator, Registry, Receptionist and Dispatcher.

    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

    whereby the indicates the location of the Gateway middleware.

    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.
    2. Clients submit their requests: The clients submit their requests to the Receptionist through the Web browser (Here, the Hotjava [5] browser is used for illustration). Here, we use a simple example which is to compute the distance between any n-dimensional vectors as an illustration for the task request. In fact, the service can be in any form of executable which is to be executed on the Service Agent. The client submits its request for computing Euclidean distance for the specified two-dimensional vectors (3, 5) and (9, 19). In this case, a C program (euclidean.c) is written to accept data (including the dimension of the vector; i.e., 2 and the two specified vectors) from the standard input and to display the computed result to the standard output (see Listing 2). Upon receiving the request from the client, the Java-based Gateway middleware will direct the request to the respective Service agent for execution. Upon successful execution, the result of the execution will then be displayed in the TextArea box.

    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.
    3. Receptionist is always listening to the Channel, ch_reception (see the run() method of Listing 4) for any incoming request. Upon receiving any request from the clients, the Receptionist, which serves as a single contact-point between the client and the middleware, forwards the request to the Dispatcher for any action to be taken.
    4. The Dispatcher delegates the task to a suitable service agent (see the run() method of Listing 5) based on the devised algorithm (a simple First-Come-First-Serve scheduling algorithm is used in this article).
    5. Upon receiving the assigned task from the Dispatcher, the respective Service agent spawns the execution (see Listing 6) by creating a SpawnProcess object:

    ... SpawnProcess sp = new SpawnProcess(gateway_hostname, clientID, request);
    sp.start();
    ...

    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

  • intention indicates the nature of the request (e.g. Register, Request etc).
  • communication information includes client-id, sender, etc.
  • message body contains the content depending on the intention; e.g., task to be executed, input data etc.

    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.

    /**
    * Message Format class.
    */
    class Message implements Serializable {
    protected String intention;
    protected String communication;
    protected Object content;


    public Message() { super(); }
    }

    Conclusion
    In this article, a prototyped Java-based Gateway middleware is discussed in detail. It is still in its infancy stage, and there is still room for improvement (some aspects of which are currently under investigation):

  • Exception handling
  • Authentication and security; e.g., encryption
  • Efficient scheduling algorithms to ensure fair and efficient dispatching of tasks
  • Load monitoring and balancing
  • Fully distributed Gateway services building upon RMI (Remote Method Invocation) [6] and CORBA (Common Object Request Broker Architecture) [7].

    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
    1. Robert Orfali, Dan Harkey, Jeri Edwards (1994). Essential Client/Server Survival Guide. pp. 18-19.
    2. Javasoft. Java JDK 1.1: http://www.javasoft.com/products/jdk/1.1/docs/api/package.html
    3. Siet-Leng Lai, Joo-Hwee Lim, (1996). "Channel: A Communication Component",
    Java Developer's Journal, Volume 1, Issue 3, pp. 20- 27.
    4. JavaSoft. Javaª Object Serialization Specification: http://www.javasoft.com/products/rmi/doc/serial-spec/serialTOC.doc.html
    5. JavaSoft. HotJava: http://www.javasoft.com/products/hotjava
    6. Javasoft, Remote Method Invocation:
    http://www.javasoft.com/products/jdk/rmi/index.html
    7. CORBA (Common Object Request Broker Architecture): http://www.OMG.org
    8. Visigenic, Visibroker: http://www.visigenic.com

    About Siet-Lang Lai
    Siet-Leng Lai has published and presented at several international conferences,
    and is now conducting research into XML, WML and WAP. Since 1990 she has been
    a lecturer at the Center for Computer Studies, Ngee Ann Polytechnic, Singapore,
    on subjects ranging from operating systems, system programming, networking,
    Internet computing, and parallel and distributed computer systems to intelligent
    building. Lai has also conducted short courses for the public on the above-
    mentioned topics. She holds degrees from the National University of Singapore.

    About Joo-Hwee Lim
    Joo-Hwee Lim proposed novel neural networks techniques for timetabling and developed execution monitoring engine for a complex planner. He is now a senior software engineer leading an Agent Engineering Team researching agent-based software engineering and multi-agent systems using Java. The project is funded by Japan's Real World Computing Partnership.

  • In order to post a comment you need to be registered and logged in.

    Register | Sign-in

    Reader Feedback: Page 1 of 1

    Enterprise Open Source Magazine Latest Stories . . .
    With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and st...
    AMD said late Tuesday that its chief sales officer Emilio Ghilardi had left the company and that CEO and president Rory Read is going to do his job while a replacement is sought. AMD didn’t say why Ghilardi left but it’s assumed Read wants his own people. Read is relatively new to th...
    During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers. M3 execution procedure was outlined in this previous article. The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocati...
    Red Hat is putting its bought-in Gluster scale-out NAS storage technology, acquired in October, on the Amazon cloud. It’s styled Red Hat Virtual Storage Appliance for Amazon Web Services and other clouds are supposed to follow in short order.
    A new episode of the screencast series is now available at the OpenNebula YouTube Channel. This screencast demonstrates the new easily-customizable self-service portal for cloud consumers. Its aim is to offer a simplified access to shared infrastructure for non-IT end users. The scree...
    C12G Labs has just announced an update release of OpenNebulaPro, the enterprise edition of the OpenNebula Toolkit. OpenNebula 3.2, released two weeks ago, brings important benefits to cloud providers with a new easily-customizable self-service portal for cloud consumers, and builders w...
    Subscribe to the World's Most Powerful Newsletters
    Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


    SYS-CON Featured Whitepapers
    ADS BY GOOGLE