* {@link InheritableThreadLocal}). In other cases, (e.g. from background
* threads started in some other way), the current session is not
* automatically defined.
+ * <p>
+ * The session is stored using a weak reference to avoid leaking memory in
+ * case it is not explicitly cleared.
*
* @return the current session instance if available, otherwise
* <code>null</code>
* The application developer can also use this method to define the current
* session outside the normal request handling and treads started from
* request handling threads, e.g. when initiating custom background threads.
- * </p>
+ * <p>
+ * The session is stored using a weak reference to avoid leaking memory in
+ * case it is not explicitly cleared.
*
* @param session
+ * the session to set as current
*
* @see #getCurrent()
* @see ThreadLocal
* The application developer can also use this method to define the current
* UI outside the normal request handling, e.g. when initiating custom
* background threads.
- * </p>
+ * <p>
+ * The UI is stored using a weak reference to avoid leaking memory in case
+ * it is not explicitly cleared.
*
- * @param uI
+ * @param ui
* the UI to register as the current UI
*
* @see #getCurrent()
* Gets the currently used UI. The current UI is automatically defined when
* processing requests to the server. In other cases, (e.g. from background
* threads), the current UI is not automatically defined.
+ * <p>
+ * The UI is stored using a weak reference to avoid leaking memory in case
+ * it is not explicitly cleared.
*
* @return the current UI instance if available, otherwise <code>null</code>
*