public class ThreadLocalScope extends java.lang.Object implements Scope
Modifier and Type | Field and Description |
---|---|
protected static java.lang.ThreadLocal<java.util.Map<java.lang.String,BeanData>> |
context |
Constructor and Description |
---|
ThreadLocalScope(PetiteContainer pc) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Scope referenceScope)
Defines allowed referenced scopes that can be injected into the
thread-local scoped bean.
|
java.lang.Object |
lookup(java.lang.String name)
Lookups for bean name.
|
void |
register(BeanDefinition beanDefinition,
java.lang.Object bean)
Registers the bean within the current scope.
|
void |
remove(java.lang.String name)
Removes the bean from the scope entirely.
|
void |
shutdown()
Shutdowns the scope by removing all beans and calling
destroy methods.
|
protected static java.lang.ThreadLocal<java.util.Map<java.lang.String,BeanData>> context
public ThreadLocalScope(PetiteContainer pc)
public java.lang.Object lookup(java.lang.String name)
Scope
null
if bean is not
found or yet registered.public void register(BeanDefinition beanDefinition, java.lang.Object bean)
Scope
BeanDefinition
.
Also it may register destroy methods of a bean within this scope.public void remove(java.lang.String name)
Scope
public boolean accept(Scope referenceScope)
Copyright © 2003-present Jodd Team