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 ofscope provider
. In addition tobase 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 Summary
Fields Modifier and Type Field Description private javax.inject.Provider<ExtendedUriInfo>
uriInfoProvider
private java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>>
uriToContexts
-
Fields inherited from interface org.glassfish.jersey.message.filtering.spi.ScopeProvider
DEFAULT_SCOPE
-
-
Constructor Summary
Constructors Constructor Description ServerScopeProvider(javax.ws.rs.core.Configuration config, InjectionManager injectionManager)
Create new server scope provider with injectedconfiguration
andjersey injection manager
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getFilteringScopes(java.lang.annotation.Annotation[] entityAnnotations, boolean defaultIfNotFound)
Get entity-filtering scopes to be used to process an entity.protected java.util.Set<java.lang.String>
getFilteringScopes(java.lang.reflect.Method resourceMethod, java.lang.Class<?> resourceClass)
Get entity-filtering scopes from examining annotations present on resource method and resource class.private static java.util.List<ResourceMethod>
getMatchedMethods(ExtendedUriInfo uriInfo)
-
Methods inherited from class org.glassfish.jersey.message.filtering.CommonScopeProvider
getFilteringScopes, mergeFilteringScopes, returnFilteringScopes
-
-
-
-
Field Detail
-
uriInfoProvider
@Inject private javax.inject.Provider<ExtendedUriInfo> uriInfoProvider
-
uriToContexts
private final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>> uriToContexts
-
-
Constructor Detail
-
ServerScopeProvider
@Inject public ServerScopeProvider(javax.ws.rs.core.Configuration config, InjectionManager injectionManager)
Create new server scope provider with injectedconfiguration
andjersey injection manager
.
-
-
Method Detail
-
getFilteringScopes
public java.util.Set<java.lang.String> getFilteringScopes(java.lang.annotation.Annotation[] entityAnnotations, boolean defaultIfNotFound)
Description copied from interface:ScopeProvider
Get entity-filtering scopes to be used to process an entity.- Specified by:
getFilteringScopes
in interfaceScopeProvider
- Overrides:
getFilteringScopes
in classCommonScopeProvider
- 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 java.util.Set<java.lang.String> getFilteringScopes(java.lang.reflect.Method resourceMethod, java.lang.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 java.util.List<ResourceMethod> getMatchedMethods(ExtendedUriInfo uriInfo)
-
-