diff options
-rw-r--r-- | server/src/com/vaadin/server/VaadinSession.java | 8 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index f93cb8e070..e5d63a6961 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -721,6 +721,9 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * {@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> @@ -741,9 +744,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * 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 diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index d67e08828a..438b086ec2 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -719,9 +719,11 @@ public abstract class UI extends AbstractSingleComponentContainer implements * 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() @@ -735,6 +737,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * 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> * |