public class ThreadContext extends Object
WebContext
Modifier and Type | Class and Description |
---|---|
(package private) class |
ThreadContext.InvocationContext
The part of the ThreadContext that is specific to a RequestManager and therefore subject to change for each invocation
|
Constructor and Description |
---|
ThreadContext(HttpServletRequest request,
HttpServletResponse response,
String requesturl)
Creates a new dummy thread context.
|
ThreadContext(HttpServletRequest http_request,
HttpServletResponse http_response,
String requesturl,
Response response,
Map<String,Object[]> servletparams,
String path,
ThreadContext oc)
Creates a new thread context.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
createInvocationContext(RequestManager requestmanager,
WebContext context,
Map<String,String> webapp_params,
int prefixLength) |
static void |
destroy()
Resets all thread context.
|
static ThreadContext |
get()
Returns the thread context for the current thread.
|
static String |
getBaseURL(boolean ssl)
Returns the base URL.
|
static Cache |
getCache()
Returns the cache.
|
Map<Object,String> |
getCachedPropertyValues() |
CacheTransaction |
getCurrentCacheTransaction() |
ThreadContext.InvocationContext |
getCurrentInvocationContext() |
Object |
getCurrentResult()
Gets the result that is being returned through the filter chain.
|
static DependencyMap |
getDependencyMap()
Returns the dependency map.
|
static Dispatcher |
getDispatcher() |
static Session |
getEmailSession()
Gets the current mail context using the
RequestManager if the current thread has a request context (see isInRequestContext() . |
String |
getETag(Object o)
Returns or creates an etag for the object o.
|
String |
getFullRequestPath() |
static HandlerCache |
getHandlerCache() |
(package private) LinkedList<RegisteredMethod> |
getMatchedWebMethods() |
List<FileItem> |
getParsed_request() |
XMLProducer |
getProducer()
Returns the current XML producer, or null if none.
|
String |
getReferer() |
RequestManager |
getRequestManager()
Returns the web app request manager.
|
static List<RequestManager> |
getRequestManagers()
Returns the list of request managers.
|
String |
getRequestURL()
Returns the request URL.
|
Response |
getResponse()
Returns the response object.
|
Object |
getResultIfAny() |
static String |
getServletHome()
Returns the file system path for the servlet home directory.
|
Map<String,Object[]> |
getServletParams()
Returns the servlet parameter map.
|
HttpServletRequest |
getServletRequest()
Returns the HTTP request.
|
HttpServletResponse |
getServletResponse()
Returns the HTTP response.
|
static SessionManager |
getSessionManager()
Returns the session manager.
|
static Synchronizer |
getSynchronizer()
Returns the synchronizer.
|
RuntimeException |
getThrowable() |
Map<String,String> |
getWebAppParams()
Returns the web app parameters.
|
static WebSite |
getWebSite()
Returns the web site.
|
static void |
init(String baseurl,
String baseurl_secure,
Cache cache,
List<RequestManager> requestmanagers,
SessionManager sessionmanager,
DependencyMap dependency_map,
String servlethome,
Dispatcher dispatcher)
Initializes the shared thread context.
|
boolean |
isCacheAugmented() |
boolean |
isDone()
Returns true if the application has generated and returned a response.
|
static boolean |
isInRequestContext()
Returns true if the calling thread is bound to a request context, that is the current thread is the receiver thread for
a request from the client.
|
boolean |
isPunished() |
static void |
set(ThreadContext c)
Sets the thread context for the current thread.
|
void |
setCacheAugmented(boolean cacheAugmented) |
void |
setCurrentCacheTransaction(CacheTransaction currentCacheTransaction) |
void |
setCurrentResult(Object currentResult)
Sets the result that will be returned through the filter chain an eventually sent to the client.
|
void |
setDone(boolean done)
Sets the state of the done property.
|
(package private) void |
setMatchedWebMethods(LinkedList<RegisteredMethod> matchedWebMethods) |
void |
setParsed_request(List<FileItem> parsed_request) |
void |
setProducer(XMLProducer producer)
Sets the current XML producer.
|
void |
setPunished(boolean punished) |
void |
setReferer(String referer) |
(package private) void |
setRequestManager(RequestManager manager) |
void |
setResponse(Response r)
Sets the response object.
|
static void |
setSynchronizer(Synchronizer synchronizer)
Sets the synchronizer.
|
void |
setThrowable(RuntimeException throwable) |
static void |
setWebSite(WebSite website)
Sets the web site.
|
public ThreadContext(HttpServletRequest request, HttpServletResponse response, String requesturl)
public ThreadContext(HttpServletRequest http_request, HttpServletResponse http_response, String requesturl, Response response, Map<String,Object[]> servletparams, String path, ThreadContext oc)
void createInvocationContext(RequestManager requestmanager, WebContext context, Map<String,String> webapp_params, int prefixLength)
public static void destroy()
WebSite.destroy()
, HashMapCache.destroy()
, and SessionManager.destroy()
.public static ThreadContext get()
public static String getBaseURL(boolean ssl)
ssl
- if true, returns the jwig.base_url_secure
parameter, otherwise jwig.base_url
public static Cache getCache()
public CacheTransaction getCurrentCacheTransaction()
public ThreadContext.InvocationContext getCurrentInvocationContext()
public Object getCurrentResult()
public static DependencyMap getDependencyMap()
public static Dispatcher getDispatcher()
public static Session getEmailSession()
RequestManager
if the current thread has a request context (see isInRequestContext()
.
If no thread context is available, use the first one that can be found.public String getETag(Object o)
public String getFullRequestPath()
public static HandlerCache getHandlerCache()
LinkedList<RegisteredMethod> getMatchedWebMethods()
public XMLProducer getProducer()
public String getReferer()
public RequestManager getRequestManager()
public static List<RequestManager> getRequestManagers()
public String getRequestURL()
public Response getResponse()
public Object getResultIfAny()
public static String getServletHome()
public HttpServletRequest getServletRequest()
public HttpServletResponse getServletResponse()
public static SessionManager getSessionManager()
public static Synchronizer getSynchronizer()
public RuntimeException getThrowable()
public static WebSite getWebSite()
public static void init(String baseurl, String baseurl_secure, Cache cache, List<RequestManager> requestmanagers, SessionManager sessionmanager, DependencyMap dependency_map, String servlethome, Dispatcher dispatcher)
public boolean isCacheAugmented()
public boolean isDone()
public static boolean isInRequestContext()
public boolean isPunished()
public static void set(ThreadContext c)
public void setCacheAugmented(boolean cacheAugmented)
public void setCurrentCacheTransaction(CacheTransaction currentCacheTransaction)
public void setCurrentResult(Object currentResult)
public void setDone(boolean done)
isDone()
.void setMatchedWebMethods(LinkedList<RegisteredMethod> matchedWebMethods)
public void setProducer(XMLProducer producer)
public void setPunished(boolean punished)
public void setReferer(String referer)
void setRequestManager(RequestManager manager)
public void setResponse(Response r)
public static void setSynchronizer(Synchronizer synchronizer)
public void setThrowable(RuntimeException throwable)
public static void setWebSite(WebSite website)
Copyright © 2008-2012 Anders Møller & Mathias Schwarz.