Package jodd.petite.scope
Class SingletonScope
- java.lang.Object
-
- jodd.petite.scope.SingletonScope
-
-
Constructor Summary
Constructors Constructor Description SingletonScope(PetiteContainer pc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Scope referenceScope)Allows only singleton scoped beans to be injected into the target singleton bean.java.lang.Objectlookup(java.lang.String name)Lookups for bean name.voidregister(BeanDefinition beanDefinition, java.lang.Object bean)Registers the bean within the current scope.voidremove(java.lang.String name)Removes the bean from the scope entirely.voidshutdown()Iterate all beans and invokes registered destroy methods.
-
-
-
Field Detail
-
instances
protected java.util.Map<java.lang.String,BeanData> instances
-
-
Constructor Detail
-
SingletonScope
public SingletonScope(PetiteContainer pc)
-
-
Method Detail
-
lookup
public java.lang.Object lookup(java.lang.String name)
Description copied from interface:ScopeLookups for bean name. Returnsnullif bean is not found or yet registered.
-
register
public void register(BeanDefinition beanDefinition, java.lang.Object bean)
Description copied from interface:ScopeRegisters the bean within the current scope. Usually registers it by its name fromBeanDefinition. Also it may register destroy methods of a bean within this scope.
-
remove
public void remove(java.lang.String name)
Description copied from interface:ScopeRemoves the bean from the scope entirely. Destroy methods are not called as it is assumed that bean is destroyed manually.
-
accept
public boolean accept(Scope referenceScope)
Allows only singleton scoped beans to be injected into the target singleton bean.
-
-