HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
mBedded Server 4.0, by Prosyst, by Don Walker

How many appliances do you have in your household? Unless you're currently a contestant on "Survivor" island, the answer is probably over 20. Refrigerators, microwaves, TVs, VCRs, dishwashers, vacuum cleaners, and the favorite appliance of so many programmers - the coffeemaker. The list goes on. Unfortunately, although appliances have grown increasingly intelligent in recent years, they tend to exist in their own individual universes, oblivious to the world around them.

Wouldn't it be nice if our appliances could pool their resources and take advantage of the Internet? An automobile could use a cell phone to schedule maintenance and record the appointment in a personal digital assistant. A blood pressure monitor could immediately alert a hospital in the event of an emergency.

Although homeowners could take an active role, for example, by using remote access to turn an appliance on or off or to check the home security system, installation would have to be "Plug-and-Play." It would be too much to expect even the most technically savvy homeowner to link up appliances throughout the home, particularly since many appliances could interact in ways that were not even conceived of by the product manufacturers.

Despite this complexity, this is exactly the type of convenience we should expect in the near future according to ProSyst Software, the developers of mBedded Server 4.0 - a Jini- and WAP-enabled server designed specifically with embedded products in mind.

Device of Embedded Services
The job of orchestrating cooperation between a variety of appliances is made more difficult by the fact that the devices are likely to have been manufactured by different companies at different times and in different places. Adding further to the complexity is the fact that these devices may need to access external networks across the Internet (to schedule maintenance or report medical information, for example).

To help deal with this complexity, communication can be funneled through a single device in the home or office that's responsible for managing client requests on the local network, allocating resources, and providing a gateway to the Internet. ProSyst refers to this as the device of embedded services. mBedded Server 4.0 is a server infrastructure that can reside on or be downloaded to the device of embedded services in order to provide this functionality. Because mBedded Server 4.0 is 100% Java, it's platform independent. Consequently the device of embedded services can be any machine that offers a Java Virtual Machine (JVM).

Open Services Gateway Initiative
Non-PC devices require new means of exchanging data on the Internet. Not only does your blood pressure monitor need to communicate across the Internet with the hospital, but also, conversely, the service provider may want to install updated software on your local network.

The Open Services Gateway Initiative (OSGi) is a group of over 60 companies (including Cisco Systems, Compaq, Ericsson, GTE, IBM, Maytag, Motorola, Nokia, Oracle, ProSyst, Sony, Sun, Whirlpool, and others) that offer a solution. This solution revolves around the concept of a services gateway. The Open Services Gateway (OSG) is an embedded server that resides between the local and remote networks. The OSGi specification describes an API that can be used by network operators and device manufacturers for a variety of purposes, including managing the secure delivery of services from trusted service providers.

In this model, services provided by the various devices are packaged into components called bundles that can be installed, started, stopped, removed, and updated as necessary by the framework. Bundles can register services for other devices to use and look up ones for their own use.

The bundles are JAR files that contain resources needed by the service (such as Java classes) and a Manifest file used by the framework to activate the bundle.

Service Container Architecture
mBedded Server 4.0 complies with the OSGi specifications through its "Service Container" architecture. Devices communicate by sharing services. These services are provided by the devices themselves or installed on the server using the administrator applications provided with mBedded Server.

The services provided with mBedded Server 4.0 include:

  • Core services: Login, log, and remote file
  • Administration: Administration and user manager
  • Jini services: Jini container and lookup
  • Mail services: FTP client, IMAP, MIME, NNTP, POP3, and SMTP
  • Web services: HTTP(S) (including Servlet support) and DNS client
  • Message services: Message queue and publish/subscribe
  • Request services: PMP (ProSyst Messaging Protocol), PMPTCP, request, and stack
  • Other services: Crypt
  • Example services: Printer and schedule
The power and flexibility of the system allow for the seamless addition of new services and the updating of existing services from a remote administrator application without shutting down the server. The ability to do remote administration is important since it's possible that the device of embedded services lacks a display.

This flexibility also makes it possible to configure the server to optimize disk space and memory usage - an important consideration in the world of embedded devices. mBedded Server 4.0 needs 100KB-500KB of disk space depending on the services required.

Creating a Simple Bundle
To demonstrate how easy it is to create, install, and use the services of a bundle, we can design a service that simply displays a string of text that's passed as a parameter.

The first step is to create an interface for the service.

public interface SimpleTextDisplayer

public void displaySimpleText(String theText);

The second step is to create the class that implements the service and any support classes that might be needed. In this simple example only the SimpleDisplayImpl class in Listing 1 is required. This class merely provides a frame for a label that displays the text passed to displaySimpleText().

The third step is to create an activator class. The framework uses this class when the bundle is started, and is responsible for registering the service (see Listing 2).

