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.Configurationprivate final booleanprivate final booleanprivate final booleanprivate static final Loggerprivate final MessageBodyWorkersprivate final Iterable<ModelProcessor> private final JerseyResourceContextprivate final RuntimeModelBuilderprivate 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 LocatorRoutingbuildRouting(Resource subResource) private LocatorRoutingcreateRouting(Class<?> locatorClass) private ResourceModelenhance(ResourceModel subResourceModel) (package private) RoutergetRouter(ResourceMethod resourceMethod) Obtain a sub-resource locator router for given resource method.(package private) LocatorRoutinggetRouting(Class<?> locatorClass) Build (or obtain from cache) a resource model and router for given sub-resource locator class.(package private) LocatorRoutinggetRouting(Resource subresource) Build (or obtain from cache) a resource model and router for given sub-resource injectionManagerresource.(package private) booleanCheck if the model builder contains a cached [locator, router] pair for a given sub-resource locator class.private voidvalidateResource(ResourceModelComponent component) private voidvalidateSubResource(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:
trueif the [locator, router] pair for the sub-resource locator class is present in the cache,falseotherwise.
-
createRouting
-
buildRouting
-
validateResource
-
enhance
-
validateSubResource
-