01: /*****************************************************************************
02: * Copyright (c) PicoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
09: *****************************************************************************/package org.picocontainer.behaviors;
10:
11: import java.io.Serializable;
12:
13: import org.picocontainer.ComponentAdapter;
14: import org.picocontainer.references.ThreadLocalReference;
15:
16: /**
17: * <p>
18: * This behavior supports caches values per thread.
19: * </p>
20: *
21: * @author Paul Hammant
22: */
23: public final class ThreadCached<T> extends Stored<T> {
24:
25: public ThreadCached(ComponentAdapter<T> delegate) {
26: super (delegate, new ThreadLocalReference<T>());
27: }
28:
29: public String getDescriptor() {
30: return "ThreadCached";
31: }
32: }
|