Interface ContextAwareEndpoint

All Superinterfaces:
jakarta.ws.rs.core.Feature

public interface ContextAwareEndpoint extends jakarta.ws.rs.core.Feature
Implement this interface in classes that should receive Context injections and are registered as instance. This interface is a convenience that restores the behavior of Dropwizard 1.3.x.
   public class ExampleApp extends Application<Configuration> {
     @Override
     public void run(Configuration configuration, Environment environment) {
       // if you register the endpoint as instance...
       environment.jersey().register(new ExampleEndpoint());
     }

     @Path("")
     public static class ExampleEndpoint implements ContextAwareEndpoint {
       // ...the context injection will only work if
       // ContextAwareEndpoint is implemented
       @Context UriInfo uriInfo;

       // ...
     }
   }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    configure(jakarta.ws.rs.core.FeatureContext context)
     
  • Method Details

    • configure

      default boolean configure(jakarta.ws.rs.core.FeatureContext context)
      Specified by:
      configure in interface jakarta.ws.rs.core.Feature