Package org.apache.wicket
Class ThreadContext
- java.lang.Object
-
- org.apache.wicket.ThreadContext
-
public class ThreadContext extends Object
Holds thread local state for Wicket data.- Author:
- Matej Knopp
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadContext
detach()
Cleans theThreadContext
and returns previous context.static boolean
exists()
Checks ifThreadContext
exists for the current threadstatic ThreadContext
get(boolean createIfDoesNotExist)
INTERNAL METHODstatic Application
getApplication()
static RequestCycle
getRequestCycle()
static Session
getSession()
static void
restore(ThreadContext threadContext)
Restores the contextstatic void
setApplication(Application application)
Binds the specified application to current thread.static void
setRequestCycle(RequestCycle requestCycle)
Binds theRequestCycle
to current thread.static void
setSession(Session session)
Binds the session to current thread.
-
-
-
Method Detail
-
get
public static ThreadContext get(boolean createIfDoesNotExist)
INTERNAL METHOD- Parameters:
createIfDoesNotExist
-- Returns:
- ThreadContext
-
exists
public static boolean exists()
Checks ifThreadContext
exists for the current thread- Returns:
true
ifThreadContext
exists for the current thread
-
getApplication
public static Application getApplication()
- Returns:
Application
bound to current thread
-
setApplication
public static void setApplication(Application application)
Binds the specified application to current thread.- Parameters:
application
-
-
getRequestCycle
public static RequestCycle getRequestCycle()
- Returns:
RequestCycle
bound to current thrad
-
setRequestCycle
public static void setRequestCycle(RequestCycle requestCycle)
Binds theRequestCycle
to current thread.- Parameters:
requestCycle
-
-
getSession
public static Session getSession()
- Returns:
Session
bound to current thread
-
setSession
public static void setSession(Session session)
Binds the session to current thread.- Parameters:
session
-
-
detach
public static ThreadContext detach()
Cleans theThreadContext
and returns previous context.- Returns:
- old
ThreadContext
-
restore
public static void restore(ThreadContext threadContext)
Restores the context- Parameters:
threadContext
-- See Also:
detach()
-
-