@Singleton @Priority(value=4200) @ConstrainedTo(value=SERVER) class ServerScopeProvider extends CommonScopeProvider
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.Modifier and Type | Field and Description |
---|---|
private javax.inject.Provider<ExtendedUriInfo> |
uriInfoProvider |
private java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>> |
uriToContexts |
DEFAULT_SCOPE
Constructor and Description |
---|
ServerScopeProvider(javax.ws.rs.core.Configuration config,
org.glassfish.hk2.api.ServiceLocator serviceLocator)
Create new server scope provider with injected
configuration and
HK2 service locator . |
Modifier and Type | Method and 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) |
getFilteringScopes, mergeFilteringScopes, returnFilteringScopes
@Inject private javax.inject.Provider<ExtendedUriInfo> uriInfoProvider
private final java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Set<java.lang.String>> uriToContexts
@Inject public ServerScopeProvider(javax.ws.rs.core.Configuration config, org.glassfish.hk2.api.ServiceLocator serviceLocator)
configuration
and
HK2 service locator
.public java.util.Set<java.lang.String> getFilteringScopes(java.lang.annotation.Annotation[] entityAnnotations, boolean defaultIfNotFound)
ScopeProvider
getFilteringScopes
in interface ScopeProvider
getFilteringScopes
in class CommonScopeProvider
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.protected java.util.Set<java.lang.String> getFilteringScopes(java.lang.reflect.Method resourceMethod, java.lang.Class<?> resourceClass)
resourceMethod
- matched resource method to be examined.resourceClass
- matched resource class to be examined.private static java.util.List<ResourceMethod> getMatchedMethods(ExtendedUriInfo uriInfo)