Programming Open Service Gateways with Java Embedded Server Technology

  • Authors:
  • Kirk Chen

  • Affiliations:
  • -

  • Venue:
  • Programming Open Service Gateways with Java Embedded Server Technology
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

From the Book:Technology is invented and advanced by, well, technical people. However, a truly successful technology is marked by its adoption by people in their daily lives. Few ponder radio frequency modulation when they turn on the TV, or the internal combustion engine when they drive around. The technology has disappeared behind the utility.The last decade saw two new technologies begin to blend into our lives: the computer and the Internet. We only need to launch a browser and the resources of the World Wide Web are at our fingertips, and we are hard pressed to tell the difference between a computer and a game console, a personal digital assistant (such as PalmPilot), or a cell phone. It is now entirely feasible to bring services to smart consumer devices at home and to small businesses through the Internet. Utility providers and network, computer, wireless, consumer electronics, and home appliance companies recognize the tremendous potential and have started to tap into this market. As a result, new horizons are open for application developers.The Open Services Gateway Initiative (OSGi) was formed to explore these exciting opportunities, and its membership includes such diverse companies as Bell South, Echelon, Electricite de France, IBM, Sun, Ericsson, Nokia, Sony, Maytag, and Whirlpool, to name just a few from a roster of more than 80 organizations. With these combined resources, OSGi stands a good chance to turn this vision into reality.The OSGi Service Gateway Specification 1.0 defines a Java™ technology-based software architecture for developing and deploying services, which is the topic of this book.What compels us to write this book, inaddition to our enthusiasm for the emerging new applications, is the unique software model involved. We stumbled through a lot of unfamiliar territory ourselves when we worked on the Java Embedded Server™ product, the predecessor to the OSGi Service Gateway Specification, only to find our fellow developers encountering and struggling with the same class of problems. It is our hope to be able to elucidate the model and capture the hard-won solutions in one place.This book is primarily for programmers interested in writing services for residential gateways in the Java programming language. It should also be useful to anyone who wants to learn about residential gateway technology and the efforts made by the OSGi consortium.This book may be of interest to those who are involved with component-based software construction in general. Interestingly, nothing in the underlying programming model limits the kinds of applications that can be written. It aims at residential gateway applications at the "small" end of the spectrum in terms of code size and resource consumption, but it is just as viable for developing applications for desktop and enterprise environments. Indeed, the task will be made easier and the end result will be more powerful when fewer constraints on computing resources are imposed.We assume the readers are well versed in the Java programming language and experienced in software development on the Java platform. However, no experience is needed in embedded systems at the hardware and operating system levels.Many trade-offs on the contents of the book had to be considered, and these were not easy decisions to make. We wrote this book with the following goals in mind: Practical. This book is about programming service gateways and is primarily for programmers; therefore, a lot of its content is devoted to coding. The book does not dwell on the high-level vision, and it gets down to earth promptly. As a result, the material is best understood by practicing the examples near a computer. Reading it on a beach chair will almost surely ruin your vacation. Software Only. We are primarily concerned with the software aspect of the residential gateway, and particularly with applications for the Java platform. We don't deal with hardware design and configuration or operating system and system software of the gateway in this book. "Horizontal." One of the biggest challenges in developing examples for the book is to stay "horizontal" and relevant at the same time. By "horizontal" we mean you do not need to acquire highly specialized hardware and software to learn how to program a gateway. All the examples in this book can be built and run on a familiar personal computer or a workstation. We want to focus our effort on the generic mechanisms that apply to all service gateways with the OSGi architecture, rather than diverge into specifics of certain systems that are interesting to some readers but alien to others. For instance, as part of the Java Embedded Server project we have developed code to control a vending machine, a smart coffee maker, an NEC touch-panel golf score keeper, an Ericsson e-box, and an X10 lamp module. From first-hand experience we know that what we present is entirely within the realm of feasibility. However, the aforementioned applications are simply too complicated or have details that a specialized to be good tutorials. Realistic. We are not going to program a refrigerator, a washing machine, a microwave, a thermostat, or a toaster in this book. It is still not possible to go to Sears and buy a freezer that watches inventory and downloads e-coupons. Our smart espresso machine, for which we programmed a Web interface to monitor its water level and temperature and to control caffeine potency, uses proprietary commands and is not generally available. Many of the similar appliances we've seen are prototypes. This, however, is more an issue of business development than technological know-how. With the application development paradigm presented here, you should be able to develop applications for these smart appliances when they do roll down the production line en masse. Focused Scope. The technologies applicable to residential gateway applications have mushroomed during the last few years. Each warrants a book of its own to treat the subject thoroughly. Therefore, we do not teach you BlueTooth, USB, or HomePNA here. We are confident that experts in these areas can readily plug implementations of these technologies into the OSGi framework after they have learned how it works and what benefits it brings.Organization of the BookYou can read this book from cover to cover, or you can select the chapters that address your particular needs. For the impatient, it is possible to jump to Chapter 4 and try out the code in action, because clear step-by-step instructions are given. However, you are strongly encouraged to read Chapter 3, which puts things into context.Chapter 1 describes the backdrop from which the residential gateway market em and its propellants and challenges, then explains the history of the Java Embedded Server product and the OSGi consortium, and introduces our view of what OSGi is trying to achieve.Chapter 2 outlines steps to develop your first bundle and familiarizes you with the Java Embedded Server execution environment.Chapter 3 explains the OSGi architecture and basic concepts, including the interaction of various entities during interbundle class sharing, service registration and retrieval, and bundle life cycle operations.Chapter 4 teaches you how to develop services, how to write library bundles, and how to include native code in your bundles. Two advanced examples are given in this chapter.Chapter 5 analyzes the dynamic nature of cooperation with services, and proposes strategies to cope with the situation. Events are also discussed at the beginning of this chapter. Chapter 6 describes design patterns and pitfalls.Chapter 7 explains how to use the OSGi standard services: HTTP and Log services. Chapter 8 explains the OSGi Device Access (DA) and how to develop services to communicate with devices using the DA.Chapter 9 discusses permission-based security and administration.Chapter 10 summarizes the issues being worked and our view of the future directions that the OSGi consortium could take.Appendix A contains the complete source code of the examples in this book.Appendix B is a copy of the OSGi specification. A list of references is included at the end of the book.Online ResourcesA copy of the Java Embedded Server product can be downloaded from Sun Microsystems' Web site athttp://www.sun.com/software/embeddedserverFor updated information about the book, visit the following URL:http://java.sun.com/docs/books/jesFull details of the OSGi consortium can be found at http://www.osgi.org