Class ApplicationContextImpl
java.lang.Object
org.exoplatform.services.rest.impl.ApplicationContextImpl
- All Implemented Interfaces:
javax.ws.rs.core.UriInfo,ApplicationContext,InitialProperties
- Version:
- $Id: $
- Author:
- Andrey Parfonov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ProviderBinderProviders.protected GenericContainerRequestprotected GenericContainerResponseSeeContainerResponse. -
Constructor Summary
ConstructorsConstructorDescriptionApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers) ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers, DependencySupplier dependencySupplier) Constructs new instance of ApplicationContext. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatchedResource(Object resource) Add ancestor resource, according to JSR-311:voidaddMatchedURI(String uri) Add ancestor resource, according to JSR-311:javax.ws.rs.core.UriBuilderjavax.ws.rs.core.UriBuilderstatic ApplicationContextjavax.ws.rs.core.HttpHeadersgetMatchedURIs(boolean decode) Should be used to pass template values in context by using returned list in matching atUriPattern.match(String, List).getPath()getPath(boolean decode) getPathParameters(boolean decode) List<javax.ws.rs.core.PathSegment> List<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode) getProperty(String name) Get property.getQueryParameters(boolean decode) javax.ws.rs.core.Requestjavax.ws.rs.core.UriBuilderjavax.ws.rs.core.SecurityContextjavax.ws.rs.core.UriInfostatic voidsetCurrent(ApplicationContext context) Set ApplicationContext for current thread.voidsetDependencySupplier(DependencySupplier dependencySupplier) voidsetParameterNames(List<String> parameterNames) Pass in context list of path template parameters .voidsetProperty(String name, String value) Set property.voidsetProviders(ProviderBinder providers)
-
Field Details
-
providers
Providers. -
request
-
response
SeeContainerResponse.
-
-
Constructor Details
-
ApplicationContextImpl
public ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers, DependencySupplier dependencySupplier) Constructs new instance of ApplicationContext.- Parameters:
request- See GenricContainerRequestresponse- SeeGenericContainerResponseproviders-dependencySupplier-
-
ApplicationContextImpl
public ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers)
-
-
Method Details
-
getCurrent
- Returns:
- current ApplicationContext.
-
setCurrent
Set ApplicationContext for current thread.- Parameters:
context- the ApplicationContext.
-
addMatchedResource
Add ancestor resource, according to JSR-311:Entries are ordered according in reverse request URI matching order, with the root resource last.
So add each new resource at the begin of list.- Specified by:
addMatchedResourcein interfaceApplicationContext- Parameters:
resource- the resource e. g. resource class, sub-resource method or sub-resource locator
-
addMatchedURI
Add ancestor resource, according to JSR-311:Entries are ordered in reverse request URI matching order, with the root resource URI last.
So add each new URI at the begin of list.- Specified by:
addMatchedURIin interfaceApplicationContext- Parameters:
uri- the partial part of that matched to resource class, sub-resource method or sub-resource locator
-
getAbsolutePath
- Specified by:
getAbsolutePathin interfacejavax.ws.rs.core.UriInfo
-
getAbsolutePathBuilder
public javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()- Specified by:
getAbsolutePathBuilderin interfacejavax.ws.rs.core.UriInfo
-
getAttributes
- Specified by:
getAttributesin interfaceApplicationContext- Returns:
- get mutable runtime attributes
-
getBaseUri
- Specified by:
getBaseUriin interfacejavax.ws.rs.core.UriInfo
-
getBaseUriBuilder
public javax.ws.rs.core.UriBuilder getBaseUriBuilder()- Specified by:
getBaseUriBuilderin interfacejavax.ws.rs.core.UriInfo
-
getContainerRequest
- Specified by:
getContainerRequestin interfaceApplicationContext- Returns:
- JAX-RS request
- See Also:
-
getContainerResponse
- Specified by:
getContainerResponsein interfaceApplicationContext- Returns:
- JAX-RS request
- See Also:
-
getDependencySupplier
- Specified by:
getDependencySupplierin interfaceApplicationContext- Returns:
- instance of actual dependency resolver. It will be used for injection fields annotated with 'inject' annotation and constructor parameters not annotated with JAX-RS annotations
-
setDependencySupplier
-
getHttpHeaders
public javax.ws.rs.core.HttpHeaders getHttpHeaders()- Specified by:
getHttpHeadersin interfaceApplicationContext- Returns:
- request HTTP headers
- See Also:
-
getInitialProperties
- Specified by:
getInitialPropertiesin interfaceApplicationContext- Returns:
- properties
- See Also:
-
getMatchedResources
- Specified by:
getMatchedResourcesin interfacejavax.ws.rs.core.UriInfo
-
getMatchedURIs
- Specified by:
getMatchedURIsin interfacejavax.ws.rs.core.UriInfo
-
getMatchedURIs
- Specified by:
getMatchedURIsin interfacejavax.ws.rs.core.UriInfo
-
getParameterValues
Should be used to pass template values in context by using returned list in matching atUriPattern.match(String, List). List will be cleared during matching.- Specified by:
getParameterValuesin interfaceApplicationContext- Returns:
- the list for template values
-
getPath
- Specified by:
getPathin interfacejavax.ws.rs.core.UriInfo
-
getPath
- Specified by:
getPathin interfacejavax.ws.rs.core.UriInfo
-
getPathParameters
- Specified by:
getPathParametersin interfacejavax.ws.rs.core.UriInfo
-
getPathParameters
- Specified by:
getPathParametersin interfacejavax.ws.rs.core.UriInfo
-
getPathSegments
- Specified by:
getPathSegmentsin interfacejavax.ws.rs.core.UriInfo
-
getPathSegments
- Specified by:
getPathSegmentsin interfacejavax.ws.rs.core.UriInfo
-
getProperties
- Specified by:
getPropertiesin interfaceInitialProperties- Returns:
- all properties.
-
getProperty
Get property.- Specified by:
getPropertyin interfaceInitialProperties- Parameters:
name- property name- Returns:
- value of property with specified name or null
-
getProviders
- Specified by:
getProvidersin interfaceApplicationContext- Returns:
- set of providers
- See Also:
-
getQueryParameters
- Specified by:
getQueryParametersin interfacejavax.ws.rs.core.UriInfo
-
getQueryParameters
- Specified by:
getQueryParametersin interfacejavax.ws.rs.core.UriInfo
-
getRequest
public javax.ws.rs.core.Request getRequest()- Specified by:
getRequestin interfaceApplicationContext- Returns:
- request
- See Also:
-
getRequestUri
- Specified by:
getRequestUriin interfacejavax.ws.rs.core.UriInfo
-
getRequestUriBuilder
public javax.ws.rs.core.UriBuilder getRequestUriBuilder()- Specified by:
getRequestUriBuilderin interfacejavax.ws.rs.core.UriInfo
-
getSecurityContext
public javax.ws.rs.core.SecurityContext getSecurityContext()- Specified by:
getSecurityContextin interfaceApplicationContext- Returns:
- security context
- See Also:
-
getUriInfo
public javax.ws.rs.core.UriInfo getUriInfo()- Specified by:
getUriInfoin interfaceApplicationContext- Returns:
- URI info
- See Also:
-
setParameterNames
Pass in context list of path template parameters .- Specified by:
setParameterNamesin interfaceApplicationContext- Parameters:
parameterNames- list of templates parameters- See Also:
-
setProperty
Set property.- Specified by:
setPropertyin interfaceInitialProperties- Parameters:
name- property namevalue- property value
-
setProviders
- Parameters:
providers- providers- See Also:
-