Serve clients' specific protocol requirements with Brazil, Part 1
Learn how to build an application server that can deliver data to clients requiring different protocols
By Rinaldo Di Giorgio, JavaWorld.com, 08/11/00
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Reusing code to concurrently support different interface options is not an easy task for a developer. The purpose of this
series is to facilitate this process by showing you how to build a simple application server that supports clients using any
of the J2EE APIs. I will demonstrate how to deliver data from a device or other source to clients requiring a specific protocol
or a delivery guarantee that must support multiple protocols.
Read the whole series on Brazil technology:
The Brazil Web server, which I introduced in my previous column, will be implemented as an experimental application server. (See the sidebar below, Brazil: An extensible Java Web server, for more information about the Brazil project.) In that article, I discussed how you can support X10 devices by means of
a Brazil handler. This time around, the handlers, which realize specific interfaces for different connection protocols, will
extend the Brazil Web server so that users can employ varying network protocols and technologies to connect to it.
Consider delivering data from a weather station to a mixture of users on the Internet, as shown in Figure 1:

Figure 1. Delivering data to diverse clients
The figure demonstrates that you may have users on limited-bandwidth connections -- like radio links to handheld devices,
pagers, phones, and PDAs -- and high client bandwidth multicast services -- like satellites telemetry applications requiring
constant updates, and cable modem, DSL, and traditional modem users. In future columns, we will examine prototypes that use
a delegation model to utilize the technologies in the figure, while at the same time maximizing code reuse with simultaneous
support for Jini, JRMS, RMI, JDBC, JMS, HTTP, applets, and JavaScript.
This article introduces an architecture that utilizes a Web server as a resource contention manager, a basic service provider
(for file services), and a general supplier of an application service (for weather data). The Brazil Web server differs from
current Web servers in that it is smaller and easier to comprehend, and provides users with an old abstraction -- property
objects. Use of property objects with the Brazil Scripting Language (BSL) provides an integrated Web content delivery system
with no out-of-band scripts, which allows easy access to data on the server. Thus, placing server data that is not a file
on a Webpage becomes trivial.
The advantage of this approach is that the Web server also doubles as the foundation for delivering services to users with
different requirements, yet utilizes the same code base and provides a unified interface to the varying protocol drivers.
Often these services require some additional interfaces and/or management abilities. By using a variety of mechanisms, the
Brazil Web server can provide authenticated, secure access to these services.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- Weather station, source code, and examples
http://24.228.0.167:8090/
- "How Handlers Work in Web-Accessible Home Automation," Rinaldo Di Giorgio, Colin Stevens, and Stephen Uhler (JavaWorld, May 2000)
http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-javadev.html
- "An Introduction to the URL Programming Interface," Rinaldo Di Giorgio (JavaWorld, August 1999)
http://www.javaworld.com/javaworld/jw-08-1999/jw-09-javadev.html
- "An Instrumentation Network for Weather Data on the Web," Rinaldo Di Giorgio and Brian Hindman (JavaWorld, May 1999) -- background on weather stations and the TMEX protocol
http://www.javaworld.com/javaworld/jw-05-1999/jw-05-javadev.html
- "Restricted-Channel Mulitcast in Java," Jason Scherer with contribution by Rinaldo Di Giorgio (JavaWorld, September 1998) -- discussion on JRMS
http://www.javaworld.com/javaworld/jw-09-1998/jw-09-javadev.html
- Download the Brazil Project Web server
http://www.sun.com/research/brazil/
- Java Web Start
http://java.sun.com/products/javawebstart/
- Brazil documentation and API
http://www.sun.com/research
- Java Message Queue
http://www.sun.com/workshop/jmq
- Java Message Service API
http://java.sun.com/products/jms
- More about TINI
http://www.ibutton.com/TINI
- Register for the Jeather Jini group
http://developer.jini.org/exchange/projects/jeather/
- Register for the Jini Global Positioning Service (JGPS) project
http://developer.jini.org/exchange/projects/jeather/
- Register for the Jini Commerce project
http://developer.jini.org/exchange/projects/jommerce/
- More information on Jini
http://www.jini.org/resources/
- Software complexity measures and metrics
http://www.sei.cmu.edu/activities/str/descriptions/halstead_body.html
- Maintainability index technique for measuring program maintainability
http://www.sei.cmu.edu/activities/str/descriptions/mitmpm.html
- Function point analysis
http://www.sei.cmu.edu/activities/str/descriptions/fpa_body.html
- Past Java Developer columns in JavaWorld: http://www.javaworld.com/javaworld/topicalindex/jw-ti-javadev.html