org.apache.wicket
Class ThreadContext

java.lang.Object
  extended by org.apache.wicket.ThreadContext

public class ThreadContext
extends java.lang.Object

Holds thread local state for Wicket data.

Author:
Matej Knopp

Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static ThreadContext get(boolean createIfDoesNotExist)
INTERNAL METHOD

Parameters:
createIfDoesNotExist -
Returns:
ThreadContext

exists

public static boolean exists()
Checks if ThreadContext exists for the current thread

Returns:
true if ThreadContext 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 the RequestCycle 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 the ThreadContext and returns previous context.

Returns:
old ThreadContext

restore

public static void restore(ThreadContext threadContext)
Restores the context

Parameters:
threadContext -
See Also:
detach()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.