KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > service > jini > JiniDriver


1 /*
2  * Copyright (c) 2002 by ProSyst Software AG.,
3  * url: http://www.prosyst.com
4  * All rights reserved.
5  *
6  * This source code is owned by ProSyst Software AG.
7  *
8  * These materials have been contributed to the Open Services Gateway
9  * Initiative (OSGi) as “MEMBER LICENSED MATERIALS” as defined in,
10  * and subject to the terms of, the OSGi Member Agreement by and
11  * between OSGi and ProSyst Software AG, specifically including but
12  * not limited to, the license rights and warranty disclaimers as set
13  * forth in Sections 3.2 and 12.1 thereof, and the applicable Statement
14  * of Work.
15  *
16  * All company, brand and product names contained within this document
17  * may be trademarks that are the sole property of the respective owners.
18  *
19  * The above notice must be included on all copies of this document
20  * that are made.
21  *
22  * $Header: /cvshome/repository/org/osgi/service/jini/JiniDriver.java,v 1.13 2003/03/07 08:30:43 pkriens Exp $
23  * $Revision: 1.13 $
24  */

25
26
27 package org.osgi.service.jini;
28
29 /**
30  * A basic interface for a Jini Driver.<p>
31  * This Driver acts as a bridge between a Jini network (community)
32  * and an OSGi framework. Using this driver, OSGi services
33  * can be exported to the Jini network, and Jini services from the
34  * Jini network can be imported into the OSGi framework.
35  * This results in two possible transformations: Jini-to-OSGi and
36  * OSGi-to-Jini. The Jini Driver is responsible for these transformations.<p>
37  * An OSGi service is a Jini service if it is registered
38  * in the framework with the specified properties.<p>
39  * <p>In OSGi-to-Jini transformation, the driver registers OSGi services as
40  * Jini services in the discovered LUS.<p>In Jini-to-OSGi transformation
41  * it registers with the framework all discovered LUS and services in the LUS
42  * matching the given template.<p>
43  * The Jini Driver can be configured, through a set of properties, to
44  * export/import Jini Services.<p>
45  * The properties <tt>DEVICE_CATEGORY</tt>, <tt>EXPORT</tt>,
46  * <tt>LUS_EXPORT_GROUPS</tt>, <tt>SERVICE_ID</tt>,
47  * and <tt>ENTRIES</tt> are service
48  * register properties for particular Jini Service (imported or exported).<p>
49  *
50  * The properties <tt>CM_LUS_IMPORT_GROUPS</tt> and <tt>CM_LUS_EXPORT_GROUPS</tt> are for
51  * configuration of the Jini Driver. These properties are kept in
52  * the Configuration Management Service defined by OSGi.
53  */

54
55 public interface JiniDriver {
56
57   /**
58    * Constant for the value of the service property
59    * <tt>DEVICE_CATEGORY</tt> used by all Jini
60    * services.
61    *<p><b>Value:</b>
62    * <tt>jini</tt></p>
63    * @see org.osgi.service.device.Constants#DEVICE_CATEGORY
64    **/

65   public static final String JavaDoc DEVICE_CATEGORY = "jini";
66
67     /**
68      * The <tt>Export</tt> service property is a hint that marks an OSGi service
69      * to be picked up and exported by the Jini Driver in the Jini network.
70      * Imported services must not have this property set.
71      * <p>
72      * The property has no value. The name of the property is <tt>jini.export</tt></p>
73      **/

74   public static final String JavaDoc EXPORT = "jini.export";
75
76   /**
77    * Optional service property, which should contain a string array of
78    * the LUS groups that are of interest to the OSGi service.
79    * This overrides the property <tt>CM_LUS_EXPORT_GROUPS</tt> of the Jini Driver.
80    * If the value of this property is not defined, <tt>CM_LUS_EXPORT_GROUPS</tt>
81    * will be used. The name of the property is <tt>jini.lus.export.groups</tt>.
82    */

83
84   public static final String JavaDoc LUS_EXPORT_GROUPS = "jini.lus.export.groups";
85
86   /**
87    * Optional service property, which should contain a string representation of the Jini service ID. It is used
88    * by the Jini Driver when exporting framework service. The driver
89    * automatically fills the values of this property
90    * when importing the Jini service. The name of the property is <tt>jini.service.id</tt>.
91    */

92
93   public static final String JavaDoc SERVICE_ID = "jini.service.id";
94
95
96   /**
97    * Optional service property, which should be an {@link net.jini.core.entry.Entry} array, holding
98    * the attributes set of the framework service that represents Jini
99    * proxy in the registration with a LUS.
100    * The name of the property is <tt>jini.entries</tt>.
101    * @see net.jini.core.entry.Entry
102    */

103
104   public static final String JavaDoc ENTRIES = "jini.entries";
105
106   /**
107    * Optional service property, which should be a string array, containing
108    * the groups of LUS, that the driver is interested in, when importing
109    * Jini services. The driver discovers only the LUS members of
110    * at least one of these groups. It discovers all if the property is
111    * null or the property is not defined, and does not perform discovery if
112    * the length of the array is zero.
113    * If LUS are discovered, which after changing the value of this
114    * property are not members of the groups, all registered services from
115    * them are unregistered. The name of the property is <tt>jini.lus.import.groups</tt>.
116    */

117
118   public static final String JavaDoc CM_LUS_IMPORT_GROUPS = "jini.lus.import.groups";
119
120   /**
121    * Optional service property, which should be a string array, containing
122    * the LUS groups that the driver is interested in, when exporting
123    * framework services to the Jini network. The driver discovers only
124    * the LUS, which are members of at least one of these groups. It discovers
125    * all if the property is null or the property is not defined, and does not
126    * perform discovery if the length of the array is 0. If Jini Lookup Services are
127    * discovered, which after changing the value of this
128    * property are not members of the groups, the registration of all
129    * Jini services from the framework, which are registered with them, is
130    * cancelled. The name of the property is <tt>jini.lus.export.groups</tt>.
131    */

132
133   public static final String JavaDoc CM_LUS_EXPORT_GROUPS = "jini.lus.export.groups";
134
135 /**
136    * The Jini Driver is defined as a Service Factory. For every bundle a different set of Service Templates is maintained.
137    * This method sets a new set of ServiceTemplates (<tt>net.jini.core.lookup.ServiceTemplate</tt>s) that
138    * are used for searching and registering services in the discovered LUS.
139    * A service registered in a LUS will be registered in framework if it matches at least
140    * one of the templates in one of the sets.<p>
141    * The <tt>ServiceTemplate(null, null, null)</tt> matches all services.
142    *
143    * @param template template to be added.
144    **/

145   public void setServiceTemplates(net.jini.core.lookup.ServiceTemplate [] template);
146
147   /**
148    * Gets the current set of templates that is used for searching and registering
149    * services registered in discovered LUS. A service, registered in a LUS, will be
150    * registered in the framework if it matches at least one of the templates in this set
151    *
152    * @return an array containing templates or null if the set of templates is empty.
153    **/

154   public net.jini.core.lookup.ServiceTemplate[] getServiceTemplates();
155
156 }
Popular Tags