Jini for Home Middleware

Jan Newmarch

Home middleware

Jini

UPnP

Technical comparison

Jini UPnP
Service adverts via a Lookup Service (LUS) Direct multicast
Service discovery via an LUS Direct multicast
Discovery protocol fixed fixed
Service invocation protocol Unspecified (JRMP, Jeri, IIOP, etc) SOAP
Object references Java proxy objects URLs or XML documents
Mobility
LUS proxy (to client and service)
Service proxy (to client)
Method call arguments (to service)
Method call result (to client)
Listener registration (to service and LUS)
Unknown class definitions downloaded from an HTTP server
None
Language Java only Agnostic

Object mobility

Method level object mobility

LUS proxy mobility

Listeners

Object mobility changes

The change is shown as

Removing the HTTP server

Situation so far: ZeroConf

Lessons from JMatos

Lessons for Jini/UPnP

Piggybacking service definitions off UPnP

Example: UPnP service definition

A typical XML service document (for a timer service) is


<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0" >
    <specVersion>
	<major>1</major>
	<minor>0</minor>
    </specVersion>
    <actionList>
	<action>
	    <name>SetTime</name>
	    <argumentList>
		<argument>
		    <name>NewTime</name>
  		    <relatedStateVariable>Time</relatedStateVariable>
		    <direction>in</direction>
		</argument>
	    </argumentList>
	</action>
	<action>
	    <name>GetTime</name>
	    <argumentList>
		<argument>
		    <name>CurrentTime</name>
		    <relatedStateVariable>Time</relatedStateVariable>
		    <direction>out</direction>
		</argument>
	    </argumentList>
	</action>
        <action>
            <name>TimeValid</name>
            <argumentList>
		<argument>
		    <name>Valid</name>
		    <relatedStateVariable>TimeValid</relatedStateVariable>
		    <direction>out</direction>
		</argument>
	    </argumentList>
	</action>
    </actionList>
    <serviceStateTable>
	<stateVariable sendEvents="no">
	    <name>Time</name>
	    <dataType>time</dataType>
	    <!-- <dataType>string</dataType> -->
	</stateVariable>
	<stateVariable sendEvents="yes">
	    <name>TimeValid</name>
	    <dataType>boolean</dataType>
	</stateVariable>
    </serviceStateTable>
</scpd>

Example: UPnP service definition in Java

The generated Java interface is


public interface urn_schemas_upnp_org_service_timer_1 extends Remote {
     void SetTime(time NewTime) throws RemoteException;
     void GetTime(timeHolder CurrentTime) throws RemoteException;
     void TimeValid(booleanHolder Valid) throws RemoteException;
 }

(where the service name is actually pulled out of the device file description)

The lack of conformance to Java naming conventions is typical for non-Java middleware systems :-)

Making UPnP services available as Jini services

Extensions to Web Services

What's in it for Jini?

Hierarchical services?

A possible use is a sensor network of dumb Jini devices coordinated by a smart Jini client which in turn is a Jini service to other clients

Jini without Java

Current status


Jan Newmarch (http://jan.newmarch.name)
jan@newmarch.name
Last modified: Tue Oct 26 14:06:29 EST 2004
Copyright ©Jan Newmarch