public class ApplicationContextImpl extends Object implements ApplicationContext, Lifecycle
| Modifier and Type | Field and Description |
|---|---|
protected DependencySupplier |
depInjector |
protected ProviderBinder |
providers
Providers.
|
protected GenericContainerRequest |
request
|
protected GenericContainerResponse |
response
See
ContainerResponse. |
| Constructor and Description |
|---|
ApplicationContextImpl(GenericContainerRequest request,
GenericContainerResponse response,
ProviderBinder providers)
Constructs new instance of ApplicationContext.
|
ApplicationContextImpl(GenericContainerRequest request,
GenericContainerResponse response,
ProviderBinder providers,
MethodInvokerDecoratorFactory methodInvokerDecoratorFactory)
Constructs new instance of ApplicationContext.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
URI |
getAbsolutePath() |
javax.ws.rs.core.UriBuilder |
getAbsolutePathBuilder() |
javax.ws.rs.core.Application |
getApplication() |
Map<String,Object> |
getAttributes() |
URI |
getBaseUri() |
javax.ws.rs.core.UriBuilder |
getBaseUriBuilder() |
GenericContainerRequest |
getContainerRequest() |
GenericContainerResponse |
getContainerResponse() |
static ApplicationContext |
getCurrent() |
DependencySupplier |
getDependencySupplier() |
EverrestConfiguration |
getEverrestConfiguration() |
javax.ws.rs.core.HttpHeaders |
getHttpHeaders() |
InitialProperties |
getInitialProperties() |
List<Object> |
getMatchedResources() |
List<String> |
getMatchedURIs() |
List<String> |
getMatchedURIs(boolean decode) |
MethodInvoker |
getMethodInvoker(GenericMethodResource methodDescriptor) |
List<String> |
getParameterValues()
Should be used to pass template values in context by using returned list in matching to @see
UriPattern.match(String, List). |
String |
getPath() |
String |
getPath(boolean decode) |
javax.ws.rs.core.MultivaluedMap<String,String> |
getPathParameters() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getPathParameters(boolean decode) |
List<javax.ws.rs.core.PathSegment> |
getPathSegments() |
List<javax.ws.rs.core.PathSegment> |
getPathSegments(boolean decode) |
Map<String,String> |
getProperties() |
String |
getProperty(String name)
Get property.
|
ProviderBinder |
getProviders() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters() |
javax.ws.rs.core.MultivaluedMap<String,String> |
getQueryParameters(boolean decode) |
javax.ws.rs.core.Request |
getRequest() |
URI |
getRequestUri() |
javax.ws.rs.core.UriBuilder |
getRequestUriBuilder() |
javax.ws.rs.core.SecurityContext |
getSecurityContext() |
javax.ws.rs.core.UriInfo |
getUriInfo() |
boolean |
isAsynchronous() |
URI |
relativize(URI uri) |
URI |
resolve(URI uri) |
void |
setApplication(javax.ws.rs.core.Application application) |
static void |
setCurrent(ApplicationContext context)
Set ApplicationContext for current thread.
|
void |
setDependencySupplier(DependencySupplier depInjector) |
void |
setEverrestConfiguration(EverrestConfiguration config) |
void |
setParameterNames(List<String> parameterNames)
Pass in context list of path template parameters @see
UriPattern. |
void |
setProperty(String name,
String value)
Set property.
|
void |
setProviders(ProviderBinder providers) |
void |
start()
Star Lifecycle.
|
void |
stop()
Stop Lifecycle.
|
protected GenericContainerRequest request
protected GenericContainerResponse response
ContainerResponse.protected ProviderBinder providers
protected DependencySupplier depInjector
public ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers)
request - See GenericContainerRequestresponse - See GenericContainerResponseproviders - See ProviderBinderpublic ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response, ProviderBinder providers, MethodInvokerDecoratorFactory methodInvokerDecoratorFactory)
request - See GenericContainerRequestresponse - See GenericContainerResponseproviders - See ProviderBindermethodInvokerDecoratorFactory - See MethodInvokerDecoratorFactorypublic static ApplicationContext getCurrent()
public static void setCurrent(ApplicationContext context)
context - the ApplicationContext.public void addMatchedResource(Object resource)
ApplicationContextEntries are ordered according in reverse request URI matching order, with the root resource last.
So add each new resource at the begin of list.addMatchedResource in interface ApplicationContextresource - the resource e. g. resource class, sub-resource method or sub-resource locator.public void addMatchedURI(String uri)
ApplicationContextEntries are ordered in reverse request URI matching order, with the root resource URI last.
So add each new URI at the begin of list.addMatchedURI in interface ApplicationContexturi - the partial part of that matched to resource class, sub-resource method or sub-resource locator.public URI getAbsolutePath()
getAbsolutePath in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
getAbsolutePathBuilder in interface javax.ws.rs.core.UriInfopublic Map<String,Object> getAttributes()
getAttributes in interface ApplicationContextpublic URI getBaseUri()
getBaseUri in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getBaseUriBuilder()
getBaseUriBuilder in interface javax.ws.rs.core.UriInfopublic GenericContainerRequest getContainerRequest()
getContainerRequest in interface ApplicationContextGenericContainerRequestpublic GenericContainerResponse getContainerResponse()
getContainerResponse in interface ApplicationContextGenericContainerResponsepublic DependencySupplier getDependencySupplier()
getDependencySupplier in interface ApplicationContextDependencySupplierpublic javax.ws.rs.core.HttpHeaders getHttpHeaders()
getHttpHeaders in interface ApplicationContextHttpHeaderspublic InitialProperties getInitialProperties()
getInitialProperties in interface ApplicationContextInitialPropertiespublic List<Object> getMatchedResources()
getMatchedResources in interface javax.ws.rs.core.UriInfopublic URI relativize(URI uri)
relativize in interface javax.ws.rs.core.UriInfopublic List<String> getMatchedURIs()
getMatchedURIs in interface javax.ws.rs.core.UriInfopublic List<String> getMatchedURIs(boolean decode)
getMatchedURIs in interface javax.ws.rs.core.UriInfopublic MethodInvoker getMethodInvoker(GenericMethodResource methodDescriptor)
getMethodInvoker in interface ApplicationContextmethodDescriptor - method descriptorpublic List<String> getParameterValues()
ApplicationContextUriPattern.match(String, List). List will be cleared during matching.getParameterValues in interface ApplicationContextpublic String getPath()
getPath in interface javax.ws.rs.core.UriInfopublic String getPath(boolean decode)
getPath in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters()
getPathParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getPathParameters(boolean decode)
getPathParameters in interface javax.ws.rs.core.UriInfopublic List<javax.ws.rs.core.PathSegment> getPathSegments()
getPathSegments in interface javax.ws.rs.core.UriInfopublic List<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode)
getPathSegments in interface javax.ws.rs.core.UriInfopublic Map<String,String> getProperties()
getProperties in interface InitialPropertiespublic String getProperty(String name)
InitialPropertiesgetProperty in interface InitialPropertiesname - property namepublic ProviderBinder getProviders()
getProviders in interface ApplicationContextProviderBinderProviderspublic void setProviders(ProviderBinder providers)
setProviders in interface ApplicationContextproviders - ProviderBinderpublic javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters()
getQueryParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.MultivaluedMap<String,String> getQueryParameters(boolean decode)
getQueryParameters in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.Request getRequest()
getRequest in interface ApplicationContextRequestpublic URI getRequestUri()
getRequestUri in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.UriBuilder getRequestUriBuilder()
getRequestUriBuilder in interface javax.ws.rs.core.UriInfopublic javax.ws.rs.core.SecurityContext getSecurityContext()
getSecurityContext in interface ApplicationContextSecurityContextpublic javax.ws.rs.core.UriInfo getUriInfo()
getUriInfo in interface ApplicationContextUriInfopublic void setDependencySupplier(DependencySupplier depInjector)
setDependencySupplier in interface ApplicationContextdepInjector - DependencySupplierpublic void setParameterNames(List<String> parameterNames)
ApplicationContextUriPattern.setParameterNames in interface ApplicationContextparameterNames - list of templates parameterspublic void setProperty(String name, String value)
InitialPropertiessetProperty in interface InitialPropertiesname - property namevalue - property valuepublic boolean isAsynchronous()
isAsynchronous in interface ApplicationContexttrue if request is asynchronous and false otherwise,public javax.ws.rs.core.Application getApplication()
getApplication in interface ApplicationContextpublic void setApplication(javax.ws.rs.core.Application application)
public EverrestConfiguration getEverrestConfiguration()
getEverrestConfiguration in interface ApplicationContextpublic void setEverrestConfiguration(EverrestConfiguration config)
public final void start()
Lifecyclestart in interface LifecycleLifecycle.start()public final void stop()
Lifecyclestop in interface LifecycleLifecycle.stop()Copyright © 2012–2016 Codenvy, S.A.. All rights reserved.