Skip to main content
Jump to: navigation, search

Difference between revisions of "Extending the JaxRS Distribution Providers"

(Created page with "==Creating a Custom Distribution Provider By Configuring and/or Extending Jersey Provider== It's possible to reuse the existing ECF JaxRSProvider code to create your own new...")
 
(No difference)

Latest revision as of 00:02, 6 November 2019

Creating a Custom Distribution Provider By Configuring and/or Extending Jersey Provider

It's possible to reuse the existing ECF JaxRSProvider code to create your own new Remote Service Distribution provider, with custom security, serialization, filters, or interceptors. Here are the existing/default Jersey and CXF providers:

org.eclipse.ecf.provider.jersey.server

org.eclipse.ecf.provider.jersey.client

There is now an example of extending the Jersey distribution provider in this example project.

The general process is:

1) Create and register as an OSGi service (usually upon bundle start) an impl of IRemoteServiceDistributionProvider. The distribution provider provides a unique name/config type. For example,here is the distribution provider with new unique config name of 'ecf.jaxrs.jersey.server.ext'.

2) Override methods implemented in JaxRSServerContainer to configure your distribution provider at runtime. For example, the the ExtJerseyServerContainer overrides the JaxRSServerContainer.getServletAlias method, which is responsible for getting the servlet alias for the remote service...e.g. /rservices (value of pathPrefix property) in JaxRSServerContainer.getServletAlias. You may extend any JaxRSServerContainer or JerseyServerContainer methods to configure your remote service distribution provider in terms of filtering requests, serialization, invocation or any of the JaxRS-standard or Jersey-specific extensions. See the protected and public methods in JaxRSServerContainer for details.

Back to the top