public class ThreadContext extends Object
Modifier and Type | Method and Description |
---|---|
static ThreadContext |
detach()
Cleans the
ThreadContext and returns previous context. |
static boolean |
exists()
Checks if
ThreadContext exists for the current thread |
static ThreadContext |
get(boolean createIfDoesNotExist)
INTERNAL METHOD
|
static Application |
getApplication() |
static RequestCycle |
getRequestCycle() |
static Session |
getSession() |
static void |
restore(ThreadContext threadContext)
Restores the context
|
static void |
setApplication(Application application)
Binds the specified application to current thread.
|
static void |
setRequestCycle(RequestCycle requestCycle)
Binds the
RequestCycle to current thread. |
static void |
setSession(Session session)
Binds the session to current thread.
|
public static ThreadContext get(boolean createIfDoesNotExist)
createIfDoesNotExist
- public static boolean exists()
ThreadContext
exists for the current threadtrue
if ThreadContext
exists for the current threadpublic static Application getApplication()
Application
bound to current threadpublic static void setApplication(Application application)
application
- public static RequestCycle getRequestCycle()
RequestCycle
bound to current thradpublic static void setRequestCycle(RequestCycle requestCycle)
RequestCycle
to current thread.requestCycle
- public static void setSession(Session session)
session
- public static ThreadContext detach()
ThreadContext
and returns previous context.ThreadContext
public static void restore(ThreadContext threadContext)
threadContext
- detach()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.