Class ServerScopeProvider

java.lang.Object
org.glassfish.jersey.message.filtering.CommonScopeProvider
org.glassfish.jersey.message.filtering.ServerScopeProvider
All Implemented Interfaces:
ScopeProvider
Direct Known Subclasses:
SecurityServerScopeProvider

@Singleton @Priority(4200) @ConstrainedTo(SERVER) class ServerScopeProvider extends CommonScopeProvider
Server-side implementation of scope provider. In addition to base implementation this class provides entity-filtering scopes by examining matched resource method and sub-resource locators. This examination comes into play only in case if entity-filtering scopes cannot be found in entity annotations or application configuration.
  • Field Details

  • Constructor Details

    • ServerScopeProvider

      @Inject public ServerScopeProvider(javax.ws.rs.core.Configuration config, InjectionManager injectionManager)
      Create new server scope provider with injected configuration and jersey injection manager.
  • Method Details

    • getFilteringScopes

      public Set<String> getFilteringScopes(Annotation[] entityAnnotations, boolean defaultIfNotFound)
      Description copied from interface: ScopeProvider
      Get entity-filtering scopes to be used to process an entity.
      Specified by:
      getFilteringScopes in interface ScopeProvider
      Overrides:
      getFilteringScopes in class CommonScopeProvider
      Parameters:
      entityAnnotations - entity annotations provided with entity when creating request/response.
      defaultIfNotFound - flag determining whether the default entity-filtering scope should be returned if no other scope can be obtained.
      Returns:
      non-null entity-filtering scopes.
    • getFilteringScopes

      protected Set<String> getFilteringScopes(Method resourceMethod, Class<?> resourceClass)
      Get entity-filtering scopes from examining annotations present on resource method and resource class.
      Parameters:
      resourceMethod - matched resource method to be examined.
      resourceClass - matched resource class to be examined.
      Returns:
      entity-filtering scopes or an empty set if the scopes cannot be obtained.
    • getMatchedMethods

      private static List<ResourceMethod> getMatchedMethods(ExtendedUriInfo uriInfo)