hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
190 stars 98 forks source link

Make default resource filter configurable using metatype #86

Closed evra closed 9 years ago

evra commented 9 years ago

Default implementation of the ResourceFilter interface (AllResourceFilter) has a hardcoded service filter (&(objectClass=*)(!(com.eclipsesource.jaxrs.publish=false)))

It would be really helpful to have this filter as a configurable property. For example it will help to register services from a certain java package, don't register admin services which have a certain property enabled, etc

Currently all OSGi services are being tracked by the resource service tracker which creates a lot of dependencies in runtime (you can see it for example in felix web-console). Having the filter expression configurable will filter out services on framework level. This will also cover many of the uses cases where custom implementation of the ResourceFilter is necessary.

BryanHunt commented 9 years ago

I would propose introducing a WebService interface with no methods and changing the objectClass. This would also better enable extensions such as providing a swagger model for the API.

hstaudacher commented 9 years ago

The requested feature is already possible. Just implement your own ResourceFilter and register it as a service before the connector starts.

Will close this issue now.

hstaudacher commented 9 years ago

Added a wiki entry https://github.com/hstaudacher/osgi-jax-rs-connector/wiki/FAQ#how-can-i-change-the-servicetracker-filter