[jax-rs-spec users] Registering the same provider class with Configurable

From: Sergey Beryozkin <>
Date: Mon, 27 Apr 2015 11:10:07 +0100

Hi All,

The documentation at [1] says/shows the examples:


// register GzipInterceptor as a ReaderInterceptor
// as well as a WriterInterceptor

followed by

// override the priority of registered GzipInterceptor
// and both of it's provider contracts
config.register(GzipInterceptor.class, 6500);

Meaning that the previous GzipInterceptor registrations for its
contracts with some priority is replaced, with 6500 being a new priority.


And then "As a general rule, for each JAX-RS component class there can
be at most one registration..." with this example:

config.register(GzipInterceptor.class, WriterInterceptor.class);
config.register(GzipInterceptor.class, 6500); // Rejected by runtime.

So in (1) the second registration of GzipInterceptor is accepted, but in
(2) - no.

This is a bit confusing. What am I missing, can you please clarify ?

Thanks, Sergey