Class DiscoveryResource<T>


public abstract class DiscoveryResource<T> extends Object

The JAX-RS web service. Due to how most JAX-RS implementations are written, you must create a concrete class that extends this using your payload type. The concrete class should have the base path that you'd like to use.

Because the JAX-RS implementation can create a new instance of the resource for every request, your concrete class must use a context resolver to access the DiscoveryContext. Or, if you are using an IoC framework, you can access it that way.

Here's a version that has no payload (i.e. a Void payload):

 public class MyResource extends DiscoveryResource<Void> {
     public MyResource(@Context ContextResolver<DiscoveryContext<Void>> resolver) {
         // note: this may not work with all JAX-RS implementations
  • Constructor Details

  • Method Details

    • putService

      public putService(ServiceInstance<T> instance, String name, String id)
    • removeService

      public removeService(String name, String id)
    • getDeprecated

      @Deprecated public getDeprecated(String name, String id)
    • get

      public get(String name, String id)
    • getAllNames

      public getAllNames()
    • getAll

      public getAll(String name)
    • getAny

      public getAny(String name)