Open main menu

CDOT Wiki β

Changes

Steps for Building Declarative Services

10 bytes added, 21:19, 8 February 2011
minor
</source>
The "'''reference'''" element in the service descriptor specifies that:
* The component has a binding to a service, and the name of the binding is set to "SAYABLE"
* The needed service is one which implements the "cs.ecl.osgi.simple.declarativeservice.say.Sayable" interface
* To bind this component with a provider of the service, the framework must invoke the "bindSayable" method
* Similarly, to unbind the component from a provider, the framework must invoke the "unbindSayable" method
* The '''cardinality ''' parameter has the form "'''x..y'''", where x can be either '0' or '1' and y can be either '1' or 'n'. The first parameter specifies '''optionality''', and the second one specifies '''multiplicity'''.
** For instance, x='0' means that a binding to the service is optional, while x='1' means that the binding is mandatory (otherwise the component can not be resolved and activated).
** On the other hand, y='1' implies single binding only, where the component can only be bound to just one service provider at a time, while y='n' implies that multiple service providers can be bound to the component simultaneously.