jodd.petite.scope
Class ThreadLocalScope

java.lang.Object
  extended by jodd.petite.scope.ThreadLocalScope
All Implemented Interfaces:
Scope

public class ThreadLocalScope
extends java.lang.Object
implements Scope

Thread local Petite bean scope. Holds beans in thread local scopes.


Field Summary
protected static java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> context
           
 
Constructor Summary
ThreadLocalScope()
           
 
Method Summary
 java.lang.Object lookup(java.lang.String name)
          Lookups for bean name.
 void register(java.lang.String name, java.lang.Object bean)
          Registers the bean within the current scope.
 void remove(java.lang.String name)
          Removes the bean from the scope entirely.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected static java.lang.ThreadLocal<java.util.Map<java.lang.String,java.lang.Object>> context
Constructor Detail

ThreadLocalScope

public ThreadLocalScope()
Method Detail

lookup

public java.lang.Object lookup(java.lang.String name)
Description copied from interface: Scope
Lookups for bean name. It may happens that lookup is performed before the registration, therefore it should returns null if object is not yet registered.

Specified by:
lookup in interface Scope

register

public void register(java.lang.String name,
                     java.lang.Object bean)
Description copied from interface: Scope
Registers the bean within the current scope.

Specified by:
register in interface Scope

remove

public void remove(java.lang.String name)
Description copied from interface: Scope
Removes the bean from the scope entirely.

Specified by:
remove in interface Scope


Copyright © 2003-2011 Jodd Team