|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ThreadLocalReference.java | - | 0% | 0% | 0% |
|
1 |
/*****************************************************************************
|
|
2 |
* Copyright (c) PicoContainer Organization. All rights reserved. *
|
|
3 |
* ------------------------------------------------------------------------- *
|
|
4 |
* The software in this package is published under the terms of the BSD *
|
|
5 |
* style license a copy of which has been included with this distribution in *
|
|
6 |
* the LICENSE.txt file. *
|
|
7 |
* *
|
|
8 |
* Original code by Joerg Schaible *
|
|
9 |
*****************************************************************************/
|
|
10 |
package org.picocontainer.defaults;
|
|
11 |
|
|
12 |
/**
|
|
13 |
* Implementation of an {@link ObjectReference}as {@link ThreadLocal}.
|
|
14 |
* @author Jörg Schaible
|
|
15 |
*/
|
|
16 |
public class ThreadLocalReference |
|
17 |
implements ObjectReference {
|
|
18 |
|
|
19 |
private ThreadLocal instance = new ThreadLocal(); |
|
20 |
|
|
21 |
/**
|
|
22 |
* @see org.picocontainer.defaults.ObjectReference#get()
|
|
23 |
*/
|
|
24 | 0 |
public Object get() {
|
25 | 0 |
return instance.get();
|
26 |
} |
|
27 |
|
|
28 |
/**
|
|
29 |
* @see org.picocontainer.defaults.ObjectReference#set(java.lang.Object)
|
|
30 |
*/
|
|
31 | 0 |
public void set(Object item) { |
32 | 0 |
instance.set(item); |
33 |
} |
|
34 |
|
|
35 |
} |
|