Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between <osgi:reference> and <osgi:service> in spring DM

what is the difference between <osgi:reference> and <osgi:service> in the xml config file of spring DM.

like image 607
chao luo Avatar asked Jan 29 '12 08:01

chao luo


People also ask

What is OSGi reference?

<osgi:reference> can be used to get a reference to existing OSGi service so your bean can use it. <osgi:service> can be used to export a bean as an OSGi service so it can be used by others. Follow this answer to receive notifications.

What are OSGi services?

The OSGi Service Platform provides a mechanism for developing applications by using a component model and deploying those applications into an OSGi framework. The OSGi architecture is separated into a number of layers that provide benefits to creating and managing Java™ applications.

What is the importance of the OSGi Service Registry?

The OSGi service registry enables a bundle to publish objects to a shared registry, advertised via a given set of Java interfaces. Published services also have service properties associated with them in the registry.


1 Answers

<osgi:reference> can be used to get a reference to existing OSGi service so your bean can use it.

<osgi:service> can be used to export a bean as an OSGi service so it can be used by others.

like image 57
Matej Avatar answered Oct 16 '22 11:10

Matej