The BundleContext object that's passed as a parameter to start() provides access to the framework and allows the bundle to call registerService() to register SimpleTextDisplayer as a service.

The fourth step is to create a manifest file. This file provides information about the bundle, including the name of the activator class that assists the framework in starting the bundle and the names of other packages this bundle relies on to provide its service or services.

Bundle-Vendor: JDJ
Bundle-Version: 1.0
Bundle-Activator: SimpleDisplayActivator
Bundle-Name: SimpleDisplay
Export-Service: SimpleTextDisplayer

Finally, the three class files and the manifest file are packed up in a JAR file and the bundle is ready to be installed on the server.

Administrator Applications
Installing and starting our sample bundle can be done easily using one of the administrator applications provided with mBedded Server 4.0. The choices include:

  • SGUI: Visual administrator using Swing technology
  • PGUI: Visual administrator using the ProSyst GUI library
  • HTTP: Visual administration using any standard Web browser
  • WAP: Visual administration using a mobile phone with WAP (Wireless Application Protocol) or a WAP emulation environment
  • Telnet: Console administrator
By using the PGUI Administrator, installing the bundle is as easy as clicking the install button and navigating to the proper JAR file. Starting the bundle is almost as easy - click the start button. If a problem exists, a dialog box will appear and offer to provide details. Access is available to information about each currently installed bundle (see Figure 1), and certain bundles provide property editors so they can be easily modified. For example, the server port for the PMP bundle could be changed here.

Figure 1
Figure 1:

In addition, there's an event viewer that documents activities on the server, including when bundles were installed or services registered.

Using Services from an Application
To complete our simple demonstration, we need an application that can make a connection to the server and locate and use the SimpleTextDisplayer service (see Listing 3).

The call to connect() tries to establish a connection with the ProSyst Message Protocol (PMP) Service at port 1449, which is where the service listens and getReference() returns a registered service. The functions getMethod() and invoke() result in the execution of the service and the display of the SimpleDisplayImpl frame with the message "This String came from SimpleSend" (see Figure 2) confirming that the SimpleSend application was able to locate and execute the desired service.

Figure 2
Figure 2:

Demos and Documentation
mBedded Server 4.0 comes with numerous demos and extensive documentation. The documentation includes the APIs for the OSGi specification and for the services provided by ProSyst.

Author Bio
Don Walker is cofounder and chief architect of Entice Software Corporation. He has over 15 years of experience in software development, working previously as a project lead at Simon & Schuster's Learning Technology Group.

[email protected]
Test Environment
OS: Windows 95
Processor: 233MHz Pentium II
Memory: 32MB

ProSyst USA
555 NorthPoint Center East
Studio 450
Alpharetta, GA 30022
Web: www.prosyst.com
Phone: 678 366-4607
E-mail: [email protected]


Listing 1

import java.awt.event.*;
import java.awt.*;

public class SimpleDisplayImpl extends Frame implements SimpleTextDisplayer {
	Label theTextToDisplay = new Label("",Label.CENTER);
	public SimpleDisplayImpl() {


	public void displaySimpleText(String theNewText) {

	private void initializeUI(){


		addWindowListener(new WindowAdapter(){
		public void windowClosing(java.awt.event.WindowEvent e) {

Listing 2

import org.osgi.framework.*;

import java.util.*;

//	Class SimpleDisplayActivator
//		activates the SimpleDisplay Service bundle

public class SimpleDisplayActivator implements BundleActivator {

	public void start(BundleContext bc) throws BundleException {
		try {  

			SimpleDisplayImpl tImpl = new SimpleDisplayImpl(); 
			Hashtable dict = new Hashtable();

			dict.put("Description", "SimpleTextDisplayer service");
			ServiceRegistration servReg
= bc.registerService("SimpleTextDisplayer", tImpl, dict);

		} catch (Exception e) {

			throw new BundleException("Failure in start method, " + e.getMessage(), e);


	public void stop(BundleContext bc) throws BundleException {



import com.prosyst.mbs.client.pmp.*;

public class SimpleSend {

static String SIMPLEDISPLAY = "SimpleTextDisplayer";

	// This demonstrates how to
	//	call a method of some service in the framework through PMP.

	public static void main(String [] args) {

		try {      

			// Init connection object.

			Connection con = new Connection();
1449, "admin", "admin", (byte) 0);

			// Get remote reference to service.

			RemoteObject rObject = con.getReference(SIMPLEDISPLAY, "");                        

			String [] str = new String[1];
			str[0] = new String("java.lang.String");      

			// Get method of service.

			RemoteMethod rMethod = rObject.getMethod("displaySimpleText", str);             
			Object [] objArr = new Object[1];      
			objArr[0] = new String("This String came from SimpleSend");

			// Call method.

			rMethod.invoke(objArr, false);                        

		} catch (Exception e) {




All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.