Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Our Working Jini Example

For the rest of this chapter, we will discuss Jini in terms of a single example, that of a Morse code printer. The Morse code printer itself is a small black box out of which come two cables, one for the Ethernet network, and one for power (some networking solutions use standard 60-Hz ac power lines as their medium rather than Ethernet cables. In that instance, we would only need one cable, the power cord!). Also affixed to the box are two large LEDs, one red and one green. Inside our little network printer is a complete JVM with all of the appropriate Java 2.0 and Jini 1.0 libraries. The printer works by translating messages sent to it into "dashes" and "dots" flashed out by the green LED according to the standard Morse code protocol. In this way, a message consisting of "SOS" would cause the green light to pulse three times quickly, three times slowly, and then three times quickly again.

Morse code was invented over a century ago and wasn't originally conceived of for use as a Jini-based print server (although it does work surprisingly well for this). During the course of a message translation, it is possible that a situation could arise that Morse code is unable to account for. In this case, the red LED will flash, indicating that an error has occurred, and the printer will skip the untranslatable characters and continue on.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint