OSGi™ Service Platform
Release 3

org.osgi.service.jini
Interface JiniDriver


public interface JiniDriver

A basic interface for a Jini Driver.

This Driver acts as a bridge between a Jini network (community) and an OSGi framework. Using this driver, OSGi services can be exported to the Jini network, and Jini services from the Jini network can be imported into the OSGi framework. This results in two possible transformations: Jini-to-OSGi and OSGi-to-Jini. The Jini Driver is responsible for these transformations.

An OSGi service is a Jini service if it is registered in the framework with the specified properties.

In OSGi-to-Jini transformation, the driver registers OSGi services as Jini services in the discovered LUS.

In Jini-to-OSGi transformation it registers with the framework all discovered LUS and services in the LUS matching the given template.

The Jini Driver can be configured, through a set of properties, to export/import Jini Services.

The properties DEVICE_CATEGORY, EXPORT, LUS_EXPORT_GROUPS, SERVICE_ID, and ENTRIES are service register properties for particular Jini Service (imported or exported).

The properties CM_LUS_IMPORT_GROUPS and CM_LUS_EXPORT_GROUPS are for configuration of the Jini Driver. These properties are kept in the Configuration Management Service defined by OSGi.


Field Summary
static java.lang.String CM_LUS_EXPORT_GROUPS
          Optional service property, which should be a string array, containing the LUS groups that the driver is interested in, when exporting framework services to the Jini network.
static java.lang.String CM_LUS_IMPORT_GROUPS
          Optional service property, which should be a string array, containing the groups of LUS, that the driver is interested in, when importing Jini services.
static java.lang.String DEVICE_CATEGORY
          Constant for the value of the service property DEVICE_CATEGORY used by all Jini services.
static java.lang.String ENTRIES
          Optional service property, which should be an Entry array, holding the attributes set of the framework service that represents Jini proxy in the registration with a LUS.
static java.lang.String EXPORT
          The Export service property is a hint that marks an OSGi service to be picked up and exported by the Jini Driver in the Jini network.
static java.lang.String LUS_EXPORT_GROUPS
          Optional service property, which should contain a string array of the LUS groups that are of interest to the OSGi service.
static java.lang.String SERVICE_ID
          Optional service property, which should contain a string representation of the Jini service ID.
 
Method Summary
 net.jini.core.lookup.ServiceTemplate[] getServiceTemplates()
          Gets the current set of templates that is used for searching and registering services registered in discovered LUS.
 void setServiceTemplates(net.jini.core.lookup.ServiceTemplate[] template)
          The Jini Driver is defined as a Service Factory.
 

Field Detail

DEVICE_CATEGORY

public static final java.lang.String DEVICE_CATEGORY
Constant for the value of the service property DEVICE_CATEGORY used by all Jini services.

Value: jini

See Also:
Constants.DEVICE_CATEGORY, Constant Field Values

EXPORT

public static final java.lang.String EXPORT
The Export service property is a hint that marks an OSGi service to be picked up and exported by the Jini Driver in the Jini network. Imported services must not have this property set.

The property has no value. The name of the property is jini.export

See Also:
Constant Field Values

LUS_EXPORT_GROUPS

public static final java.lang.String LUS_EXPORT_GROUPS
Optional service property, which should contain a string array of the LUS groups that are of interest to the OSGi service. This overrides the property CM_LUS_EXPORT_GROUPS of the Jini Driver. If the value of this property is not defined, CM_LUS_EXPORT_GROUPS will be used. The name of the property is jini.lus.export.groups.

See Also:
Constant Field Values

SERVICE_ID

public static final java.lang.String SERVICE_ID
Optional service property, which should contain a string representation of the Jini service ID. It is used by the Jini Driver when exporting framework service. The driver automatically fills the values of this property when importing the Jini service. The name of the property is jini.service.id.

See Also:
Constant Field Values

ENTRIES

public static final java.lang.String ENTRIES
Optional service property, which should be an Entry array, holding the attributes set of the framework service that represents Jini proxy in the registration with a LUS. The name of the property is jini.entries.

See Also:
Entry, Constant Field Values

CM_LUS_IMPORT_GROUPS

public static final java.lang.String CM_LUS_IMPORT_GROUPS
Optional service property, which should be a string array, containing the groups of LUS, that the driver is interested in, when importing Jini services. The driver discovers only the LUS members of at least one of these groups. It discovers all if the property is null or the property is not defined, and does not perform discovery if the length of the array is zero. If LUS are discovered, which after changing the value of this property are not members of the groups, all registered services from them are unregistered. The name of the property is jini.lus.import.groups.

See Also:
Constant Field Values

CM_LUS_EXPORT_GROUPS

public static final java.lang.String CM_LUS_EXPORT_GROUPS
Optional service property, which should be a string array, containing the LUS groups that the driver is interested in, when exporting framework services to the Jini network. The driver discovers only the LUS, which are members of at least one of these groups. It discovers all if the property is null or the property is not defined, and does not perform discovery if the length of the array is 0. If Jini Lookup Services are discovered, which after changing the value of this property are not members of the groups, the registration of all Jini services from the framework, which are registered with them, is cancelled. The name of the property is jini.lus.export.groups.

See Also:
Constant Field Values
Method Detail

setServiceTemplates

public void setServiceTemplates(net.jini.core.lookup.ServiceTemplate[] template)
The Jini Driver is defined as a Service Factory. For every bundle a different set of Service Templates is maintained. This method sets a new set of ServiceTemplates (net.jini.core.lookup.ServiceTemplates) that are used for searching and registering services in the discovered LUS. A service registered in a LUS will be registered in framework if it matches at least one of the templates in one of the sets.

The ServiceTemplate(null, null, null) matches all services.

Parameters:
template - template to be added.

getServiceTemplates

public net.jini.core.lookup.ServiceTemplate[] getServiceTemplates()
Gets the current set of templates that is used for searching and registering services registered in discovered LUS. A service, registered in a LUS, will be registered in the framework if it matches at least one of the templates in this set

Returns:
an array containing templates or null if the set of templates is empty.

OSGi™ Service Platform
Release 3

Copyright © OSGi Alliance (2000, 2003). All Rights Reserved. Licensed under the OSGi Specification License, Version 1.0