Class RuntimeLocatorModelBuilder
java.lang.Object
org.glassfish.jersey.server.internal.routing.RuntimeLocatorModelBuilder
Base for sub-resource locator runtime model builder.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.cache.LoadingCache
<RuntimeLocatorModelBuilder.LocatorCacheKey, LocatorRouting> private final javax.ws.rs.core.Configuration
private final boolean
private final boolean
private final boolean
private static final Logger
private final MessageBodyWorkers
private final Iterable
<ModelProcessor> private final JerseyResourceContext
private final RuntimeModelBuilder
private final Collection
<ValueParamProvider> -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeLocatorModelBuilder
(javax.ws.rs.core.Configuration config, MessageBodyWorkers messageBodyWorkers, Collection<ValueParamProvider> valueSuppliers, JerseyResourceContext resourceContext, RuntimeModelBuilder runtimeModelBuilder, Iterable<ModelProcessor> modelProcessors, Function<Class<?>, ?> createServiceFunction) Create a new instance of the runtime model builder for sub-resource locators. -
Method Summary
Modifier and TypeMethodDescriptionprivate LocatorRouting
buildRouting
(Resource subResource) private LocatorRouting
createRouting
(Class<?> locatorClass) private ResourceModel
enhance
(ResourceModel subResourceModel) (package private) Router
getRouter
(ResourceMethod resourceMethod) Obtain a sub-resource locator router for given resource method.(package private) LocatorRouting
getRouting
(Class<?> locatorClass) Build (or obtain from cache) a resource model and router for given sub-resource locator class.(package private) LocatorRouting
getRouting
(Resource subresource) Build (or obtain from cache) a resource model and router for given sub-resource injectionManagerresource
.(package private) boolean
Check if the model builder contains a cached [locator, router] pair for a given sub-resource locator class.private void
validateResource
(ResourceModelComponent component) private void
validateSubResource
(ResourceModel subResourceModel)
-
Field Details
-
LOGGER
-
config
private final javax.ws.rs.core.Configuration config -
runtimeModelBuilder
-
messageBodyWorkers
-
valueSuppliers
-
resourceContext
-
modelProcessors
-
createServiceFunction
-
cache
private final com.google.common.cache.LoadingCache<RuntimeLocatorModelBuilder.LocatorCacheKey,LocatorRouting> cache -
disableValidation
private final boolean disableValidation -
ignoreValidationErrors
private final boolean ignoreValidationErrors -
enableJerseyResourceCaching
private final boolean enableJerseyResourceCaching
-
-
Constructor Details
-
RuntimeLocatorModelBuilder
RuntimeLocatorModelBuilder(javax.ws.rs.core.Configuration config, MessageBodyWorkers messageBodyWorkers, Collection<ValueParamProvider> valueSuppliers, JerseyResourceContext resourceContext, RuntimeModelBuilder runtimeModelBuilder, Iterable<ModelProcessor> modelProcessors, Function<Class<?>, ?> createServiceFunction) Create a new instance of the runtime model builder for sub-resource locators.- Parameters:
config
- configuration of the application.messageBodyWorkers
- message body workers registred in an application.valueSuppliers
- all value registered value providers.resourceContext
- resource context to bind sub-resource locator singleton instances.runtimeModelBuilder
- runtime model builder to build routers for locator models.modelProcessors
- all registered model processors.createServiceFunction
- function that is able to create and initialize new service.
-
-
Method Details
-
getRouter
Obtain a sub-resource locator router for given resource method.- Parameters:
resourceMethod
- resource method to obtain the router for.- Returns:
- sub-resource locator router.
-
getRouting
Build (or obtain from cache) a resource model and router for given sub-resource locator class.- Parameters:
locatorClass
- sub-resource locator class to built model and router for.- Returns:
- [locator, router] pair with built model and router for sub-resource locator.
-
getRouting
Build (or obtain from cache) a resource model and router for given sub-resource injectionManagerresource
.- Parameters:
subresource
- sub-resource injectionManager resource to built model and router for.- Returns:
- [injectionManager, router] pair with built model and router for sub-resource injectionManager.
-
isCached
Check if the model builder contains a cached [locator, router] pair for a given sub-resource locator class.- Parameters:
srlClass
- sub-resource locator class.- Returns:
true
if the [locator, router] pair for the sub-resource locator class is present in the cache,false
otherwise.
-
createRouting
-
buildRouting
-
validateResource
-
enhance
-
validateSubResource
-