Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.aspectwerkz.util
Class SerializableThreadLocal

    java.lang.Object
      java.lang.ThreadLocal
          org.codehaus.aspectwerkz.util.SerializableThreadLocal

All Implemented Interfaces:
  Serializable

    public class SerializableThreadLocal

extends ThreadLocal
implements Serializable

Extends the `java.lang.ThreadLocal` to be able to add additional functionality.

This classes enhances the base implementation by:

making it serializable

making it wrap an unwrap the values in a `java.lang.ref.WeakReference` to avoid potential memory leaks

Author:
  Jonas Bonr
See Also:
  Serialized Form

Constructor Summary
`SerializableThreadLocal()` Constructor.

Method Summary
`Object` | `get()` Overrides the `java.lang.ThreadLocal#get()` method.
`void` | `set(Object value)` Overrides the `java.lang.ThreadLoca#set(Object value)` method.

Methods inherited from class java.lang.ThreadLocal
`initialValue, remove`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SerializableThreadLocal

    public SerializableThreadLocal()

  Constructor. Simply calls the base class constructor.

Method Detail

### get

    public Object get()

  Overrides the `java.lang.ThreadLocal#get()` method. Retrieves and returns the value wrapped up in a `java.lang.ref.WeakReference` by the `SerializableThreadLocal#set(Object value)` method

  Overrides:
    `get` in class `ThreadLocal`
  Returns:
    the value wrapped up in a weak reference

### set

    public void set(Object value)

  Overrides the `java.lang.ThreadLoca#set(Object value)` method. Wraps the value in a `java.lang.ref.WeakReference` before passing it on to the `java.lang.ThreadLocal#set(Object value)` method

  Overrides:
    `set` in class `ThreadLocal`
  Parameters:
    `value` - the value that should be wrapped up in a weak reference

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.