Class ApplicationContextImpl

java.lang.Object
org.exoplatform.services.rest.impl.ApplicationContextImpl
All Implemented Interfaces:
javax.ws.rs.core.UriInfo, ApplicationContext, InitialProperties

public class ApplicationContextImpl extends Object implements ApplicationContext
Version:
$Id: $
Author:
Andrey Parfonov
  • Field Details

  • Constructor Details

  • Method Details

    • getCurrent

      public static ApplicationContext getCurrent()
      Returns:
      current ApplicationContext.
    • setCurrent

      public static void setCurrent(ApplicationContext context)
      Set ApplicationContext for current thread.
      Parameters:
      context - the ApplicationContext.
    • addMatchedResource

      public void addMatchedResource(Object resource)
      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:
      addMatchedResource in interface ApplicationContext
      Parameters:
      resource - the resource e. g. resource class, sub-resource method or sub-resource locator
    • addMatchedURI

      public void addMatchedURI(String uri)
      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:
      addMatchedURI in interface ApplicationContext
      Parameters:
      uri - the partial part of that matched to resource class, sub-resource method or sub-resource locator
    • getAbsolutePath

      public URI getAbsolutePath()
      Specified by:
      getAbsolutePath in interface javax.ws.rs.core.UriInfo
    • getAbsolutePathBuilder

      public javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
      Specified by:
      getAbsolutePathBuilder in interface javax.ws.rs.core.UriInfo
    • getAttributes

      public Map<String,Object> getAttributes()
      Specified by:
      getAttributes in interface ApplicationContext
      Returns:
      get mutable runtime attributes
    • getBaseUri

      public URI getBaseUri()
      Specified by:
      getBaseUri in interface javax.ws.rs.core.UriInfo
    • getBaseUriBuilder

      public javax.ws.rs.core.UriBuilder getBaseUriBuilder()
      Specified by:
      getBaseUriBuilder in interface javax.ws.rs.core.UriInfo
    • getContainerRequest

      public GenericContainerRequest getContainerRequest()
      Specified by:
      getContainerRequest in interface ApplicationContext
      Returns:
      JAX-RS request
      See Also:
    • getContainerResponse

      public GenericContainerResponse getContainerResponse()
      Specified by:
      getContainerResponse in interface ApplicationContext
      Returns:
      JAX-RS request
      See Also:
    • getDependencySupplier

      public DependencySupplier getDependencySupplier()
      Specified by:
      getDependencySupplier in interface ApplicationContext
      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

      public void setDependencySupplier(DependencySupplier dependencySupplier)
    • getHttpHeaders

      public javax.ws.rs.core.HttpHeaders getHttpHeaders()
      Specified by:
      getHttpHeaders in interface ApplicationContext
      Returns:
      request HTTP headers
      See Also:
      • HttpHeaders
    • getInitialProperties

      public InitialProperties getInitialProperties()
      Specified by:
      getInitialProperties in interface ApplicationContext
      Returns:
      properties
      See Also:
    • getMatchedResources

      public List<Object> getMatchedResources()
      Specified by:
      getMatchedResources in interface javax.ws.rs.core.UriInfo
    • getMatchedURIs

      public List<String> getMatchedURIs()
      Specified by:
      getMatchedURIs in interface javax.ws.rs.core.UriInfo
    • getMatchedURIs

      public List<String> getMatchedURIs(boolean decode)
      Specified by:
      getMatchedURIs in interface javax.ws.rs.core.UriInfo
    • getParameterValues

      public List<String> getParameterValues()
      Should be used to pass template values in context by using returned list in matching at UriPattern.match(String, List) . List will be cleared during matching.
      Specified by:
      getParameterValues in interface ApplicationContext
      Returns:
      the list for template values
    • getPath

      public String getPath()
      Specified by:
      getPath in interface javax.ws.rs.core.UriInfo
    • getPath

      public String getPath(boolean decode)
      Specified by:
      getPath in interface javax.ws.rs.core.UriInfo
    • getPathParameters

      public javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters()
      Specified by:
      getPathParameters in interface javax.ws.rs.core.UriInfo
    • getPathParameters

      public javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters(boolean decode)
      Specified by:
      getPathParameters in interface javax.ws.rs.core.UriInfo
    • getPathSegments

      public List<javax.ws.rs.core.PathSegment> getPathSegments()
      Specified by:
      getPathSegments in interface javax.ws.rs.core.UriInfo
    • getPathSegments

      public List<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode)
      Specified by:
      getPathSegments in interface javax.ws.rs.core.UriInfo
    • getProperties

      public Map<String,String> getProperties()
      Specified by:
      getProperties in interface InitialProperties
      Returns:
      all properties.
    • getProperty

      public String getProperty(String name)
      Get property.
      Specified by:
      getProperty in interface InitialProperties
      Parameters:
      name - property name
      Returns:
      value of property with specified name or null
    • getProviders

      public ProviderBinder getProviders()
      Specified by:
      getProviders in interface ApplicationContext
      Returns:
      set of providers
      See Also:
      • Providers
    • getQueryParameters

      public javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters()
      Specified by:
      getQueryParameters in interface javax.ws.rs.core.UriInfo
    • getQueryParameters

      public javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters(boolean decode)
      Specified by:
      getQueryParameters in interface javax.ws.rs.core.UriInfo
    • getRequest

      public javax.ws.rs.core.Request getRequest()
      Specified by:
      getRequest in interface ApplicationContext
      Returns:
      request
      See Also:
      • Request
    • getRequestUri

      public URI getRequestUri()
      Specified by:
      getRequestUri in interface javax.ws.rs.core.UriInfo
    • getRequestUriBuilder

      public javax.ws.rs.core.UriBuilder getRequestUriBuilder()
      Specified by:
      getRequestUriBuilder in interface javax.ws.rs.core.UriInfo
    • getSecurityContext

      public javax.ws.rs.core.SecurityContext getSecurityContext()
      Specified by:
      getSecurityContext in interface ApplicationContext
      Returns:
      security context
      See Also:
      • SecurityContext
    • getUriInfo

      public javax.ws.rs.core.UriInfo getUriInfo()
      Specified by:
      getUriInfo in interface ApplicationContext
      Returns:
      URI info
      See Also:
      • UriInfo
    • setParameterNames

      public void setParameterNames(List<String> parameterNames)
      Pass in context list of path template parameters .
      Specified by:
      setParameterNames in interface ApplicationContext
      Parameters:
      parameterNames - list of templates parameters
      See Also:
    • setProperty

      public void setProperty(String name, String value)
      Set property.
      Specified by:
      setProperty in interface InitialProperties
      Parameters:
      name - property name
      value - property value
    • setProviders

      public void setProviders(ProviderBinder providers)
      Parameters:
      providers - providers
      See Also:
      • Providers