How can I filter the visibility of the OSGi service?

OSGi uses a service-oriented architecture: Bundles register maintenance objects that consume other packages. Publishing and linking management is structured. This completely disconnects service providers from service users (except for the need to agree on a service interface).

Is there a way to limit (by configuration) which services are visible for which packages?

For example, if I have an HttpService, all packages that want to do this can install servlets in it. I would like to make the HttpService invisible to custom packages.

Additional loans: in addition to filtering the registration of services, you can change the registration properties. Thus, even if the package registers the servlet with alias=/admin, I can change it to alias=/somethingelsefor use on the Pax Web Extender board.

+3
source share
6 answers

Is there a way to limit (by configuration) which services are visible for which packages?

As you know, you can filter the properties of a service, although this probably does not provide the type of control you are asking for: services are still visible to other packages deployed within the framework.

SpringSource dm Server ( , , OSGi- Java) . ( ), , ( - ).

/ OSGi, . ( , .)

: OSGi " " , " ".

, , .

dm ( Spring DM) SpringSource.org dmServer page.


SpringSource; dm

+2

R4.2 OSGi Find Hook, : " , , "


http://www.osgi.org/download/r4-v4.2-core-draft-20090310.pdf 12.5

, R4.2 , , OSGi (Felix Equinox)

+2

( ), ?

, . , , , .

: , > . , > alias =/admin, alias =/somethingelse Pax Web > Extender Whiteboard.

... . Servlet "MyServlet" . MyServlets Servlets .

... .

+1

, , ...

OSGi R4 " ", 5- .

, ,

+1

: , . , =/admin, alias =/somethingelse Pax Web Extender.

iPOJO . , , OSGi.

0

, OSGi. , , . , , ( ).

, , 4.2, " ".

The second question that changes properties, such as the endpoint under which the service is registered, is what you can do through ServiceRegistration, which you will return when you register your service. Changes can be initiated by going to the ManagedService and using ConfigurationAdmin to configure.

0
source

Source: https://habr.com/ru/post/1708384/


All Articles